cleaned ChooseLocaleWizardActivity workflow, implemented override for back button and added toast warning message string

This commit is contained in:
Amogh Pradeep 2014-05-24 02:31:57 +05:30
parent ffcfce742b
commit ea384f95f6
3 changed files with 18 additions and 5 deletions

View File

@ -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&#8230; 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 help@guardianproject.info 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>

View File

@ -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;
}
}

View File

@ -202,7 +202,7 @@ public class TipsAndTricks extends Activity implements TorConstants {
startActivityForResult(new Intent(getBaseContext(), Orbot.class), 1);
return true;
}
return true;
return false;
}
/*