commit ea384f95f647eac148653b6e7e13f1cd35c77513
Author: Amogh Pradeep <[email protected]>
Date: Sat May 24 02:31:57 2014 +0530
cleaned ChooseLocaleWizardActivity workflow, implemented override for back
button and added toast warning message string
---
res/values/strings.xml | 1 +
.../android/wizard/ChooseLocaleWizardActivity.java | 20 ++++++++++++++++----
.../torproject/android/wizard/TipsAndTricks.java | 2 +-
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/res/values/strings.xml b/res/values/strings.xml
index c4c6143..4eb1294 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -84,6 +84,7 @@
<string name="wizard_proxy_help_msg">If the Android app you are using can
support the use of an HTTP or SOCKS proxy, then you can configure it to connect
to Orbot and use Tor.\n\n\n The host settings is 127.0.0.1 or \"localhost\".
For HTTP, the port setting is 8118. For SOCKS, the proxy is 9050. You should
use SOCKS4A or SOCKS5 if possible.\n \n\n\n You can learn more about
proxying on Android via the FAQ at: http://tinyurl.com/proxyandroid\n
</string>
<string name="wizard_final">Orbot is ready!</string>
<string name="wizard_final_msg">Hundreds of thousands of people around the
world use Tor for a wide variety of reasons.\n\nJournalists and bloggers, human
rights defenders, law enforcement officers, soldiers, corporations, citizens of
repressive regimes, and just ordinary citizens… and now you are ready to,
as well!</string>
+ <string name="wizard_exit_at_first_screen_toast">Please configure Orbot
before you can start using it!</string>
<!--END Welcome Wizard strings (DJH)-->
<string name="connect_first_time">You\'ve successfully connected to the Tor
network - but this does NOT mean your device is secure. You can use the
\'Check\' option from the menu to test your browser. \n\nVisit us at
https://guardianproject.info/apps/orbot or send an email to
[email protected] to learn more.</string>
<string name="tor_check">This will open your web browser to
https://check.torproject.org in order to see if Orbot is probably configured
and you are connected to Tor.</string>
diff --git a/src/org/torproject/android/wizard/ChooseLocaleWizardActivity.java
b/src/org/torproject/android/wizard/ChooseLocaleWizardActivity.java
index 6385227..fe1d7cd 100644
--- a/src/org/torproject/android/wizard/ChooseLocaleWizardActivity.java
+++ b/src/org/torproject/android/wizard/ChooseLocaleWizardActivity.java
@@ -7,19 +7,20 @@ 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.content.res.Configuration;
import android.os.Bundle;
-import android.preference.PreferenceManager;
+import android.util.Log;
+import android.view.KeyEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
+import android.widget.Toast;
public class ChooseLocaleWizardActivity extends Activity implements
TorConstants {
@@ -73,6 +74,7 @@ public class ChooseLocaleWizardActivity extends Activity
implements TorConstants
int arg2, long arg3) {
setLocalePref(arg2);
+ finish();
startActivityForResult(new
Intent(ChooseLocaleWizardActivity.this, LotsaText.class), 1);
}
@@ -81,8 +83,7 @@ public class ChooseLocaleWizardActivity extends Activity
implements TorConstants
next.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
-
-
+ finish();
startActivityForResult(new
Intent(ChooseLocaleWizardActivity.this, LotsaText.class), 1);
}
@@ -135,4 +136,15 @@ public class ChooseLocaleWizardActivity extends Activity
implements TorConstants
super.onSaveInstanceState(outState);
}
+
+ //Code to override the back button!
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ Log.d("myTag", "IT HAS BEEN CLICKED :O"+keyCode+" "+event);
+ if(keyCode == KeyEvent.KEYCODE_BACK){
+ Toast.makeText(getApplicationContext(),
R.string.wizard_exit_at_first_screen_toast, Toast.LENGTH_SHORT).show();
+ return true;
+ }
+ return false;
+ }
}
\ No newline at end of file
diff --git a/src/org/torproject/android/wizard/TipsAndTricks.java
b/src/org/torproject/android/wizard/TipsAndTricks.java
index 3d2437e..7b4fb2e 100644
--- a/src/org/torproject/android/wizard/TipsAndTricks.java
+++ b/src/org/torproject/android/wizard/TipsAndTricks.java
@@ -202,7 +202,7 @@ public class TipsAndTricks extends Activity implements
TorConstants {
startActivityForResult(new Intent(getBaseContext(),
Orbot.class), 1);
return true;
}
- return true;
+ return false;
}
/*
_______________________________________________
tor-commits mailing list
[email protected]
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits