more wizard flow fixes

This commit is contained in:
Nathan Freitas 2014-06-06 14:19:06 -04:00
parent 816a6b2be0
commit 120da6bfe2
6 changed files with 55 additions and 118 deletions

View File

@ -786,10 +786,9 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic
Editor pEdit = mPrefs.edit();
pEdit.putBoolean("wizardscreen1",true);
pEdit.commit();
startActivityForResult(new Intent(getApplicationContext(), ChooseLocaleWizardActivity.class), 1);
startActivity(new Intent(getApplicationContext(), ChooseLocaleWizardActivity.class));
}
/*
* Load the basic settings application to display torrc
*/
@ -800,12 +799,13 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 1 && mService != null)
protected void onResume() {
super.onResume();
if (mService != null && torStatus != TorServiceConstants.STATUS_ON)
{
try {
mService.processSettings();
@ -816,10 +816,9 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic
e.printStackTrace();
}
}
}
AlertDialog aDialog = null;
}
AlertDialog aDialog = null;
//general alert dialog for mostly Tor warning messages
//sometimes this can go haywire or crazy with too many error

View File

@ -39,55 +39,42 @@ public class ChooseLocaleWizardActivity extends Activity implements TorConstants
super.onStart();
setContentView(R.layout.layout_wizard_locale);
stepSix();
}
@Override
protected void onResume() {
super.onResume();
}
listLocales = (ListView)findViewById(R.id.wizard_locale_list);
Button next = ((Button)findViewById(R.id.btnWizard2));
// next.setEnabled(false);
String[] strLangs = getResources().getStringArray(R.array.languages);
strLangs[0] = Locale.getDefault().getDisplayName();
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, strLangs);
listLocales.setAdapter(adapter);
listLocales.setSelection(0);
listLocales.setOnItemClickListener(new OnItemClickListener() {
private void stepSix(){
listLocales = (ListView)findViewById(R.id.wizard_locale_list);
Button next = ((Button)findViewById(R.id.btnWizard2));
// next.setEnabled(false);
String[] strLangs = getResources().getStringArray(R.array.languages);
strLangs[0] = Locale.getDefault().getDisplayName();
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, strLangs);
listLocales.setAdapter(adapter);
listLocales.setSelection(0);
listLocales.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
setLocalePref(arg2);
finish();
startActivityForResult(new Intent(ChooseLocaleWizardActivity.this, LotsaText.class), 1);
}
});
next.setOnClickListener(new View.OnClickListener() {
setLocalePref(arg2);
finish();
startActivity(new Intent(ChooseLocaleWizardActivity.this, LotsaText.class));
public void onClick(View v) {
finish();
startActivityForResult(new Intent(ChooseLocaleWizardActivity.this, LotsaText.class), 1);
}
});
next.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
setLocalePref(0);
finish();
startActivity(new Intent(ChooseLocaleWizardActivity.this, LotsaText.class));
}
});
}
});

View File

@ -64,18 +64,6 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch(resultCode)
{
case RESULT_CLOSE_ALL:
setResult(RESULT_CLOSE_ALL);
finish();
}
super.onActivityResult(requestCode, resultCode, data);
}
private void setupUI ()
{
@ -122,7 +110,7 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
public void onClick(View v) {
finish();
startActivityForResult(new Intent(ConfigureTransProxy.this, Permissions.class), 1);
startActivity(new Intent(ConfigureTransProxy.this, Permissions.class));
}
});
@ -130,7 +118,7 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
public void onClick(View v) {
finish();
startActivityForResult(new Intent(ConfigureTransProxy.this, TipsAndTricks.class), 1);
startActivity(new Intent(ConfigureTransProxy.this, TipsAndTricks.class));
}
});
@ -144,8 +132,8 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
{
public void onClick(View v) {
finish();
context.startActivity(new Intent(context, AppManager.class));
startActivity(new Intent(ConfigureTransProxy.this, AppManager.class));
}
});

View File

@ -51,19 +51,6 @@ public class LotsaText extends Activity implements TorConstants{
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch(resultCode)
{
case RESULT_CLOSE_ALL:
setResult(RESULT_CLOSE_ALL);
finish();
}
super.onActivityResult(requestCode, resultCode, data);
}
private void stepOne() {
@ -130,7 +117,7 @@ public class LotsaText extends Activity implements TorConstants{
public void onClick(View v) {
finish();
startActivityForResult(new Intent(LotsaText.this, Permissions.class), 1);
startActivity(new Intent(LotsaText.this, Permissions.class));
}
});
@ -141,7 +128,7 @@ public class LotsaText extends Activity implements TorConstants{
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_BACK){
finish();
startActivityForResult(new Intent(getBaseContext(), ChooseLocaleWizardActivity.class), 1);
startActivity(new Intent(getBaseContext(), ChooseLocaleWizardActivity.class));
return true;
}
return true;

View File

@ -48,17 +48,6 @@ public class Permissions extends Activity implements TorConstants {
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch(resultCode)
{
case RESULT_CLOSE_ALL:
setResult(RESULT_CLOSE_ALL);
finish();
}
super.onActivityResult(requestCode, resultCode, data);
}
private void stepFourRoot(){
@ -137,7 +126,7 @@ public class Permissions extends Activity implements TorConstants {
else
{
finish();
startActivityForResult(new Intent(Permissions.this, ConfigureTransProxy.class), 1);
startActivity(new Intent(Permissions.this, ConfigureTransProxy.class));
}
@ -148,7 +137,7 @@ public class Permissions extends Activity implements TorConstants {
public void onClick(View v) {
finish();
startActivityForResult(new Intent(Permissions.this, LotsaText.class), 1);
startActivity(new Intent(Permissions.this, LotsaText.class));
}
});
@ -158,7 +147,7 @@ public class Permissions extends Activity implements TorConstants {
public void onClick(View v) {
finish();
startActivityForResult(new Intent(Permissions.this, TipsAndTricks.class), 1);
startActivity(new Intent(Permissions.this, TipsAndTricks.class));
}
});
@ -184,7 +173,6 @@ public class Permissions extends Activity implements TorConstants {
Button grantPermissions = ((Button)findViewById(R.id.grantPermissions));
grantPermissions.setVisibility(Button.GONE);
CheckBox consent = (CheckBox)findViewById(R.id.checkBox);
consent.setVisibility(CheckBox.GONE);
@ -192,7 +180,7 @@ public class Permissions extends Activity implements TorConstants {
public void onClick(View v) {
finish();
startActivityForResult(new Intent(Permissions.this, LotsaText.class), 1);
startActivity(new Intent(Permissions.this, LotsaText.class));
}
});
@ -200,7 +188,7 @@ public class Permissions extends Activity implements TorConstants {
public void onClick(View v) {
finish();
startActivityForResult(new Intent(Permissions.this, TipsAndTricks.class), 1);
startActivity(new Intent(Permissions.this, TipsAndTricks.class));
}
});
}
@ -209,7 +197,7 @@ public class Permissions extends Activity implements TorConstants {
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_BACK){
finish();
startActivityForResult(new Intent(getBaseContext(), LotsaText.class), 1);
startActivity(new Intent(getBaseContext(), LotsaText.class));
return true;
}
return false;

View File

@ -39,17 +39,6 @@ public class TipsAndTricks extends Activity implements TorConstants {
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch(resultCode)
{
case RESULT_CLOSE_ALL:
setResult(RESULT_CLOSE_ALL);
finish();
}
super.onActivityResult(requestCode, resultCode, data);
}
void stepFive(){
@ -192,7 +181,7 @@ public class TipsAndTricks extends Activity implements TorConstants {
public void onClick(View v) {
finish();
startActivityForResult(new Intent(TipsAndTricks.this, Permissions.class), 1);
startActivity(new Intent(TipsAndTricks.this, Permissions.class));
}
});
@ -200,7 +189,6 @@ public class TipsAndTricks extends Activity implements TorConstants {
public void onClick(View v) {
finish();
startActivity(new Intent(TipsAndTricks.this, Orbot.class));
}
});
}
@ -210,7 +198,7 @@ public class TipsAndTricks extends Activity implements TorConstants {
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_BACK){
finish();
startActivityForResult(new Intent(getBaseContext(), Permissions.class), 1);
startActivity(new Intent(getBaseContext(), Permissions.class));
return true;
}
return false;