[tor-commits] [orbot/master] more UI clean-up, removing old wizard code

n8fr8 at torproject.org n8fr8 at torproject.org
Fri Apr 3 17:04:08 UTC 2015


commit 8c5b38eeea019f582d28708eb02bc0ac57e1b074
Author: Nathan Freitas <nathan at freitas.net>
Date:   Sat Mar 28 00:55:28 2015 -0400

    more UI clean-up, removing old wizard code
---
 AndroidManifest.xml                                |    2 +-
 res/layout/layout_wizard_proxy_help.xml            |   28 ---
 res/layout/layout_wizard_stock.xml                 |   31 ---
 res/layout/layout_wizard_tips.xml                  |    4 +-
 src/org/torproject/android/OrbotMainActivity.java  |   10 +-
 .../ui/wizard/ChooseLocaleWizardActivity.java      |    4 +-
 .../android/ui/wizard/PromoAppsActivity.java       |  214 ++++++++++++++++++++
 .../android/ui/wizard/TipsAndTricks.java           |  213 -------------------
 8 files changed, 225 insertions(+), 281 deletions(-)

diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index ee624d8..2dd7d1c 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -88,7 +88,7 @@
 			/> 
 			      	
 			      	
-      	<activity android:name="org.torproject.android.ui.wizard.TipsAndTricks" android:exported="false"/>
+      	<activity android:name="org.torproject.android.ui.wizard.PromoAppsActivity" android:exported="false"/>
   org.torproject.android.ui.wizard.ChooseLocaleWizardActivityui.ChooseLocaleWizardActivity" android:exported="false"/>
       	
       	<activity android:name=".settings.SettingsPreferences"  android:label="@string/app_name"/>
diff --git a/res/layout/layout_wizard_proxy_help.xml b/res/layout/layout_wizard_proxy_help.xml
deleted file mode 100644
index d5e1d56..0000000
--- a/res/layout/layout_wizard_proxy_help.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content">
-	<ScrollView android:id="@+id/helpscrollview" 
-		android:orientation="vertical"
-		android:layout_width="fill_parent" 
-		android:layout_height="fill_parent">    
-		<LinearLayout
-		    android:orientation="vertical"
-		    android:layout_width="fill_parent"
-		    android:layout_height="fill_parent"
-		    android:padding="3px">
-<TextView android:text="@string/wizard_proxy_help_msg" 	android:textColor="#ffffff" 
-    android:id="@+id/WizardRootTextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"
-    
-    
-    ></TextView>
-
-
-
-			</LinearLayout>
-		</ScrollView>			
-</LinearLayout>
-
diff --git a/res/layout/layout_wizard_stock.xml b/res/layout/layout_wizard_stock.xml
deleted file mode 100644
index b8f15d1..0000000
--- a/res/layout/layout_wizard_stock.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content">
-	<ScrollView android:id="@+id/helpscrollview" 
-		android:orientation="vertical"
-		android:layout_width="fill_parent" 
-		android:layout_height="fill_parent">    
-		<LinearLayout
-		    android:orientation="vertical"
-		    android:layout_width="fill_parent"
-		    android:layout_height="fill_parent"
-		    android:padding="3px">
-
-
-<TextView android:text="@string/wizard_permissions_msg_stock" 	android:textColor="#ffffff" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
-
-<Button android:text="@string/wizard_permission_enable_root" android:layout_marginTop="10px" android:id="@+id/WizardRootButtonEnable" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
-
-
-
-<TextView android:text="@string/wizard_permissions_no_root" android:layout_marginTop="10px"	android:textColor="#ffffff" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
-
-<CheckBox  android:text="@string/wizard_permissions_consent" android:id="@+id/CheckBoxConsent" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
-			</LinearLayout>
-		</ScrollView>			
-</LinearLayout>
-
diff --git a/res/layout/layout_wizard_tips.xml b/res/layout/layout_wizard_tips.xml
index 899b956..f42a603 100644
--- a/res/layout/layout_wizard_tips.xml
+++ b/res/layout/layout_wizard_tips.xml
@@ -115,8 +115,8 @@
 		
 </TableRow>
 <TableRow android:background="#000000" android:layout_marginTop="10dip" android:paddingTop="10dip" android:id="@+id/TableRow02" android:textColor="#00ff00" android:layout_width="fill_parent" android:layout_height="30px">
-	   	<Button android:text="@string/btn_back" android:id="@+id/btnWizard1" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>
-    	<Button android:text="@string/btn_next" android:id="@+id/btnWizard2"  android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>	    
+	   <!-- 	<Button android:text="@string/btn_back" android:id="@+id/btnWizard1" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content"></Button> -->
+    	<Button android:text="@string/btn_okay" android:id="@+id/btnWizard2"  android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>	    
 </TableRow>			
 </TableLayout>
 </LinearLayout>
diff --git a/src/org/torproject/android/OrbotMainActivity.java b/src/org/torproject/android/OrbotMainActivity.java
index 406f15d..886c222 100644
--- a/src/org/torproject/android/OrbotMainActivity.java
+++ b/src/org/torproject/android/OrbotMainActivity.java
@@ -16,7 +16,7 @@ import org.torproject.android.settings.SettingsPreferences;
 import org.torproject.android.ui.ImageProgressView;
 import org.torproject.android.ui.Rotate3dAnimation;
 import org.torproject.android.ui.wizard.ChooseLocaleWizardActivity;
-import org.torproject.android.ui.wizard.TipsAndTricks;
+import org.torproject.android.ui.wizard.PromoAppsActivity;
 
 import android.annotation.TargetApi;
 import android.app.Activity;
@@ -393,7 +393,7 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon
                 }
                 else if (item.getItemId() == R.id.menu_wizard)
                 {
-                    startActivity(new Intent(OrbotMainActivity.this, ChooseLocaleWizardActivity.class));
+                    startActivity(new Intent(OrbotMainActivity.this, PromoAppsActivity.class));
 
                 }
                 else if (item.getItemId() == R.id.menu_exit)
@@ -629,6 +629,8 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon
 		
 			showWizard = mPrefs.getBoolean("show_wizard",showWizard);
 			
+			//let's not show the wizard now for new users
+			/**
 			if (showWizard)
 			{
 				Editor pEdit = mPrefs.edit();
@@ -638,7 +640,7 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon
 
 				startActivity(new Intent(this, ChooseLocaleWizardActivity.class));
 
-			}
+			}**/
 			
 		}
 		
@@ -716,7 +718,7 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon
 				public void onClick(DialogInterface dialog, int which) {
 
 					//prompt to install Orweb
-					Intent intent = new Intent(OrbotMainActivity.this,TipsAndTricks.class);
+					Intent intent = new Intent(OrbotMainActivity.this,PromoAppsActivity.class);
 					startActivity(intent);
 					
 				}
diff --git a/src/org/torproject/android/ui/wizard/ChooseLocaleWizardActivity.java b/src/org/torproject/android/ui/wizard/ChooseLocaleWizardActivity.java
index 3fdd746..2c5470c 100644
--- a/src/org/torproject/android/ui/wizard/ChooseLocaleWizardActivity.java
+++ b/src/org/torproject/android/ui/wizard/ChooseLocaleWizardActivity.java
@@ -60,7 +60,7 @@ public class ChooseLocaleWizardActivity extends Activity implements OrbotConstan
                 
                 setLocalePref(arg2);
                 finish();
-                startActivity(new Intent(ChooseLocaleWizardActivity.this, TipsAndTricks.class));
+                startActivity(new Intent(ChooseLocaleWizardActivity.this, PromoAppsActivity.class));
                 
             }
         });
@@ -70,7 +70,7 @@ public class ChooseLocaleWizardActivity extends Activity implements OrbotConstan
             public void onClick(View v) {
                 setLocalePref(0);
                 finish();
-                startActivity(new Intent(ChooseLocaleWizardActivity.this, TipsAndTricks.class));
+                startActivity(new Intent(ChooseLocaleWizardActivity.this, PromoAppsActivity.class));
 
             }
         });
diff --git a/src/org/torproject/android/ui/wizard/PromoAppsActivity.java b/src/org/torproject/android/ui/wizard/PromoAppsActivity.java
new file mode 100644
index 0000000..0a61d71
--- /dev/null
+++ b/src/org/torproject/android/ui/wizard/PromoAppsActivity.java
@@ -0,0 +1,214 @@
+package org.torproject.android.ui.wizard;
+
+import org.torproject.android.R;
+import org.torproject.android.OrbotConstants;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.TextView;
+
+public class PromoAppsActivity extends Activity implements OrbotConstants {
+
+    protected void onCreate(Bundle savedInstanceState)
+    {
+        super.onCreate(savedInstanceState);
+
+    }
+    
+    @Override
+    protected void onStart() {
+        
+        super.onStart();
+        setContentView(R.layout.layout_wizard_tips);
+        
+        stepFive();
+        
+    }
+    
+    @Override
+    protected void onResume() {
+        super.onResume();
+    
+        
+    }
+
+    void stepFive(){
+        
+        
+        String title = getString(R.string.wizard_tips_title);
+        
+        setTitle(title);
+            
+        Button btnLink = (Button)findViewById(R.id.WizardRootButtonInstallGibberbot);
+        
+        btnLink.setOnClickListener(new OnClickListener() {
+            
+            public void onClick(View view) {
+
+                String url = getString(R.string.gibberbot_apk_url);
+                finish();
+                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+
+            }
+        });
+        
+        btnLink = (Button)findViewById(R.id.WizardRootButtonInstallOrweb);
+
+        btnLink.setOnClickListener(new OnClickListener() {
+            
+            public void onClick(View view) {
+                
+                String url = getString(R.string.orweb_apk_url);
+                finish();
+                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+
+            }
+        });
+        
+        btnLink = (Button)findViewById(R.id.WizardRootButtonInstallDuckgo);
+
+        btnLink.setOnClickListener(new OnClickListener() {
+            
+            public void onClick(View view) {
+                
+                String url = getString(R.string.duckgo_apk_url);
+                finish();
+                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+
+            }
+        });
+        
+        btnLink = (Button)findViewById(R.id.WizardRootButtonInstallFirefox);
+
+        btnLink.setOnClickListener(new OnClickListener() {
+            
+            public void onClick(View view) {
+                
+                String url = getString(R.string.proxymob_setup_url);
+                finish();
+                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+
+            }
+        });
+        
+        btnLink = (Button)findViewById(R.id.WizardRootButtonInstallTwitter);
+
+        btnLink.setOnClickListener(new OnClickListener() {
+            
+            public void onClick(View view) {
+                
+                String url = getString(R.string.twitter_setup_url);
+                finish();
+                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+
+            }
+        });
+        
+        btnLink = (Button)findViewById(R.id.WizardRootButtonInstallStoryMaker);
+
+        btnLink.setOnClickListener(new OnClickListener() {
+            
+            public void onClick(View view) {
+                
+                String url = getString(R.string.story_maker_url);
+                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+
+            }
+        });
+        
+        btnLink = (Button)findViewById(R.id.WizardRootButtonInstallMartus);
+
+        btnLink.setOnClickListener(new OnClickListener() {
+            
+            public void onClick(View view) {
+                
+                String url = getString(R.string.martus_url);
+                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+
+            }
+        });
+        
+        
+        btnLink = (Button)findViewById(R.id.WizardRootButtonGooglePlay);
+
+        btnLink.setOnClickListener(new OnClickListener() {
+            
+            public void onClick(View view) {
+                
+                String url = getString(R.string.wizard_tips_play_url);
+                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+
+            }
+        });        
+        
+        
+      //  Button back = ((Button)findViewById(R.id.btnWizard1));
+        Button next = ((Button)findViewById(R.id.btnWizard2));
+        
+        /*
+        back.setOnClickListener(new View.OnClickListener() {
+			
+			public void onClick(View v) {
+				finish();
+				startActivityForResult(new Intent(PromoAppsActivity.this, ChooseLocaleWizardActivity.class), 1);
+			}
+		});*/
+    	
+    	next.setOnClickListener(new View.OnClickListener() {
+			
+			public void onClick(View v) {
+				//showWizardFinal();
+				
+				finish();
+			}
+		});
+        
+	}
+	
+	
+	
+	//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 false;
+	}
+	
+	/*
+	private void showWizardFinal ()
+	{
+		String title = null;
+		String msg = null;
+		
+		
+		title = context.getString(R.string.wizard_final);
+		msg = context.getString(R.string.wizard_final_msg);
+		
+		DialogInterface.OnClickListener ocListener = new DialogInterface.OnClickListener() {
+			
+			@Override
+			public void onClick(DialogInterface dialog, int which) {
+				context.startActivity(new Intent(context, Orbot.class));
+
+			}
+		};
+	
+		
+		 new AlertDialog.Builder(context)
+		.setIcon(R.drawable.icon)
+        .setTitle(title)
+        .setPositiveButton(R.string.button_close, ocListener)
+        .setMessage(msg)
+        .show();
+    }*/
+}
diff --git a/src/org/torproject/android/ui/wizard/TipsAndTricks.java b/src/org/torproject/android/ui/wizard/TipsAndTricks.java
deleted file mode 100644
index d47a4fb..0000000
--- a/src/org/torproject/android/ui/wizard/TipsAndTricks.java
+++ /dev/null
@@ -1,213 +0,0 @@
-package org.torproject.android.ui.wizard;
-
-import org.torproject.android.R;
-import org.torproject.android.OrbotConstants;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.Button;
-import android.widget.TextView;
-
-public class TipsAndTricks extends Activity implements OrbotConstants {
-
-    protected void onCreate(Bundle savedInstanceState)
-    {
-        super.onCreate(savedInstanceState);
-
-    }
-    
-    @Override
-    protected void onStart() {
-        
-        super.onStart();
-        setContentView(R.layout.layout_wizard_tips);
-        
-        stepFive();
-        
-    }
-    
-    @Override
-    protected void onResume() {
-        super.onResume();
-    
-        
-    }
-
-    void stepFive(){
-        
-        
-        String title = getString(R.string.wizard_tips_title);
-        
-        setTitle(title);
-            
-        Button btnLink = (Button)findViewById(R.id.WizardRootButtonInstallGibberbot);
-        
-        btnLink.setOnClickListener(new OnClickListener() {
-            
-            public void onClick(View view) {
-
-                String url = getString(R.string.gibberbot_apk_url);
-                finish();
-                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
-
-            }
-        });
-        
-        btnLink = (Button)findViewById(R.id.WizardRootButtonInstallOrweb);
-
-        btnLink.setOnClickListener(new OnClickListener() {
-            
-            public void onClick(View view) {
-                
-                String url = getString(R.string.orweb_apk_url);
-                finish();
-                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
-
-            }
-        });
-        
-        btnLink = (Button)findViewById(R.id.WizardRootButtonInstallDuckgo);
-
-        btnLink.setOnClickListener(new OnClickListener() {
-            
-            public void onClick(View view) {
-                
-                String url = getString(R.string.duckgo_apk_url);
-                finish();
-                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
-
-            }
-        });
-        
-        btnLink = (Button)findViewById(R.id.WizardRootButtonInstallFirefox);
-
-        btnLink.setOnClickListener(new OnClickListener() {
-            
-            public void onClick(View view) {
-                
-                String url = getString(R.string.proxymob_setup_url);
-                finish();
-                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
-
-            }
-        });
-        
-        btnLink = (Button)findViewById(R.id.WizardRootButtonInstallTwitter);
-
-        btnLink.setOnClickListener(new OnClickListener() {
-            
-            public void onClick(View view) {
-                
-                String url = getString(R.string.twitter_setup_url);
-                finish();
-                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
-
-            }
-        });
-        
-        btnLink = (Button)findViewById(R.id.WizardRootButtonInstallStoryMaker);
-
-        btnLink.setOnClickListener(new OnClickListener() {
-            
-            public void onClick(View view) {
-                
-                String url = getString(R.string.story_maker_url);
-                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
-
-            }
-        });
-        
-        btnLink = (Button)findViewById(R.id.WizardRootButtonInstallMartus);
-
-        btnLink.setOnClickListener(new OnClickListener() {
-            
-            public void onClick(View view) {
-                
-                String url = getString(R.string.martus_url);
-                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
-
-            }
-        });
-        
-        
-        btnLink = (Button)findViewById(R.id.WizardRootButtonGooglePlay);
-
-        btnLink.setOnClickListener(new OnClickListener() {
-            
-            public void onClick(View view) {
-                
-                String url = getString(R.string.wizard_tips_play_url);
-                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
-
-            }
-        });        
-        
-        
-        Button back = ((Button)findViewById(R.id.btnWizard1));
-        Button next = ((Button)findViewById(R.id.btnWizard2));
-        
-        back.setOnClickListener(new View.OnClickListener() {
-			
-			public void onClick(View v) {
-				finish();
-				startActivityForResult(new Intent(TipsAndTricks.this, ChooseLocaleWizardActivity.class), 1);
-			}
-		});
-    	
-    	next.setOnClickListener(new View.OnClickListener() {
-			
-			public void onClick(View v) {
-				//showWizardFinal();
-				
-				finish();
-			}
-		});
-        
-	}
-	
-	
-	
-	//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 false;
-	}
-	
-	/*
-	private void showWizardFinal ()
-	{
-		String title = null;
-		String msg = null;
-		
-		
-		title = context.getString(R.string.wizard_final);
-		msg = context.getString(R.string.wizard_final_msg);
-		
-		DialogInterface.OnClickListener ocListener = new DialogInterface.OnClickListener() {
-			
-			@Override
-			public void onClick(DialogInterface dialog, int which) {
-				context.startActivity(new Intent(context, Orbot.class));
-
-			}
-		};
-	
-		
-		 new AlertDialog.Builder(context)
-		.setIcon(R.drawable.icon)
-        .setTitle(title)
-        .setPositiveButton(R.string.button_close, ocListener)
-        .setMessage(msg)
-        .show();
-    }*/
-}





More information about the tor-commits mailing list