[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [orbot/master] remove unneeded wizard classes
commit a6245037b4fbe2ee81c8fd871a2e9f812ca2e7ee
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
Date: Sun Feb 15 01:22:38 2015 -0500
remove unneeded wizard classes
---
src/org/torproject/android/OrbotMainActivity.java | 5 +-
.../android/ui/ChooseLocaleWizardActivity.java | 4 +-
src/org/torproject/android/ui/LotsaText.java | 137 --------------------
src/org/torproject/android/ui/TipsAndTricks.java | 43 +-----
.../torproject/android/vpn/OrbotVpnService.java | 2 +
5 files changed, 14 insertions(+), 177 deletions(-)
diff --git a/src/org/torproject/android/OrbotMainActivity.java b/src/org/torproject/android/OrbotMainActivity.java
index af5c2e5..0856326 100644
--- a/src/org/torproject/android/OrbotMainActivity.java
+++ b/src/org/torproject/android/OrbotMainActivity.java
@@ -242,6 +242,7 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
});
+ mBtnBrowser.setEnabled(false);
mBtnVPN = (ToggleButton)findViewById(R.id.btnVPN);
@@ -888,7 +889,8 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
imgStatus.setImageResource(R.drawable.toron);
-
+ mBtnBrowser.setEnabled(true);
+
if (mItemOnOff != null)
mItemOnOff.setTitle(R.string.menu_stop);
@@ -948,6 +950,7 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
imgStatus.setImageResource(R.drawable.toroff);
lblStatus.setText("");
//lblStatus.setText(getString(R.string.status_disabled) + "\n" + getString(R.string.press_to_start));
+ mBtnBrowser.setEnabled(false);
if (mItemOnOff != null)
mItemOnOff.setTitle(R.string.menu_start);
diff --git a/src/org/torproject/android/ui/ChooseLocaleWizardActivity.java b/src/org/torproject/android/ui/ChooseLocaleWizardActivity.java
index ff4a0aa..95f8766 100644
--- a/src/org/torproject/android/ui/ChooseLocaleWizardActivity.java
+++ b/src/org/torproject/android/ui/ChooseLocaleWizardActivity.java
@@ -60,7 +60,7 @@ public class ChooseLocaleWizardActivity extends Activity implements TorConstants
setLocalePref(arg2);
finish();
- startActivity(new Intent(ChooseLocaleWizardActivity.this, LotsaText.class));
+ startActivity(new Intent(ChooseLocaleWizardActivity.this, TipsAndTricks.class));
}
});
@@ -70,7 +70,7 @@ public class ChooseLocaleWizardActivity extends Activity implements TorConstants
public void onClick(View v) {
setLocalePref(0);
finish();
- startActivity(new Intent(ChooseLocaleWizardActivity.this, LotsaText.class));
+ startActivity(new Intent(ChooseLocaleWizardActivity.this, TipsAndTricks.class));
}
});
diff --git a/src/org/torproject/android/ui/LotsaText.java b/src/org/torproject/android/ui/LotsaText.java
deleted file mode 100644
index 5fdaa57..0000000
--- a/src/org/torproject/android/ui/LotsaText.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package org.torproject.android.ui;
-
-import org.torproject.android.R;
-import org.torproject.android.TorConstants;
-import org.torproject.android.service.TorServiceUtils;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.SharedPreferences.Editor;
-import android.os.Bundle;
-import android.view.KeyEvent;
-import android.view.View;
-import android.widget.Button;
-import android.widget.TextView;
-
-public class LotsaText extends Activity implements TorConstants{
-
- private Context context;
-
- protected void onCreate(Bundle savedInstanceState)
- {
-
-
- super.onCreate(savedInstanceState);
- context = this;
-
-
- }
-
- @Override
- protected void onStart() {
-
- super.onStart();
- setContentView(R.layout.scrollingtext_buttons_view);
-
- SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext());
-
- boolean wizardScreen1 = prefs.getBoolean("wizardscreen1",true);
- if(wizardScreen1)
- stepOne();
- else
- stepTwo();
-
- }
-
- @Override
- protected void onResume() {
- super.onResume();
-
-
- }
-
- private void stepOne() {
-
- SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext());
-
- Editor pEdit = prefs.edit();
- pEdit.putBoolean("wizardscreen1",true);
- pEdit.commit();
-
- String title = context.getString(R.string.wizard_title);
- String msg = context.getString(R.string.wizard_title_msg);
-
- setTitle(title);
-
- TextView txtBody = ((TextView)findViewById(R.id.WizardTextBody));
- txtBody.setText(msg);
-
- Button btn1 = ((Button)findViewById(R.id.btnWizard1));
- Button btn2 = ((Button)findViewById(R.id.btnWizard2));
-
- btn1.setVisibility(Button.INVISIBLE);
-
- btn2.setOnClickListener(new View.OnClickListener() {
-
- public void onClick(View v) {
- stepTwo();
- }
- });
-
- }
-
- private void stepTwo() {
-
- SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext());
-
- Editor pEdit = prefs.edit();
- pEdit.putBoolean("wizardscreen1",false);
- pEdit.commit();
-
- setContentView(R.layout.scrollingtext_buttons_view);
- String title = context.getString(R.string.wizard_warning_title);
- String msg = context.getString(R.string.wizard_warning_msg);
-
- setTitle(title);
-
- TextView txtBody = ((TextView)findViewById(R.id.WizardTextBody));
- txtBody.setText(msg);
-
- Button btn1 = ((Button)findViewById(R.id.btnWizard1));
- Button btn2 = ((Button)findViewById(R.id.btnWizard2));
-
- btn1.setVisibility(Button.VISIBLE);
-
-
- btn1.setOnClickListener(new View.OnClickListener() {
-
- public void onClick(View v) {
-
- stepOne();
- }
- });
-
- btn2.setOnClickListener(new View.OnClickListener() {
-
- public void onClick(View v) {
- finish();
- startActivity(new Intent(LotsaText.this, TipsAndTricks.class));
- }
- });
-
- }
-
- //Code to override the back button!
- @Override
- public boolean onKeyDown(int keyCode, KeyEvent event) {
- if(keyCode == KeyEvent.KEYCODE_BACK){
- finish();
- startActivity(new Intent(getBaseContext(), ChooseLocaleWizardActivity.class));
- return true;
- }
- return true;
- }
-
-}
\ No newline at end of file
diff --git a/src/org/torproject/android/ui/TipsAndTricks.java b/src/org/torproject/android/ui/TipsAndTricks.java
index 5bf3cd6..d0e711b 100644
--- a/src/org/torproject/android/ui/TipsAndTricks.java
+++ b/src/org/torproject/android/ui/TipsAndTricks.java
@@ -1,6 +1,5 @@
package org.torproject.android.ui;
-import org.torproject.android.OrbotMainActivity;
import org.torproject.android.R;
import org.torproject.android.TorConstants;
@@ -8,7 +7,6 @@ import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
-import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
@@ -157,58 +155,29 @@ public class TipsAndTricks extends Activity implements TorConstants {
public void onClick(View v) {
finish();
- startActivityForResult(new Intent(TipsAndTricks.this, LotsaText.class), 1);
+ startActivityForResult(new Intent(TipsAndTricks.this, ChooseLocaleWizardActivity.class), 1);
}
});
next.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
- showWizardFinal();
+ //showWizardFinal();
+
+ finish();
}
});
}
- private void showWizardFinal ()
- {
- setContentView(R.layout.scrollingtext_buttons_view);
- String title = getString(R.string.wizard_final);
- String msg = getString(R.string.wizard_final_msg);
-
- setTitle(title);
-
- TextView txtBody = ((TextView)findViewById(R.id.WizardTextBody));
- txtBody.setText(msg);
-
- Button btn1 = ((Button)findViewById(R.id.btnWizard1));
- Button btn2 = ((Button)findViewById(R.id.btnWizard2));
-
- btn2.setText(getString(R.string.btn_finish));
- btn1.setVisibility(Button.VISIBLE);
-
- btn1.setOnClickListener(new View.OnClickListener() {
-
- public void onClick(View v) {
- finish();
- startActivity(new Intent(TipsAndTricks.this, LotsaText.class));
- }
- });
-
- btn2.setOnClickListener(new View.OnClickListener() {
-
- public void onClick(View v) {
- finish();
- }
- });
- }
+
//Code to override the back button!
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_BACK){
finish();
- startActivity(new Intent(getBaseContext(), LotsaText.class));
+ startActivity(new Intent(getBaseContext(), ChooseLocaleWizardActivity.class));
return true;
}
return false;
diff --git a/src/org/torproject/android/vpn/OrbotVpnService.java b/src/org/torproject/android/vpn/OrbotVpnService.java
index dd5ffd9..365edab 100644
--- a/src/org/torproject/android/vpn/OrbotVpnService.java
+++ b/src/org/torproject/android/vpn/OrbotVpnService.java
@@ -129,6 +129,8 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
HttpProxy.setVpnService(OrbotVpnService.this);
mHttpProxyServer.setDebug(5, System.out);
mHttpProxyServer.start();
+
+
}
@Override
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits