UI and flow updates
This commit is contained in:
parent
442216fd2e
commit
b6e2507580
|
@ -108,12 +108,11 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
|
||||||
|
|
||||||
setLocale();
|
setLocale();
|
||||||
|
|
||||||
startService(new Intent(INTENT_TOR_SERVICE));
|
startService(new Intent(INTENT_TOR_SERVICE));
|
||||||
|
|
||||||
prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
|
doLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doLayout ()
|
private void doLayout ()
|
||||||
|
@ -167,7 +166,7 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
|
||||||
downloadText.setText(formatCount(0) + " / " + formatTotal(0));
|
downloadText.setText(formatCount(0) + " / " + formatTotal(0));
|
||||||
uploadText.setText(formatCount(0) + " / " + formatTotal(0));
|
uploadText.setText(formatCount(0) + " / " + formatTotal(0));
|
||||||
|
|
||||||
//updateStatus("");
|
updateStatus("");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void appendLogTextAndScroll(String text)
|
private void appendLogTextAndScroll(String text)
|
||||||
|
@ -330,7 +329,7 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
|
|
||||||
unbindService();
|
//unbindService();
|
||||||
|
|
||||||
//hideProgressDialog();
|
//hideProgressDialog();
|
||||||
|
|
||||||
|
@ -417,8 +416,18 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
|
||||||
|
|
||||||
bindService();
|
bindService();
|
||||||
|
|
||||||
doLayout ();
|
updateStatus("");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onNewIntent(Intent intent) {
|
||||||
|
|
||||||
|
super.onNewIntent(intent);
|
||||||
|
|
||||||
|
updateStatus("");
|
||||||
|
handleIntents();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleIntents ()
|
private void handleIntents ()
|
||||||
|
@ -553,7 +562,7 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
|
|
||||||
unbindService();
|
//unbindService();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -564,6 +573,7 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
|
||||||
private void openBrowser(String url)
|
private void openBrowser(String url)
|
||||||
{
|
{
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP|Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -597,16 +607,15 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
||||||
|
|
||||||
|
if (requestCode == 1 && mService != null)
|
||||||
|
{
|
||||||
|
new ProcessSettingsAsyncTask().execute(mService);
|
||||||
|
setLocale();
|
||||||
|
}
|
||||||
|
|
||||||
//if we get a response from an activity we launched (like from line 527 where we launch the Settings/Prefs screen)
|
|
||||||
//and the resultCode matches our arbitrary 1010 value, AND Tor is running
|
|
||||||
//then update the preferences in an async background task
|
|
||||||
if (requestCode == 1 && resultCode == 1010 && mService != null)
|
|
||||||
{
|
|
||||||
new ProcessSettingsAsyncTask().execute(mService);
|
|
||||||
setLocale();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AlertDialog aDialog = null;
|
AlertDialog aDialog = null;
|
||||||
|
@ -922,6 +931,10 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
|
||||||
downloadText.setText(formatCount(datacount.Download) + " / " + formatTotal(totalRead));
|
downloadText.setText(formatCount(datacount.Download) + " / " + formatTotal(totalRead));
|
||||||
uploadText.setText(formatCount(datacount.Upload) + " / " + formatTotal(totalWrite));
|
uploadText.setText(formatCount(datacount.Upload) + " / " + formatTotal(totalWrite));
|
||||||
|
|
||||||
|
if (torStatus != TorServiceConstants.STATUS_ON)
|
||||||
|
{
|
||||||
|
updateStatus("");
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
super.handleMessage(msg);
|
super.handleMessage(msg);
|
||||||
|
@ -1021,13 +1034,15 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//maybe needs this?
|
|
||||||
mService = null;
|
|
||||||
|
|
||||||
// Detach our existing connection.
|
// Detach our existing connection.
|
||||||
unbindService(mConnection);
|
unbindService(mConnection);
|
||||||
mIsBound = false;
|
mIsBound = false;
|
||||||
|
|
||||||
|
|
||||||
|
//maybe needs this?
|
||||||
|
mService = null;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,9 +40,10 @@ public class RandomColorCircleView extends View
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(){
|
private void init(){
|
||||||
paint.setStyle(Paint.Style.FILL);
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
paint.setColor(Color.WHITE);
|
paint.setColor(Color.WHITE);
|
||||||
// paint.setAntiAlias(true);
|
paint.setAntiAlias(false);
|
||||||
|
paint.setStrokeWidth(6);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,6 +97,7 @@ public class RandomColorCircleView extends View
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouchEvent(MotionEvent event) {
|
public boolean onTouchEvent(MotionEvent event) {
|
||||||
|
|
||||||
|
@ -127,6 +129,6 @@ public class RandomColorCircleView extends View
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue