remove unneeded wizard classes
This commit is contained in:
parent
70d6203fdb
commit
a6245037b4
|
@ -242,6 +242,7 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
mBtnBrowser.setEnabled(false);
|
||||||
|
|
||||||
mBtnVPN = (ToggleButton)findViewById(R.id.btnVPN);
|
mBtnVPN = (ToggleButton)findViewById(R.id.btnVPN);
|
||||||
|
|
||||||
|
@ -888,7 +889,8 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
|
||||||
|
|
||||||
imgStatus.setImageResource(R.drawable.toron);
|
imgStatus.setImageResource(R.drawable.toron);
|
||||||
|
|
||||||
|
mBtnBrowser.setEnabled(true);
|
||||||
|
|
||||||
if (mItemOnOff != null)
|
if (mItemOnOff != null)
|
||||||
mItemOnOff.setTitle(R.string.menu_stop);
|
mItemOnOff.setTitle(R.string.menu_stop);
|
||||||
|
|
||||||
|
@ -948,6 +950,7 @@ public class OrbotMainActivity extends Activity implements TorConstants, OnLongC
|
||||||
imgStatus.setImageResource(R.drawable.toroff);
|
imgStatus.setImageResource(R.drawable.toroff);
|
||||||
lblStatus.setText("");
|
lblStatus.setText("");
|
||||||
//lblStatus.setText(getString(R.string.status_disabled) + "\n" + getString(R.string.press_to_start));
|
//lblStatus.setText(getString(R.string.status_disabled) + "\n" + getString(R.string.press_to_start));
|
||||||
|
mBtnBrowser.setEnabled(false);
|
||||||
|
|
||||||
if (mItemOnOff != null)
|
if (mItemOnOff != null)
|
||||||
mItemOnOff.setTitle(R.string.menu_start);
|
mItemOnOff.setTitle(R.string.menu_start);
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class ChooseLocaleWizardActivity extends Activity implements TorConstants
|
||||||
|
|
||||||
setLocalePref(arg2);
|
setLocalePref(arg2);
|
||||||
finish();
|
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) {
|
public void onClick(View v) {
|
||||||
setLocalePref(0);
|
setLocalePref(0);
|
||||||
finish();
|
finish();
|
||||||
startActivity(new Intent(ChooseLocaleWizardActivity.this, LotsaText.class));
|
startActivity(new Intent(ChooseLocaleWizardActivity.this, TipsAndTricks.class));
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.torproject.android.ui;
|
package org.torproject.android.ui;
|
||||||
|
|
||||||
import org.torproject.android.OrbotMainActivity;
|
|
||||||
import org.torproject.android.R;
|
import org.torproject.android.R;
|
||||||
import org.torproject.android.TorConstants;
|
import org.torproject.android.TorConstants;
|
||||||
|
|
||||||
|
@ -8,7 +7,6 @@ import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
|
@ -157,58 +155,29 @@ public class TipsAndTricks extends Activity implements TorConstants {
|
||||||
|
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
finish();
|
finish();
|
||||||
startActivityForResult(new Intent(TipsAndTricks.this, LotsaText.class), 1);
|
startActivityForResult(new Intent(TipsAndTricks.this, ChooseLocaleWizardActivity.class), 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
next.setOnClickListener(new View.OnClickListener() {
|
next.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
public void onClick(View v) {
|
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!
|
//Code to override the back button!
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
if(keyCode == KeyEvent.KEYCODE_BACK){
|
if(keyCode == KeyEvent.KEYCODE_BACK){
|
||||||
finish();
|
finish();
|
||||||
startActivity(new Intent(getBaseContext(), LotsaText.class));
|
startActivity(new Intent(getBaseContext(), ChooseLocaleWizardActivity.class));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -129,6 +129,8 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
|
||||||
HttpProxy.setVpnService(OrbotVpnService.this);
|
HttpProxy.setVpnService(OrbotVpnService.this);
|
||||||
mHttpProxyServer.setDebug(5, System.out);
|
mHttpProxyServer.setDebug(5, System.out);
|
||||||
mHttpProxyServer.start();
|
mHttpProxyServer.start();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue