[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] Updated Permissions and Transproxy screens



commit 4f333e370d68a3606a0f39c5a610276d959ce00d
Author: Sathyanarayanan Gunasekaran <gsathya.ceg@xxxxxxxxx>
Date:   Fri Jun 10 00:31:35 2011 +0530

    Updated Permissions and Transproxy screens
    
    Included a checkbox in Permission screen to account for
    users who do not wish to grant root permissions.
    Updated radio buttons in Transproxy screen
---
 res/layout/layout_wizard_permissions.xml           |    1 +
 res/layout/layout_wizard_root.xml                  |   17 ++++++---
 res/values/strings.xml                             |    2 +-
 .../torproject/android/ConfigureTransProxy.java    |   24 ++++++++++++--
 src/org/torproject/android/Permissions.java        |   35 ++++++++++++++++++++
 5 files changed, 69 insertions(+), 10 deletions(-)

diff --git a/res/layout/layout_wizard_permissions.xml b/res/layout/layout_wizard_permissions.xml
index f7ecab8..168968b 100644
--- a/res/layout/layout_wizard_permissions.xml
+++ b/res/layout/layout_wizard_permissions.xml
@@ -39,6 +39,7 @@
 			<TextView android:layout_width="wrap_content" android:textColor="#ffffff" android:layout_height="wrap_content" android:background="#222222" android:textSize="8pt" android:padding="6px" android:id="@+id/WizardTextBody1" android:text="this is sample text this is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample text"></TextView>
 			<Button android:layout_width="wrap_content" android:visibility="gone" android:layout_height="wrap_content" android:gravity="center" android:text="Grant Permission" android:id="@+id/grantPermissions" android:layout_gravity="center"></Button>
 			<TextView android:layout_width="wrap_content" android:visibility="gone" android:textColor="#ffffff" android:layout_height="wrap_content" android:background="#222222" android:textSize="8pt" android:padding="6px" android:id="@+id/WizardTextBody2" android:text="this is sample text this is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample text"></TextView>
+			<CheckBox android:id="@+id/checkBox" android:visibility="gone" android:layout_gravity="center" android:text="@string/wizard_permissions_consent" android:layout_height="wrap_content" android:layout_width="wrap_content"></CheckBox>
 		</LinearLayout>
 
 		</ScrollView>
diff --git a/res/layout/layout_wizard_root.xml b/res/layout/layout_wizard_root.xml
index 62afa38..afe6005 100644
--- a/res/layout/layout_wizard_root.xml
+++ b/res/layout/layout_wizard_root.xml
@@ -41,12 +41,17 @@
 		    android:layout_height="fill_parent"
 		    android:padding="3px">
 <TextView android:text="@string/wizard_transproxy_msg" 	android:textColor="#ffffff" android:id="@+id/WizardRootTextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
-
-
-<CheckBox android:layout_marginTop="20px" android:text="@string/wizard_configure_all" android:id="@+id/WizardRootCheckBox01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"></CheckBox>
-<TextView android:text="@string/wizard_transproxy_hint" 	android:textColor="#ffffff"  android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingBottom="20dip"></TextView>
-
-<Button android:text="@string/wizard_configure_select_apps" android:id="@+id/WizardRootButton01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"/>
+<RadioGroup android:id="@+id/radioGroup" android:layout_height="wrap_content" android:layout_width="wrap_content">
+    <RadioButton android:checked="true" android:text="@string/wizard_configure_all" android:id="@+id/radio0" android:layout_height="wrap_content" android:layout_width="wrap_content"></RadioButton>
+	   <TextView android:layout_height="wrap_content" 
+        android:text="@string/wizard_transproxy_hint"
+        android:layout_width="wrap_content" 
+        android:textSize="15sp"
+        android:paddingBottom="10dip">
+    </TextView>   
+    <RadioButton android:text="@string/wizard_configure_select_apps" android:id="@+id/radio1" android:layout_height="wrap_content" android:layout_width="wrap_content"></RadioButton>
+    <RadioButton android:text="@string/wizard_transproxy_none" android:id="@+id/radio2" android:layout_height="wrap_content" android:layout_width="wrap_content"></RadioButton>
+</RadioGroup>
 
 
 			</LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index daf8f3c..af22a49 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -88,7 +88,6 @@
     <string name="wizard_permissions_msg_stock"> While it is not required, Orbot can become a more powerful tool if your device has root access. Use the button below to grant Orbot superpowers! </string>
    
     <string name="wizard_permissions_no_root">If you don\'t have root access or have no idea what we\'re talking about, just be sure to use apps made to work with Orbot.</string>
-    <string name="wizard_permissions_consent">I understand and would like to continue without root</string>
    
     <string name="wizard_permission_enable_root">Grant Root for Orbot</string>
     <string name="wizard_configure">Configure Torification</string>
@@ -137,6 +136,7 @@
 	<string name="wizard_permissions_root_msg1">Orbot has detected that you have root permissions enabled. To enable \'Transparent Proxying\', please grant superuser privileges to Orbot</string>
 	<string name="wizard_permissions_root_msg2">If you choose to continue without providing superuser privileges, make sure to use apps made to work with orbot</string>
 	<string name="wizard_permissions_msg">Orbot has detected that you do not have root permissions.\nTransparent Proxying is not possible without superuser privileges.\nMake sure to use apps that have been configured to work with Orbot</string>
+    <string name="wizard_permissions_consent">I understand and would like to continue without root</string>
 	<!-- TipsAndTricks screen -->
 	<string name="wizard_tips_title">Orbot configured Apps</string>
 	<string name="wizard_tips_gibberbot">Gibberbot - Secure instant messaging client for Android</string>
diff --git a/src/org/torproject/android/ConfigureTransProxy.java b/src/org/torproject/android/ConfigureTransProxy.java
index 3969dbb..3f0f31c 100644
--- a/src/org/torproject/android/ConfigureTransProxy.java
+++ b/src/org/torproject/android/ConfigureTransProxy.java
@@ -24,7 +24,8 @@ import android.widget.Toast;
 public class ConfigureTransProxy extends Activity implements TorConstants {
 
 	private Context context;
-	private int flag =0;
+	private int flag = 0;
+	
 	protected void onCreate(Bundle savedInstanceState)
 	{
         super.onCreate(savedInstanceState);
@@ -63,8 +64,15 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
 	        
 	        	@Override
 	        	public void onCheckedChanged(RadioGroup group, int checkedId){
-	        		
-	        		flag = 0;
+	        		Button next = ((Button)findViewById(R.id.btnWizard2));
+	        		next.setOnClickListener(new View.OnClickListener() {
+	    				
+	    				@Override
+	    				public void onClick(View v) {
+	    					
+	    						showWizardFinal();
+	    				}
+	    			});
 	        		
 	        		RadioButton rb0 = (RadioButton)findViewById(R.id.radio0);
 	        		RadioButton rb1 = (RadioButton)findViewById(R.id.radio1);
@@ -90,6 +98,16 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
 						pEdit1.putBoolean(PREF_TRANSPARENT_ALL, false);
 						pEdit1.commit();
 						
+						next.setOnClickListener(new View.OnClickListener() {
+		    				
+		    				@Override
+		    				public void onClick(View v) {
+		    					
+		    					context.startActivity(new Intent(context, AppManager.class));
+		    						
+		    					
+		    				}
+		    			});
 	        		}
 	        		
 	        		
diff --git a/src/org/torproject/android/Permissions.java b/src/org/torproject/android/Permissions.java
index a37d3c3..a29b04a 100644
--- a/src/org/torproject/android/Permissions.java
+++ b/src/org/torproject/android/Permissions.java
@@ -14,6 +14,9 @@ import android.preference.PreferenceManager;
 import android.util.Log;
 import android.view.View;
 import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -110,6 +113,38 @@ public class Permissions extends Activity implements TorConstants {
 		
         Button back = ((Button)findViewById(R.id.btnWizard1));
         Button next = ((Button)findViewById(R.id.btnWizard2));
+        next.setClickable(false);
+        
+        CheckBox consent = (CheckBox)findViewById(R.id.checkBox);
+        consent.setVisibility(CheckBox.VISIBLE);
+        
+        consent.setOnCheckedChangeListener(new OnCheckedChangeListener (){
+
+			@Override
+			public void onCheckedChanged(CompoundButton buttonView,
+					boolean isChecked) {
+			
+				
+				SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+
+				Editor pEdit = prefs.edit();
+				
+				pEdit.putBoolean(PREF_TRANSPARENT, isChecked);
+				pEdit.putBoolean(PREF_TRANSPARENT_ALL, isChecked);
+				
+				pEdit.commit();
+				
+				Button next = ((Button)findViewById(R.id.btnWizard2));
+				if(isChecked)
+					next.setClickable(true);
+				else
+					next.setClickable(false);
+				
+				
+			}
+        	
+        });
+        
         
         grantPermissions.setOnClickListener(new View.OnClickListener() {
 			



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits