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);
protected void onResume() {
super.onResume();
if (requestCode == 1 && mService != null)
if (mService != null && torStatus != TorServiceConstants.STATUS_ON)
{
try {
mService.processSettings();
@ -816,7 +816,6 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic
e.printStackTrace();
}
}
}
AlertDialog aDialog = null;

View File

@ -39,20 +39,6 @@ public class ChooseLocaleWizardActivity extends Activity implements TorConstants
super.onStart();
setContentView(R.layout.layout_wizard_locale);
stepSix();
}
@Override
protected void onResume() {
super.onResume();
}
private void stepSix(){
listLocales = (ListView)findViewById(R.id.wizard_locale_list);
Button next = ((Button)findViewById(R.id.btnWizard2));
@ -75,7 +61,7 @@ public class ChooseLocaleWizardActivity extends Activity implements TorConstants
setLocalePref(arg2);
finish();
startActivityForResult(new Intent(ChooseLocaleWizardActivity.this, LotsaText.class), 1);
startActivity(new Intent(ChooseLocaleWizardActivity.this, LotsaText.class));
}
});
@ -83,8 +69,9 @@ public class ChooseLocaleWizardActivity extends Activity implements TorConstants
next.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
setLocalePref(0);
finish();
startActivityForResult(new Intent(ChooseLocaleWizardActivity.this, LotsaText.class), 1);
startActivity(new Intent(ChooseLocaleWizardActivity.this, LotsaText.class));
}
});

View File

@ -65,18 +65,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 ()
{
SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext());
@ -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

@ -52,19 +52,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() {
SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext());
@ -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

@ -40,17 +40,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;