Browse Source

Manual merge of Settings changes from @pejakm due to merge conflicts

master
Anthony Restaino 10 years ago
parent
commit
6a7b4bfe68
  1. 46
      AndroidManifest.xml
  2. 130
      res/layout/about_settings.xml
  3. 634
      res/layout/advanced_settings.xml
  4. 247
      res/layout/display_settings.xml
  5. 231
      res/layout/general_settings.xml
  6. 336
      res/layout/privacy_settings.xml
  7. 281
      res/layout/settings.xml
  8. 2
      res/values-ar/strings.xml
  9. 2
      res/values-de/strings.xml
  10. 2
      res/values-es/strings.xml
  11. 2
      res/values-pl/strings.xml
  12. 2
      res/values-ru/strings.xml
  13. 15
      res/values-sr/strings.xml
  14. 2
      res/values-tr/strings.xml
  15. 2
      res/values-zh-rCN/strings.xml
  16. 2
      res/values-zh-rTW/strings.xml
  17. 7
      res/values/strings.xml
  18. 126
      src/acr/browser/lightning/AboutSettingsActivity.java
  19. 678
      src/acr/browser/lightning/AdvancedSettingsActivity.java
  20. 261
      src/acr/browser/lightning/DisplaySettingsActivity.java
  21. 564
      src/acr/browser/lightning/GeneralSettingsActivity.java
  22. 419
      src/acr/browser/lightning/PrivacySettingsActivity.java
  23. 689
      src/acr/browser/lightning/SettingsActivity.java

46
AndroidManifest.xml

@ -114,10 +114,43 @@ @@ -114,10 +114,43 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="acr.browser.lightning.GeneralSettingsActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/settings_general"
android:theme="@style/DefaultTheme" >
<intent-filter>
<action android:name="android.intent.action.GENERAL_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="acr.browser.lightning.DisplaySettingsActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/settings_display"
android:theme="@style/DefaultTheme" >
<intent-filter>
<action android:name="android.intent.action.DISPLAY_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="acr.browser.lightning.PrivacySettingsActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/settings_privacy"
android:theme="@style/DefaultTheme" >
<intent-filter>
<action android:name="android.intent.action.PRIVACY_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="acr.browser.lightning.AdvancedSettingsActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/advanced"
android:label="@string/settings_advanced"
android:theme="@style/DefaultTheme" >
<intent-filter>
<action android:name="android.intent.action.ADVANCED_SETTINGS" />
@ -125,6 +158,17 @@ @@ -125,6 +158,17 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="acr.browser.lightning.AboutSettingsActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/settings_about"
android:theme="@style/DefaultTheme" >
<intent-filter>
<action android:name="android.intent.action.ABOUT_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="acr.browser.lightning.IncognitoActivity"
android:alwaysRetainTaskState="true"

130
res/layout/about_settings.xml

@ -0,0 +1,130 @@ @@ -0,0 +1,130 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/layoutSource"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/action_follow_me"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/isImportAvailable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/url_twitter"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutLicense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/licenses"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutVersion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/version"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/versionCode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
</LinearLayout>
</ScrollView>

634
res/layout/advanced_settings.xml

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/r1"
android:id="@+id/rAllowPopups"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
@ -27,344 +27,12 @@ @@ -27,344 +27,12 @@
android:orientation="vertical" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/password"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/recommended"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cb1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/r2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/cache"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cb2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rClearHistoryExit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/clear_history_exit"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cbClearHistoryExit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rClearCookiesExit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/clear_cookies_exit"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cbClearCookiesExit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/r3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/java"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/recommended"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cb3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/r4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/reflow"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cb4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/r5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/block"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cb5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/r6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/window"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/recommended"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cb6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/r7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView8"
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/cookies"
android:text="@string/window"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
@ -378,48 +46,7 @@ @@ -378,48 +46,7 @@
</LinearLayout>
<CheckBox
android:id="@+id/cb7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rIncognitoCookies"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/incognito_cookies"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<CheckBox
android:id="@+id/cbIncognitoCookies"
android:id="@+id/cbAllowPopups"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
@ -434,7 +61,7 @@ @@ -434,7 +61,7 @@
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/r11"
android:id="@+id/rAllowCookies"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
@ -451,12 +78,12 @@ @@ -451,12 +78,12 @@
android:orientation="vertical" >
<TextView
android:id="@+id/textView9"
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/wideViewPort"
android:text="@string/cookies"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
@ -470,7 +97,7 @@ @@ -470,7 +97,7 @@
</LinearLayout>
<CheckBox
android:id="@+id/cb8"
android:id="@+id/cbAllowCookies"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
@ -485,7 +112,7 @@ @@ -485,7 +112,7 @@
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/r12"
android:id="@+id/rAllowIncognitoCookies"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
@ -502,26 +129,16 @@ @@ -502,26 +129,16 @@
android:orientation="vertical" >
<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/overViewMode"
android:text="@string/incognito_cookies"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/recommended"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cb9"
android:id="@+id/cbAllowIncognitoCookies"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
@ -536,7 +153,7 @@ @@ -536,7 +153,7 @@
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/r13"
android:id="@+id/rRestoreTabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
@ -556,142 +173,7 @@ @@ -556,142 +173,7 @@
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cb10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/r14"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/fullScreenOption"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cb11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rGoogleSuggestions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/google_suggestions"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/powered_by_google"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cbGoogleSuggestions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rBrowserHistory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/sync_history"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/isBrowserAvailable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cbBrowserHistory"
android:id="@+id/cbRestoreTabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
@ -705,102 +187,40 @@ @@ -705,102 +187,40 @@
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rClearCache"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:text="@string/clear_cache"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rClearHistory"
android:id="@+id/layoutRendering"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:text="@string/history"
android:text="@string/rendering_mode"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/r15"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<TextView
android:id="@+id/renderText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:text="@string/clear_cookies"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/r10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:text="@string/size"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
</LinearLayout>
</ScrollView>

247
res/layout/display_settings.xml

@ -0,0 +1,247 @@ @@ -0,0 +1,247 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/rHideStatusBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/fullScreenOption"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cbHideStatusBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rFullScreen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/fullscreen"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cbFullScreen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rWideViewPort"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/wideViewPort"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/recommended"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cbWideViewPort"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rOverView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/overViewMode"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/recommended"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cbOverView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rTextReflow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/reflow"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cbTextReflow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rTextSize"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:text="@string/size"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
</LinearLayout>
</ScrollView>

231
res/layout/general_settings.xml

@ -0,0 +1,231 @@ @@ -0,0 +1,231 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/layoutUserAgent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/agent"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/agentText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutDownload"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/download"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/downloadText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutHomepage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/home"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/homepageText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/search"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/searchText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rGoogleSuggestions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/google_suggestions"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/powered_by_google"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cbGoogleSuggestions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
</LinearLayout>
</ScrollView>

336
res/layout/privacy_settings.xml

@ -0,0 +1,336 @@ @@ -0,0 +1,336 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/rLocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/location"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cbLocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rSavePasswords"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/password"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/recommended"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cbSavePasswords"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rClearCacheExit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/cache"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cbClearCacheExit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rClearHistoryExit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/clear_history_exit"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cbClearHistoryExit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rClearCookiesExit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/clear_cookies_exit"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cbClearCookiesExit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rBrowserHistory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:text="@string/sync_history"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/isBrowserAvailable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cbBrowserHistory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rClearCache"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:text="@string/clear_cache"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rClearHistory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:text="@string/history"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/rClearCookies"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:text="@string/clear_cookies"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
</LinearLayout>
</ScrollView>

281
res/layout/settings.xml

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/layoutLocation"
android:id="@+id/layoutFlash"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
@ -20,14 +20,14 @@ @@ -20,14 +20,14 @@
android:paddingTop="10dp" >
<TextView
android:id="@+id/textView2"
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="60dp"
android:text="@string/location"
android:text="@string/flash"
android:textAppearance="?android:attr/textAppearanceMedium" />
<RelativeLayout
@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutFullScreen"
android:id="@+id/layoutAdBlock"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
@ -57,14 +57,13 @@ @@ -57,14 +57,13 @@
android:paddingTop="10dp" >
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="60dp"
android:text="@string/fullscreen"
android:text="@string/block_ads"
android:textAppearance="?android:attr/textAppearanceMedium" />
<RelativeLayout
@ -84,7 +83,7 @@ @@ -84,7 +83,7 @@
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutFlash"
android:id="@+id/layoutImages"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
@ -94,14 +93,14 @@ @@ -94,14 +93,14 @@
android:paddingTop="10dp" >
<TextView
android:id="@+id/textView4"
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="60dp"
android:text="@string/flash"
android:text="@string/block"
android:textAppearance="?android:attr/textAppearanceMedium" />
<RelativeLayout
@ -121,7 +120,7 @@ @@ -121,7 +120,7 @@
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutAdBlock"
android:id="@+id/layoutEnableJS"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
@ -131,13 +130,14 @@ @@ -131,13 +130,14 @@
android:paddingTop="10dp" >
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="60dp"
android:text="@string/block_ads"
android:text="@string/java"
android:textAppearance="?android:attr/textAppearanceMedium" />
<RelativeLayout
@ -187,97 +187,13 @@ @@ -187,97 +187,13 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutUserAgent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/agent"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/agentText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutDownload"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/download"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/downloadText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_height="2dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutHomepage"
android:id="@+id/layoutGeneral"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
@ -285,107 +201,17 @@ @@ -285,107 +201,17 @@
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/home"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/homepageText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/search"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/searchText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<LinearLayout
android:id="@+id/layoutRendering"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
android:minHeight="60dp"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/rendering_mode"
android:text="@string/settings_general"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<TextView
android:id="@+id/renderText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
@ -420,7 +246,7 @@ @@ -420,7 +246,7 @@
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutAdvanced"
android:id="@+id/layoutDisplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
@ -435,7 +261,7 @@ @@ -435,7 +261,7 @@
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:text="@string/advanced"
android:text="@string/settings_display"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
@ -447,7 +273,7 @@ @@ -447,7 +273,7 @@
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutSource"
android:id="@+id/layoutPrivacy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
@ -455,30 +281,15 @@ @@ -455,30 +281,15 @@
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/action_follow_me"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/isImportAvailable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/url_twitter"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
android:paddingLeft="10dp"
android:text="@string/settings_privacy"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<LinearLayout
@ -489,7 +300,7 @@ @@ -489,7 +300,7 @@
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutLicense"
android:id="@+id/layoutAdvanced"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
@ -497,32 +308,26 @@ @@ -497,32 +308,26 @@
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<LinearLayout
<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/licenses"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
android:paddingLeft="10dp"
android:text="@string/settings_advanced"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_height="2dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<RelativeLayout
android:id="@+id/layoutVersion"
android:id="@+id/layoutAbout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/listChoiceBackgroundIndicator"
@ -538,29 +343,31 @@ @@ -538,29 +343,31 @@
android:orientation="vertical" >
<TextView
android:id="@+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="@string/version"
android:text="@string/settings_about"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/versionCode"
android:id="@+id/isImportAvailable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Small Text"
android:text="@string/settings_about_explain"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#cdcdcd" />
</LinearLayout>
</ScrollView>

2
res/values-ar/strings.xml

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
<string name="saveTab">استعادة علامات التبويب المفقودة</string>
<string name="settings_title">الإعدادات</string>
<string name="download">مسار التحميلات</string>
<string name="advanced">الإعدادات المتقدمة</string>
<string name="settings_advanced">الإعدادات المتقدمة</string>
<string name="source">رمز المصدر</string>
<string name="license">الرخصة</string>
<string name="github">github.com/anthonycr/Lightning-Browser</string>

2
res/values-de/strings.xml

@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
<string name="saveTab">Geschlossene Tab wiederherstellen</string>
<string name="settings_title">Einstellungen</string>
<string name="download">Download-Verzeichnis</string>
<string name="advanced">Erweiterte Einstellungen</string>
<string name="settings_advanced">Erweiterte Einstellungen</string>
<string name="source">Quelltext</string>
<string name="license">Lizenz</string>
<string name="github">github.com/anthonycr/Lightning-Browser</string>

2
res/values-es/strings.xml

@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
<string name="saveTab">Restaurar pestañas si se han cerrado</string>
<string name="settings_title">Ajustes</string>
<string name="download">Ruta de descargas</string>
<string name="advanced">Ajustes avanzados</string>
<string name="settings_advanced">Ajustes avanzados</string>
<string name="source">Código fuente</string>
<string name="license">Licencia</string>
<string name="github">github.com/anthonycr/Lightning-Browser</string>

2
res/values-pl/strings.xml

@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
<string name="saveTab">Przwraca otwarte karty</string>
<string name="settings_title">Ustawienia</string>
<string name="download">Miejsce zapisu pobieranych plików</string>
<string name="advanced">Ustawienia zaawansowane</string>
<string name="settings_advanced">Ustawienia zaawansowane</string>
<string name="source">Kod źródłowy</string>
<string name="license">Licencja</string>
<string name="github">github.com/anthonycr/Lightning-Browser</string>

2
res/values-ru/strings.xml

@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
<string name="saveTab">"Восстанавливать вкладки при сбое"</string>
<string name="settings_title">Настройки</string>
<string name="download">Папка загрузок</string>
<string name="advanced">Дополнительно</string>
<string name="settings_advanced">Дополнительно</string>
<string name="source">Исходный код</string>
<string name="license">Лицензия</string>
<string name="github">github.com/anthonycr/Lightning-Browser</string>

15
res/values-sr/strings.xml

@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
<string name="saveTab">Врати језичке ако су изгубљени</string>
<string name="settings_title">Поставке</string>
<string name="download">Фасцикла преузимања</string>
<string name="advanced">Напредне поставке</string>
<string name="settings_advanced">Напредне поставке</string>
<string name="source">Изворни кôд</string>
<string name="license">Лиценца</string>
<string name="github">github.com/anthonycr/Lightning-Browser</string>
@ -180,4 +180,17 @@ @@ -180,4 +180,17 @@
<string name="name_normal">Нормално</string>
<string name="sync_history">Синхронизуј историјат са Гуглом</string>
<string name="title_file_chooser">Бирач фајлова</string>
<string name="library_netcipher">NetCipher</string>
<string name="license_gnu">Гнуова Мања општа јавна лиценца</string>
<string name="export_bookmarks">Извези обележиваче у резерву</string>
<string name="import_backup">Увези обележиваче из резерве</string>
<string name="bookmark_export_path">Обележивачи извезени у</string>
<string name="bookmark_settings">Поставке обележивача</string>
<string name="import_bookmark_error">Не могу да увезем обележиваче из фајла</string>
<string name="title_chooser">Изаберите фајл</string>
<string name="settings_general">Опште поставке</string>
<string name="settings_display">Поставке приказа</string>
<string name="settings_privacy">Поставке приватности</string>
<string name="settings_about">О програму</string>
<string name="settings_about_explain">Детаљи о издању, аутору и лиценци.</string>
</resources>

2
res/values-tr/strings.xml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Lightning</string>

2
res/values-zh-rCN/strings.xml

@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
<string name="saveTab">恢复丢失标签</string>
<string name="settings_title">应用设置</string>
<string name="download">下载目录</string>
<string name="advanced">高级设置</string>
<string name="settings_advanced">高级设置</string>
<string name="source">源码</string>
<string name="license">许可</string>
<string name="github">github.com/anthonycr/Lightning-Browser</string>

2
res/values-zh-rTW/strings.xml

@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
<string name="saveTab">重新啟動時還原分頁</string>
<string name="settings_title">偏好設定</string>
<string name="download">下載資料夾位置</string>
<string name="advanced">進階設定</string>
<string name="settings_advanced">進階設定</string>
<string name="source">原始碼</string>
<string name="license">版權資訊</string>
<string name="github">github.com/anthonycr/Lightning-Browser</string>

7
res/values/strings.xml

@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
<string name="saveTab">Restore your tabs if they\'re lost</string>
<string name="settings_title">Settings</string>
<string name="download">Download Location</string>
<string name="advanced">Advanced Settings</string>
<string name="settings_advanced">Advanced Settings</string>
<string name="source">Source Code</string>
<string name="license">License</string>
<string name="github">github.com/anthonycr/Lightning-Browser</string>
@ -188,4 +188,9 @@ @@ -188,4 +188,9 @@
<string name="bookmark_settings">Bookmark Settings</string>
<string name="import_bookmark_error">Could not import bookmarks from file</string>
<string name="title_chooser">Choose a file</string>
<string name="settings_general">General Settings</string>
<string name="settings_display">Display Settings</string>
<string name="settings_privacy">Privacy Settings</string>
<string name="settings_about">About</string>
<string name="settings_about_explain">Details about version, author and license.</string>
</resources>

126
src/acr/browser/lightning/AboutSettingsActivity.java

@ -0,0 +1,126 @@ @@ -0,0 +1,126 @@
/*
* Copyright 2014 A.C.R. Development
*/
package acr.browser.lightning;
import android.app.ActionBar;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class AboutSettingsActivity extends Activity {
// mPreferences variables
private static final int API = android.os.Build.VERSION.SDK_INT;
private SharedPreferences mPreferences;
private int mEasterEggCounter;
private Context mContext;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about_settings);
ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
}
mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0);
if (mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
mContext = this;
initialize();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
finish();
return true;
}
private void initialize() {
String code = "HOLO";
try {
PackageInfo p = getPackageManager().getPackageInfo(getPackageName(), 0);
code = p.versionName;
} catch (NameNotFoundException e) {
// TODO add logging
e.printStackTrace();
}
TextView version = (TextView) findViewById(R.id.versionCode);
version.setText(code + "");
RelativeLayout licenses;
licenses = (RelativeLayout) findViewById(R.id.layoutLicense);
licenses.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// NOTE: In order to comply with the open source license,
// it is advised that you leave this code so that the License
// Activity may be viewed by the user.
startActivity(new Intent(mContext, LicenseActivity.class));
}
});
RelativeLayout source = (RelativeLayout) findViewById(R.id.layoutSource);
source(source);
easterEgg();
}
public void easterEgg() {
RelativeLayout easter = (RelativeLayout) findViewById(R.id.layoutVersion);
easter.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mEasterEggCounter++;
if (mEasterEggCounter == 10) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse("http://imgs.xkcd.com/comics/compiling.png"), mContext,
MainActivity.class));
finish();
mEasterEggCounter = 0;
}
}
});
}
public void source(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse("http://twitter.com/ACRDevelopment"), mContext, MainActivity.class));
finish();
}
});
}
}

678
src/acr/browser/lightning/AdvancedSettingsActivity.java

@ -10,17 +10,14 @@ import android.content.Context; @@ -10,17 +10,14 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.provider.Browser;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.webkit.*;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
@ -30,11 +27,10 @@ public class AdvancedSettingsActivity extends Activity { @@ -30,11 +27,10 @@ public class AdvancedSettingsActivity extends Activity {
private static final int API = android.os.Build.VERSION.SDK_INT;
private SharedPreferences mPreferences;
private SharedPreferences.Editor mEditPrefs;
private CheckBox cb1, cb2, cb3, cb4, cb5, cb6, cb7, cb8, cb9, cb10, cb11, cbIncognitoCookies,
cbSearchSuggestions, cbClearHistoryExit, cbClearCookiesExit;
private CheckBox cbAllowPopups, cbAllowCookies, cbAllowIncognitoCookies, cbRestoreTabs;
private Context mContext;
private boolean mSystemBrowser;
private Handler messageHandler;
private TextView mRenderText;
private Activity mActivity;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -57,8 +53,8 @@ public class AdvancedSettingsActivity extends Activity { @@ -57,8 +53,8 @@ public class AdvancedSettingsActivity extends Activity {
// commit() or apply() call
mEditPrefs = mPreferences.edit();
mSystemBrowser = mPreferences.getBoolean(PreferenceConstants.SYSTEM_BROWSER_PRESENT, false);
mContext = this;
mActivity = this;
initialize();
}
@ -70,250 +66,53 @@ public class AdvancedSettingsActivity extends Activity { @@ -70,250 +66,53 @@ public class AdvancedSettingsActivity extends Activity {
private void initialize() {
RelativeLayout r1, r2, r3, r4, r5, r6, r7, r8, r10, r11, r12, r13, r14, r15, rIncognitoCookies, rClearCache, rSearchSuggestions, rClearHistoryExit, rClearCookiesExit;
r1 = (RelativeLayout) findViewById(R.id.r1);
r2 = (RelativeLayout) findViewById(R.id.r2);
rClearHistoryExit = (RelativeLayout) findViewById(R.id.rClearHistoryExit);
rClearCookiesExit = (RelativeLayout) findViewById(R.id.rClearCookiesExit);
r3 = (RelativeLayout) findViewById(R.id.r3);
r4 = (RelativeLayout) findViewById(R.id.r4);
r5 = (RelativeLayout) findViewById(R.id.r5);
r6 = (RelativeLayout) findViewById(R.id.r6);
r7 = (RelativeLayout) findViewById(R.id.r7);
r8 = (RelativeLayout) findViewById(R.id.rClearHistory);
r10 = (RelativeLayout) findViewById(R.id.r10);
r11 = (RelativeLayout) findViewById(R.id.r11);
r12 = (RelativeLayout) findViewById(R.id.r12);
r13 = (RelativeLayout) findViewById(R.id.r13);
r14 = (RelativeLayout) findViewById(R.id.r14);
r15 = (RelativeLayout) findViewById(R.id.r15);
rIncognitoCookies = (RelativeLayout) findViewById(R.id.rIncognitoCookies);
rClearCache = (RelativeLayout) findViewById(R.id.rClearCache);
rSearchSuggestions = (RelativeLayout) findViewById(R.id.rGoogleSuggestions);
cb1 = (CheckBox) findViewById(R.id.cb1);
cb2 = (CheckBox) findViewById(R.id.cb2);
cbClearHistoryExit = (CheckBox) findViewById(R.id.cbClearHistoryExit);
cbClearCookiesExit = (CheckBox) findViewById(R.id.cbClearCookiesExit);
cb3 = (CheckBox) findViewById(R.id.cb3);
cb4 = (CheckBox) findViewById(R.id.cb4);
cb5 = (CheckBox) findViewById(R.id.cb5);
cb6 = (CheckBox) findViewById(R.id.cb6);
cb7 = (CheckBox) findViewById(R.id.cb7);
cb8 = (CheckBox) findViewById(R.id.cb8);
cb9 = (CheckBox) findViewById(R.id.cb9);
cb10 = (CheckBox) findViewById(R.id.cb10);
cb11 = (CheckBox) findViewById(R.id.cb11);
cbIncognitoCookies = (CheckBox) findViewById(R.id.cbIncognitoCookies);
cbSearchSuggestions = (CheckBox) findViewById(R.id.cbGoogleSuggestions);
cb1.setChecked(mPreferences.getBoolean(PreferenceConstants.SAVE_PASSWORDS, true));
cb2.setChecked(mPreferences.getBoolean(PreferenceConstants.CLEAR_CACHE_EXIT, false));
cbClearHistoryExit.setChecked(mPreferences.getBoolean(
PreferenceConstants.CLEAR_HISTORY_EXIT, false));
cbClearCookiesExit.setChecked(mPreferences.getBoolean(
PreferenceConstants.CLEAR_COOKIES_EXIT, false));
cb3.setChecked(mPreferences.getBoolean(PreferenceConstants.JAVASCRIPT, true));
cb4.setChecked(mPreferences.getBoolean(PreferenceConstants.TEXT_REFLOW, false));
cb4.setEnabled(API < 19);
if (API >= 19) {
mEditPrefs.putBoolean(PreferenceConstants.TEXT_REFLOW, false);
mEditPrefs.commit();
}
cb5.setChecked(mPreferences.getBoolean(PreferenceConstants.BLOCK_IMAGES, false));
cb6.setChecked(mPreferences.getBoolean(PreferenceConstants.POPUPS, true));
cb7.setChecked(mPreferences.getBoolean(PreferenceConstants.COOKIES, true));
cb8.setChecked(mPreferences.getBoolean(PreferenceConstants.USE_WIDE_VIEWPORT, true));
cb9.setChecked(mPreferences.getBoolean(PreferenceConstants.OVERVIEW_MODE, true));
cb10.setChecked(mPreferences.getBoolean(PreferenceConstants.RESTORE_LOST_TABS, true));
cb11.setChecked(mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false));
cbIncognitoCookies.setChecked(mPreferences.getBoolean(
PreferenceConstants.INCOGNITO_COOKIES, false));
cbSearchSuggestions.setChecked(mPreferences.getBoolean(
PreferenceConstants.GOOGLE_SEARCH_SUGGESTIONS, true));
r1(r1);
r2(r2);
rClearHistoryExit(rClearHistoryExit);
rClearCookiesExit(rClearCookiesExit);
r3(r3);
r4(r4);
r5(r5);
r6(r6);
r7(r7);
r8(r8);
r10(r10);
r11(r11);
r12(r12);
r13(r13);
r14(r14);
r15(r15);
rIncognitoCookies(rIncognitoCookies);
rClearCache(rClearCache);
rSearchSuggestions(rSearchSuggestions);
cb1(cb1);
cb2(cb2);
cbClearHistoryExit(cbClearHistoryExit);
cbClearCookiesExit(cbClearCookiesExit);
cb3(cb3);
cb4(cb4);
cb5(cb5);
cb6(cb6);
cb7(cb7);
cb8(cb8);
cb9(cb9);
cb10(cb10);
cb11(cb11);
cbIncognitoCookies(cbIncognitoCookies);
cbSearchSuggestions(cbSearchSuggestions);
TextView syncHistory = (TextView) findViewById(R.id.isBrowserAvailable);
RelativeLayout layoutSyncHistory = (RelativeLayout) findViewById(R.id.rBrowserHistory);
final CheckBox cbSyncHistory = (CheckBox) findViewById(R.id.cbBrowserHistory);
layoutSyncHistory.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
cbSyncHistory.setChecked(!cbSyncHistory.isChecked());
}
});
cbSyncHistory.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.SYNC_HISTORY, isChecked).apply();
}
});
if (!mSystemBrowser) {
cbSyncHistory.setChecked(false);
cbSyncHistory.setEnabled(false);
syncHistory.setText(getResources().getString(R.string.stock_browser_unavailable));
} else {
cbSyncHistory.setEnabled(true);
cbSyncHistory.setChecked(mPreferences
.getBoolean(PreferenceConstants.SYNC_HISTORY, true));
syncHistory.setText(getResources().getString(R.string.stock_browser_available));
}
messageHandler = new MessageHandler(mContext);
}
private static class MessageHandler extends Handler {
RelativeLayout rAllowPopups, rAllowCookies, rAllowIncognitoCookies, rRestoreTabs;
Context mHandlerContext;
rAllowPopups = (RelativeLayout) findViewById(R.id.rAllowPopups);
rAllowCookies = (RelativeLayout) findViewById(R.id.rAllowCookies);
rAllowIncognitoCookies = (RelativeLayout) findViewById(R.id.rAllowIncognitoCookies);
rRestoreTabs = (RelativeLayout) findViewById(R.id.rRestoreTabs);
public MessageHandler(Context context) {
this.mHandlerContext = context;
}
cbAllowPopups = (CheckBox) findViewById(R.id.cbAllowPopups);
cbAllowCookies = (CheckBox) findViewById(R.id.cbAllowCookies);
cbAllowIncognitoCookies = (CheckBox) findViewById(R.id.cbAllowIncognitoCookies);
cbRestoreTabs = (CheckBox) findViewById(R.id.cbRestoreTabs);
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case 1:
Utils.showToast(mHandlerContext,
mHandlerContext.getResources()
.getString(R.string.message_clear_history));
break;
case 2:
Utils.showToast(
mHandlerContext,
mHandlerContext.getResources().getString(
R.string.message_cookies_cleared));
break;
}
super.handleMessage(msg);
cbAllowPopups.setChecked(mPreferences.getBoolean(PreferenceConstants.POPUPS, true));
cbAllowCookies.setChecked(mPreferences.getBoolean(PreferenceConstants.COOKIES, true));
cbAllowIncognitoCookies.setChecked(mPreferences.getBoolean(
PreferenceConstants.INCOGNITO_COOKIES, false));
cbRestoreTabs.setChecked(mPreferences.getBoolean(PreferenceConstants.RESTORE_LOST_TABS, true));
mRenderText = (TextView) findViewById(R.id.renderText);
switch (mPreferences.getInt(PreferenceConstants.RENDERING_MODE, 0)) {
case 0:
mRenderText.setText(mContext.getString(R.string.name_normal));
break;
case 1:
mRenderText.setText(mContext.getString(R.string.name_inverted));
break;
case 2:
mRenderText.setText(mContext.getString(R.string.name_grayscale));
break;
case 3:
mRenderText.setText(mContext.getString(R.string.name_inverted_grayscale));
break;
}
}
private void cb1(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.SAVE_PASSWORDS, isChecked);
mEditPrefs.commit();
}
});
}
private void cb2(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.CLEAR_CACHE_EXIT, isChecked);
mEditPrefs.commit();
}
});
}
private void cbClearHistoryExit(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.CLEAR_HISTORY_EXIT, isChecked);
mEditPrefs.commit();
}
});
}
private void cbClearCookiesExit(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.CLEAR_COOKIES_EXIT, isChecked);
mEditPrefs.commit();
}
});
rAllowPopups(rAllowPopups);
rAllowCookies(rAllowCookies);
rAllowIncognitoCookies(rAllowIncognitoCookies);
rRestoreTabs(rRestoreTabs);
cbAllowPopups(cbAllowPopups);
cbAllowCookies(cbAllowCookies);
cbAllowIncognitoCookies(cbAllowIncognitoCookies);
cbRestoreTabs(cbRestoreTabs);
renderPicker();
}
private void cb3(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.JAVASCRIPT, isChecked);
mEditPrefs.commit();
}
});
}
private void cb4(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.TEXT_REFLOW, isChecked);
mEditPrefs.commit();
}
});
}
private void cb5(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.BLOCK_IMAGES, isChecked);
mEditPrefs.commit();
}
});
}
private void cb6(CheckBox view) {
private void cbAllowPopups(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
@ -325,7 +124,7 @@ public class AdvancedSettingsActivity extends Activity { @@ -325,7 +124,7 @@ public class AdvancedSettingsActivity extends Activity {
});
}
private void cb7(CheckBox view) {
private void cbAllowCookies(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
@ -337,55 +136,7 @@ public class AdvancedSettingsActivity extends Activity { @@ -337,55 +136,7 @@ public class AdvancedSettingsActivity extends Activity {
});
}
private void cb8(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.USE_WIDE_VIEWPORT, isChecked);
mEditPrefs.commit();
}
});
}
private void cb9(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.OVERVIEW_MODE, isChecked);
mEditPrefs.commit();
}
});
}
private void cb10(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.RESTORE_LOST_TABS, isChecked);
mEditPrefs.commit();
}
});
}
private void cb11(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.HIDE_STATUS_BAR, isChecked);
mEditPrefs.commit();
}
});
}
private void cbIncognitoCookies(CheckBox view) {
private void cbAllowIncognitoCookies(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
@ -397,350 +148,103 @@ public class AdvancedSettingsActivity extends Activity { @@ -397,350 +148,103 @@ public class AdvancedSettingsActivity extends Activity {
});
}
private void cbSearchSuggestions(CheckBox view) {
private void cbRestoreTabs(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.GOOGLE_SEARCH_SUGGESTIONS, isChecked);
mEditPrefs.putBoolean(PreferenceConstants.RESTORE_LOST_TABS, isChecked);
mEditPrefs.commit();
}
});
}
private void r1(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cb1.setChecked(!cb1.isChecked());
}
});
}
private void r2(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cb2.setChecked(!cb2.isChecked());
}
});
}
private void rClearHistoryExit(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cbClearHistoryExit.setChecked(!cbClearHistoryExit.isChecked());
}
});
}
private void rClearCookiesExit(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cbClearCookiesExit.setChecked(!cbClearCookiesExit.isChecked());
}
});
}
private void r3(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cb3.setChecked(!cb3.isChecked());
}
});
}
private void r4(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (API < 19) {
cb4.setChecked(!cb4.isChecked());
} else {
Utils.createInformativeDialog(mContext,
getResources().getString(R.string.title_warning), getResources()
.getString(R.string.dialog_reflow_warning));
}
}
});
}
private void r5(RelativeLayout view) {
private void rAllowPopups(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cb5.setChecked(!cb5.isChecked());
cbAllowPopups.setChecked(!cbAllowPopups.isChecked());
}
});
}
private void r6(RelativeLayout view) {
private void rAllowCookies(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cb6.setChecked(!cb6.isChecked());
}
});
}
private void r7(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cb7.setChecked(!cb7.isChecked());
}
});
}
private void r8(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(AdvancedSettingsActivity.this); // dialog
builder.setTitle(getResources().getString(R.string.title_clear_history));
builder.setMessage(getResources().getString(R.string.dialog_history))
.setPositiveButton(getResources().getString(R.string.action_yes),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
Thread clear = new Thread(new Runnable() {
@Override
public void run() {
clearHistory();
}
});
clear.start();
}
})
.setNegativeButton(getResources().getString(R.string.action_no),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
// TODO Auto-generated method stub
}
}).show();
cbAllowCookies.setChecked(!cbAllowCookies.isChecked());
}
});
}
private void r11(RelativeLayout view) {
private void rAllowIncognitoCookies(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cb8.setChecked(!cb8.isChecked());
cbAllowIncognitoCookies.setChecked(!cbAllowIncognitoCookies.isChecked());
}
});
}
private void r12(RelativeLayout view) {
private void rRestoreTabs(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cb9.setChecked(!cb9.isChecked());
cbRestoreTabs.setChecked(!cbRestoreTabs.isChecked());
}
});
}
private void r13(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
public void renderPicker() {
LinearLayout layout = (LinearLayout) findViewById(R.id.layoutRendering);
layout.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
cb10.setChecked(!cb10.isChecked());
}
});
}
private void r14(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
cb11.setChecked(!cb11.isChecked());
}
});
}
private void r15(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(AdvancedSettingsActivity.this); // dialog
builder.setTitle(getResources().getString(R.string.title_clear_cookies));
builder.setMessage(getResources().getString(R.string.dialog_cookies))
.setPositiveButton(getResources().getString(R.string.action_yes),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
Thread clear = new Thread(new Runnable() {
@Override
public void run() {
clearCookies();
}
});
clear.start();
}
})
.setNegativeButton(getResources().getString(R.string.action_no),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
}
}).show();
}
});
}
private void rIncognitoCookies(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cbIncognitoCookies.setChecked(!cbIncognitoCookies.isChecked());
}
});
}
private void rSearchSuggestions(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
cbSearchSuggestions.setChecked(!cbSearchSuggestions.isChecked());
}
});
}
private void rClearCache(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
clearCache();
}
});
}
public void clearCache() {
WebView webView = new WebView(this);
webView.clearCache(true);
webView.destroy();
Utils.showToast(mContext, getResources().getString(R.string.message_cache_cleared));
}
@SuppressWarnings("deprecation")
public void clearHistory() {
deleteDatabase(HistoryDatabaseHandler.DATABASE_NAME);
WebViewDatabase m = WebViewDatabase.getInstance(this);
m.clearFormData();
m.clearHttpAuthUsernamePassword();
if (API < 18) {
m.clearUsernamePassword();
WebIconDatabase.getInstance().removeAllIcons();
}
if (mSystemBrowser) {
try {
Browser.clearHistory(getContentResolver());
} catch (Exception ignored) {
}
}
SettingsController.setClearHistory(true);
Utils.trimCache(this);
messageHandler.sendEmptyMessage(1);
}
public void clearCookies() {
CookieManager c = CookieManager.getInstance();
CookieSyncManager.createInstance(this);
c.removeAllCookie();
messageHandler.sendEmptyMessage(2);
}
private void r10(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder picker = new AlertDialog.Builder(AdvancedSettingsActivity.this);
picker.setTitle(getResources().getString(R.string.title_text_size));
int n = mPreferences.getInt(PreferenceConstants.TEXT_SIZE, 3);
picker.setSingleChoiceItems(R.array.text_size, n - 1,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mEditPrefs.putInt(PreferenceConstants.TEXT_SIZE, which + 1);
mEditPrefs.commit();
}
});
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
picker.setTitle(getResources().getString(R.string.rendering_mode));
CharSequence[] chars = { mContext.getString(R.string.name_normal),
mContext.getString(R.string.name_inverted),
mContext.getString(R.string.name_grayscale),
mContext.getString(R.string.name_inverted_grayscale) };
int n = mPreferences.getInt(PreferenceConstants.RENDERING_MODE, 0);
picker.setSingleChoiceItems(chars, n, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mEditPrefs.putInt(PreferenceConstants.RENDERING_MODE, which).apply();
switch (which) {
case 0:
mRenderText.setText(mContext.getString(R.string.name_normal));
break;
case 1:
mRenderText.setText(mContext.getString(R.string.name_inverted));
break;
case 2:
mRenderText.setText(mContext.getString(R.string.name_grayscale));
break;
case 3:
mRenderText.setText(mContext
.getString(R.string.name_inverted_grayscale));
break;
}
}
});
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {

261
src/acr/browser/lightning/DisplaySettingsActivity.java

@ -0,0 +1,261 @@ @@ -0,0 +1,261 @@
/*
* Copyright 2014 A.C.R. Development
*/
package acr.browser.lightning;
import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.RelativeLayout;
public class DisplaySettingsActivity extends Activity {
// mPreferences variables
private static final int API = android.os.Build.VERSION.SDK_INT;
private SharedPreferences mPreferences;
private SharedPreferences.Editor mEditPrefs;
private CheckBox cbHideStatusBar, cbFullScreen, cbWideViewPort, cbOverView, cbTextReflow;
private Context mContext;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.display_settings);
ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
}
mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0);
if (mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
// TODO WARNING: SharedPreferences.edit() without a corresponding
// commit() or apply() call
mEditPrefs = mPreferences.edit();
mContext = this;
initialize();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
finish();
return true;
}
private void initialize() {
RelativeLayout rHideStatusBar, rFullScreen, rWideViewPort, rOverView, rTextReflow, rTextSize;
rHideStatusBar = (RelativeLayout) findViewById(R.id.rHideStatusBar);
rFullScreen = (RelativeLayout) findViewById(R.id.rFullScreen);
rWideViewPort = (RelativeLayout) findViewById(R.id.rWideViewPort);
rOverView = (RelativeLayout) findViewById(R.id.rOverView);
rTextReflow = (RelativeLayout) findViewById(R.id.rTextReflow);
rTextSize = (RelativeLayout) findViewById(R.id.rTextSize);
cbHideStatusBar = (CheckBox) findViewById(R.id.cbHideStatusBar);
cbFullScreen = (CheckBox) findViewById(R.id.cbFullScreen);
cbWideViewPort = (CheckBox) findViewById(R.id.cbWideViewPort);
cbOverView = (CheckBox) findViewById(R.id.cbOverView);
cbTextReflow = (CheckBox) findViewById(R.id.cbTextReflow);
cbHideStatusBar.setChecked(mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false));
cbFullScreen.setChecked(mPreferences.getBoolean(PreferenceConstants.FULL_SCREEN, false));
cbWideViewPort.setChecked(mPreferences.getBoolean(PreferenceConstants.USE_WIDE_VIEWPORT, true));
cbOverView.setChecked(mPreferences.getBoolean(PreferenceConstants.OVERVIEW_MODE, true));
cbTextReflow.setChecked(mPreferences.getBoolean(PreferenceConstants.TEXT_REFLOW, false));
cbTextReflow.setEnabled(API < 19);
if (API >= 19) {
mEditPrefs.putBoolean(PreferenceConstants.TEXT_REFLOW, false);
mEditPrefs.commit();
}
rHideStatusBar(rHideStatusBar);
rFullScreen(rFullScreen);
rWideViewPort(rWideViewPort);
rOverView(rOverView);
rTextReflow(rTextReflow);
rTextSize(rTextSize);
cbHideStatusBar(cbHideStatusBar);
cbFullScreen(cbFullScreen);
cbWideViewPort(cbWideViewPort);
cbOverView(cbOverView);
cbTextReflow(cbTextReflow);
}
private void cbHideStatusBar(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.HIDE_STATUS_BAR, isChecked);
mEditPrefs.commit();
}
});
}
private void cbFullScreen(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.FULL_SCREEN, isChecked);
mEditPrefs.commit();
}
});
}
private void cbWideViewPort(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.USE_WIDE_VIEWPORT, isChecked);
mEditPrefs.commit();
}
});
}
private void cbOverView(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.OVERVIEW_MODE, isChecked);
mEditPrefs.commit();
}
});
}
private void cbTextReflow(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.TEXT_REFLOW, isChecked);
mEditPrefs.commit();
}
});
}
private void rHideStatusBar(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
cbHideStatusBar.setChecked(!cbHideStatusBar.isChecked());
}
});
}
private void rFullScreen(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
cbFullScreen.setChecked(!cbFullScreen.isChecked());
}
});
}
private void rWideViewPort(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cbWideViewPort.setChecked(!cbWideViewPort.isChecked());
}
});
}
private void rOverView(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cbOverView.setChecked(!cbOverView.isChecked());
}
});
}
private void rTextReflow(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (API < 19) {
cbTextReflow.setChecked(!cbTextReflow.isChecked());
} else {
Utils.createInformativeDialog(mContext,
getResources().getString(R.string.title_warning), getResources()
.getString(R.string.dialog_reflow_warning));
}
}
});
}
private void rTextSize(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder picker = new AlertDialog.Builder(DisplaySettingsActivity.this);
picker.setTitle(getResources().getString(R.string.title_text_size));
int n = mPreferences.getInt(PreferenceConstants.TEXT_SIZE, 3);
picker.setSingleChoiceItems(R.array.text_size, n - 1,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mEditPrefs.putInt(PreferenceConstants.TEXT_SIZE, which + 1);
mEditPrefs.commit();
}
});
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
picker.show();
}
});
}
}

564
src/acr/browser/lightning/GeneralSettingsActivity.java

@ -0,0 +1,564 @@ @@ -0,0 +1,564 @@
/*
* Copyright 2014 A.C.R. Development
*/
package acr.browser.lightning;
import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.util.TypedValue;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class GeneralSettingsActivity extends Activity {
// mPreferences variables
private static final int API = android.os.Build.VERSION.SDK_INT;
private SharedPreferences mPreferences;
private SharedPreferences.Editor mEditPrefs;
private int mAgentChoice;
private String mHomepage;
private TextView mAgentTextView;
private TextView mDownloadTextView;
private String mDownloadLocation;
private TextView mHomepageText;
private TextView mSearchText;
private CheckBox cbSearchSuggestions;
private Activity mActivity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.general_settings);
ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
}
mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0);
if (mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
// TODO WARNING: SharedPreferences.edit() without a corresponding
// commit() or apply() call
mEditPrefs = mPreferences.edit();
mActivity = this;
initialize();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
finish();
return true;
}
private void initialize() {
mSearchText = (TextView) findViewById(R.id.searchText);
switch (mPreferences.getInt(PreferenceConstants.SEARCH, 1)) {
case 0:
mSearchText.setText(getResources().getString(R.string.custom_url));
break;
case 1:
mSearchText.setText("Google");
break;
case 2:
mSearchText.setText("Android Search");
break;
case 3:
mSearchText.setText("Bing");
break;
case 4:
mSearchText.setText("Yahoo");
break;
case 5:
mSearchText.setText("StartPage");
break;
case 6:
mSearchText.setText("StartPage (Mobile)");
break;
case 7:
mSearchText.setText("DuckDuckGo");
break;
case 8:
mSearchText.setText("DuckDuckGo Lite");
break;
case 9:
mSearchText.setText("Baidu");
break;
case 10:
mSearchText.setText("Yandex");
}
mAgentTextView = (TextView) findViewById(R.id.agentText);
mHomepageText = (TextView) findViewById(R.id.homepageText);
mDownloadTextView = (TextView) findViewById(R.id.downloadText);
mAgentChoice = mPreferences.getInt(PreferenceConstants.USER_AGENT, 1);
mHomepage = mPreferences.getString(PreferenceConstants.HOMEPAGE, Constants.HOMEPAGE);
mDownloadLocation = mPreferences.getString(PreferenceConstants.DOWNLOAD_DIRECTORY,
Environment.DIRECTORY_DOWNLOADS);
mDownloadTextView.setText(Constants.EXTERNAL_STORAGE + '/' + mDownloadLocation);
if (mHomepage.contains("about:home")) {
mHomepageText.setText(getResources().getString(R.string.action_homepage));
} else if (mHomepage.contains("about:blank")) {
mHomepageText.setText(getResources().getString(R.string.action_blank));
} else if (mHomepage.contains("about:bookmarks")) {
mHomepageText.setText(getResources().getString(R.string.action_bookmarks));
} else {
mHomepageText.setText(mHomepage);
}
switch (mAgentChoice) {
case 1:
mAgentTextView.setText(getResources().getString(R.string.agent_default));
break;
case 2:
mAgentTextView.setText(getResources().getString(R.string.agent_desktop));
break;
case 3:
mAgentTextView.setText(getResources().getString(R.string.agent_mobile));
break;
case 4:
mAgentTextView.setText(getResources().getString(R.string.agent_custom));
}
RelativeLayout rSearchSuggestions;
rSearchSuggestions = (RelativeLayout) findViewById(R.id.rGoogleSuggestions);
cbSearchSuggestions = (CheckBox) findViewById(R.id.cbGoogleSuggestions);
cbSearchSuggestions.setChecked(mPreferences.getBoolean(
PreferenceConstants.GOOGLE_SEARCH_SUGGESTIONS, true));
RelativeLayout agent = (RelativeLayout) findViewById(R.id.layoutUserAgent);
RelativeLayout download = (RelativeLayout) findViewById(R.id.layoutDownload);
RelativeLayout homepage = (RelativeLayout) findViewById(R.id.layoutHomepage);
agent(agent);
download(download);
homepage(homepage);
search();
rSearchSuggestions(rSearchSuggestions);
cbSearchSuggestions(cbSearchSuggestions);
}
public void search() {
RelativeLayout search = (RelativeLayout) findViewById(R.id.layoutSearch);
search.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
picker.setTitle(getResources().getString(R.string.title_search_engine));
CharSequence[] chars = { getResources().getString(R.string.custom_url), "Google",
"Android Search", "Bing", "Yahoo", "StartPage", "StartPage (Mobile)",
"DuckDuckGo (Privacy)", "DuckDuckGo Lite (Privacy)", "Baidu (Chinese)",
"Yandex (Russian)" };
int n = mPreferences.getInt(PreferenceConstants.SEARCH, 1);
picker.setSingleChoiceItems(chars, n, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mEditPrefs.putInt(PreferenceConstants.SEARCH, which);
mEditPrefs.commit();
switch (which) {
case 0:
searchUrlPicker();
break;
case 1:
mSearchText.setText("Google");
break;
case 2:
mSearchText.setText("Android Search");
break;
case 3:
mSearchText.setText("Bing");
break;
case 4:
mSearchText.setText("Yahoo");
break;
case 5:
mSearchText.setText("StartPage");
break;
case 6:
mSearchText.setText("StartPage (Mobile)");
break;
case 7:
mSearchText.setText("DuckDuckGo");
break;
case 8:
mSearchText.setText("DuckDuckGo Lite");
break;
case 9:
mSearchText.setText("Baidu");
break;
case 10:
mSearchText.setText("Yandex");
}
}
});
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
picker.show();
}
});
}
public void searchUrlPicker() {
final AlertDialog.Builder urlPicker = new AlertDialog.Builder(this);
urlPicker.setTitle(getResources().getString(R.string.custom_url));
final EditText getSearchUrl = new EditText(this);
String mSearchUrl = mPreferences.getString(PreferenceConstants.SEARCH_URL,
Constants.GOOGLE_SEARCH);
getSearchUrl.setText(mSearchUrl);
urlPicker.setView(getSearchUrl);
urlPicker.setPositiveButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String text = getSearchUrl.getText().toString();
mEditPrefs.putString(PreferenceConstants.SEARCH_URL, text);
mEditPrefs.commit();
mSearchText.setText(getResources().getString(R.string.custom_url) + ": "
+ text);
}
});
urlPicker.show();
}
public void agent(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder agentPicker = new AlertDialog.Builder(mActivity);
agentPicker.setTitle(getResources().getString(R.string.title_user_agent));
mAgentChoice = mPreferences.getInt(PreferenceConstants.USER_AGENT, 1);
agentPicker.setSingleChoiceItems(R.array.user_agent, mAgentChoice - 1,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mEditPrefs.putInt(PreferenceConstants.USER_AGENT, which + 1);
mEditPrefs.commit();
switch (which + 1) {
case 1:
mAgentTextView.setText(getResources().getString(
R.string.agent_default));
break;
case 2:
mAgentTextView.setText(getResources().getString(
R.string.agent_desktop));
break;
case 3:
mAgentTextView.setText(getResources().getString(
R.string.agent_mobile));
break;
case 4:
mAgentTextView.setText(getResources().getString(
R.string.agent_custom));
agentPicker();
break;
}
}
});
agentPicker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
agentPicker.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
// TODO Auto-generated method stub
Log.i("Cancelled", "");
}
});
agentPicker.show();
}
});
}
public void agentPicker() {
final AlertDialog.Builder agentStringPicker = new AlertDialog.Builder(mActivity);
agentStringPicker.setTitle(getResources().getString(R.string.title_user_agent));
final EditText getAgent = new EditText(this);
agentStringPicker.setView(getAgent);
agentStringPicker.setPositiveButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String text = getAgent.getText().toString();
mEditPrefs.putString(PreferenceConstants.USER_AGENT_STRING, text);
mEditPrefs.commit();
mAgentTextView.setText(getResources().getString(R.string.agent_custom));
}
});
agentStringPicker.show();
}
public void download(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
picker.setTitle(getResources().getString(R.string.title_download_location));
mDownloadLocation = mPreferences.getString(PreferenceConstants.DOWNLOAD_DIRECTORY,
Environment.DIRECTORY_DOWNLOADS);
int n;
if (mDownloadLocation.contains(Environment.DIRECTORY_DOWNLOADS)) {
n = 1;
} else {
n = 2;
}
picker.setSingleChoiceItems(R.array.download_folder, n - 1,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which + 1) {
case 1:
mEditPrefs.putString(
PreferenceConstants.DOWNLOAD_DIRECTORY,
Environment.DIRECTORY_DOWNLOADS);
mEditPrefs.commit();
mDownloadTextView.setText(Constants.EXTERNAL_STORAGE + '/'
+ Environment.DIRECTORY_DOWNLOADS);
break;
case 2:
downPicker();
break;
}
}
});
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
picker.show();
}
});
}
public void homePicker() {
final AlertDialog.Builder homePicker = new AlertDialog.Builder(mActivity);
homePicker.setTitle(getResources().getString(R.string.title_custom_homepage));
final EditText getHome = new EditText(this);
mHomepage = mPreferences.getString(PreferenceConstants.HOMEPAGE, Constants.HOMEPAGE);
if (!mHomepage.startsWith("about:")) {
getHome.setText(mHomepage);
} else {
getHome.setText("http://www.google.com");
}
homePicker.setView(getHome);
homePicker.setPositiveButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String text = getHome.getText().toString();
mEditPrefs.putString(PreferenceConstants.HOMEPAGE, text);
mEditPrefs.commit();
mHomepageText.setText(text);
}
});
homePicker.show();
}
@SuppressWarnings("deprecation")
public void downPicker() {
final AlertDialog.Builder downLocationPicker = new AlertDialog.Builder(mActivity);
LinearLayout layout = new LinearLayout(this);
downLocationPicker.setTitle(getResources().getString(R.string.title_download_location));
final EditText getDownload = new EditText(this);
getDownload.setBackgroundResource(0);
mDownloadLocation = mPreferences.getString(PreferenceConstants.DOWNLOAD_DIRECTORY,
Environment.DIRECTORY_DOWNLOADS);
int padding = Utils.convertToDensityPixels(this, 10);
LinearLayout.LayoutParams lparams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
getDownload.setLayoutParams(lparams);
getDownload.setTextColor(Color.DKGRAY);
getDownload.setText(mDownloadLocation);
getDownload.setPadding(0, padding, padding, padding);
TextView v = new TextView(this);
v.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
v.setTextColor(Color.DKGRAY);
v.setText(Constants.EXTERNAL_STORAGE + '/');
v.setPadding(padding, padding, 0, padding);
layout.addView(v);
layout.addView(getDownload);
if (API < 16) {
layout.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.edit_text));
} else {
layout.setBackground(getResources().getDrawable(android.R.drawable.edit_text));
}
downLocationPicker.setView(layout);
downLocationPicker.setPositiveButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String text = getDownload.getText().toString();
mEditPrefs.putString(PreferenceConstants.DOWNLOAD_DIRECTORY, text);
mEditPrefs.commit();
mDownloadTextView.setText(Constants.EXTERNAL_STORAGE + '/' + text);
}
});
downLocationPicker.show();
}
public void homepage(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
picker.setTitle(getResources().getString(R.string.home));
mHomepage = mPreferences
.getString(PreferenceConstants.HOMEPAGE, Constants.HOMEPAGE);
int n;
if (mHomepage.contains("about:home")) {
n = 1;
} else if (mHomepage.contains("about:blank")) {
n = 2;
} else if (mHomepage.contains("about:bookmarks")) {
n = 3;
} else {
n = 4;
}
picker.setSingleChoiceItems(R.array.homepage, n - 1,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which + 1) {
case 1:
mEditPrefs.putString(PreferenceConstants.HOMEPAGE,
"about:home");
mEditPrefs.commit();
mHomepageText.setText(getResources().getString(
R.string.action_homepage));
break;
case 2:
mEditPrefs.putString(PreferenceConstants.HOMEPAGE,
"about:blank");
mEditPrefs.commit();
mHomepageText.setText(getResources().getString(
R.string.action_blank));
break;
case 3:
mEditPrefs.putString(PreferenceConstants.HOMEPAGE,
"about:bookmarks");
mEditPrefs.commit();
mHomepageText.setText(getResources().getString(
R.string.action_bookmarks));
break;
case 4:
homePicker();
break;
}
}
});
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
picker.show();
}
});
}
private void cbSearchSuggestions(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.GOOGLE_SEARCH_SUGGESTIONS, isChecked);
mEditPrefs.commit();
}
});
}
private void rSearchSuggestions(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
cbSearchSuggestions.setChecked(!cbSearchSuggestions.isChecked());
}
});
}
}

419
src/acr/browser/lightning/PrivacySettingsActivity.java

@ -0,0 +1,419 @@ @@ -0,0 +1,419 @@
/*
* Copyright 2014 A.C.R. Development
*/
package acr.browser.lightning;
import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.provider.Browser;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.webkit.*;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class PrivacySettingsActivity extends Activity {
// mPreferences variables
private static final int API = android.os.Build.VERSION.SDK_INT;
private SharedPreferences mPreferences;
private SharedPreferences.Editor mEditPrefs;
private CheckBox cbLocation, cbSavePasswords, cbClearCacheExit, cbClearHistoryExit, cbClearCookiesExit;
private Context mContext;
private boolean mSystemBrowser;
private Handler messageHandler;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.privacy_settings);
ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
}
mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0);
if (mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
// TODO WARNING: SharedPreferences.edit() without a corresponding
// commit() or apply() call
mEditPrefs = mPreferences.edit();
mSystemBrowser = mPreferences.getBoolean(PreferenceConstants.SYSTEM_BROWSER_PRESENT, false);
mContext = this;
initialize();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
finish();
return true;
}
private void initialize() {
RelativeLayout rLocation, rSavePasswords, rClearCacheExit, rClearHistoryExit, rClearCookiesExit, rClearCache, rClearHistory, rClearCookies;
rLocation = (RelativeLayout) findViewById(R.id.rLocation);
rSavePasswords = (RelativeLayout) findViewById(R.id.rSavePasswords);
rClearCacheExit = (RelativeLayout) findViewById(R.id.rClearCacheExit);
rClearHistoryExit = (RelativeLayout) findViewById(R.id.rClearHistoryExit);
rClearCookiesExit = (RelativeLayout) findViewById(R.id.rClearCookiesExit);
rClearCache = (RelativeLayout) findViewById(R.id.rClearCache);
rClearHistory = (RelativeLayout) findViewById(R.id.rClearHistory);
rClearCookies = (RelativeLayout) findViewById(R.id.rClearCookies);
cbLocation = (CheckBox) findViewById(R.id.cbLocation);
cbSavePasswords = (CheckBox) findViewById(R.id.cbSavePasswords);
cbClearCacheExit = (CheckBox) findViewById(R.id.cbClearCacheExit);
cbClearHistoryExit = (CheckBox) findViewById(R.id.cbClearHistoryExit);
cbClearCookiesExit = (CheckBox) findViewById(R.id.cbClearCookiesExit);
cbLocation.setChecked(mPreferences.getBoolean(PreferenceConstants.LOCATION, false));
cbSavePasswords.setChecked(mPreferences.getBoolean(PreferenceConstants.SAVE_PASSWORDS, true));
cbClearCacheExit.setChecked(mPreferences.getBoolean(PreferenceConstants.CLEAR_CACHE_EXIT, false));
cbClearHistoryExit.setChecked(mPreferences.getBoolean(
PreferenceConstants.CLEAR_HISTORY_EXIT, false));
cbClearCookiesExit.setChecked(mPreferences.getBoolean(
PreferenceConstants.CLEAR_COOKIES_EXIT, false));
rLocation(rLocation);
rSavePasswords(rSavePasswords);
rClearCacheExit(rClearCacheExit);
rClearHistoryExit(rClearHistoryExit);
rClearCookiesExit(rClearCookiesExit);
rClearCache(rClearCache);
rClearHistory(rClearHistory);
rClearCookies(rClearCookies);
cbLocation(cbLocation);
cbSavePasswords(cbSavePasswords);
cbClearCacheExit(cbClearCacheExit);
cbClearHistoryExit(cbClearHistoryExit);
cbClearCookiesExit(cbClearCookiesExit);
TextView syncHistory = (TextView) findViewById(R.id.isBrowserAvailable);
RelativeLayout layoutSyncHistory = (RelativeLayout) findViewById(R.id.rBrowserHistory);
final CheckBox cbSyncHistory = (CheckBox) findViewById(R.id.cbBrowserHistory);
layoutSyncHistory.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
cbSyncHistory.setChecked(!cbSyncHistory.isChecked());
}
});
cbSyncHistory.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.SYNC_HISTORY, isChecked).apply();
}
});
if (!mSystemBrowser) {
cbSyncHistory.setChecked(false);
cbSyncHistory.setEnabled(false);
syncHistory.setText(getResources().getString(R.string.stock_browser_unavailable));
} else {
cbSyncHistory.setEnabled(true);
cbSyncHistory.setChecked(mPreferences
.getBoolean(PreferenceConstants.SYNC_HISTORY, true));
syncHistory.setText(getResources().getString(R.string.stock_browser_available));
}
messageHandler = new MessageHandler(mContext);
}
private static class MessageHandler extends Handler {
Context mHandlerContext;
public MessageHandler(Context context) {
this.mHandlerContext = context;
}
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case 1:
Utils.showToast(mHandlerContext,
mHandlerContext.getResources()
.getString(R.string.message_clear_history));
break;
case 2:
Utils.showToast(
mHandlerContext,
mHandlerContext.getResources().getString(
R.string.message_cookies_cleared));
break;
}
super.handleMessage(msg);
}
}
private void cbLocation(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.LOCATION, isChecked);
mEditPrefs.commit();
}
});
}
private void cbSavePasswords(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.SAVE_PASSWORDS, isChecked);
mEditPrefs.commit();
}
});
}
private void cbClearCacheExit(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.CLEAR_CACHE_EXIT, isChecked);
mEditPrefs.commit();
}
});
}
private void cbClearHistoryExit(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.CLEAR_HISTORY_EXIT, isChecked);
mEditPrefs.commit();
}
});
}
private void cbClearCookiesExit(CheckBox view) {
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.CLEAR_COOKIES_EXIT, isChecked);
mEditPrefs.commit();
}
});
}
private void rLocation(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cbLocation.setChecked(!cbLocation.isChecked());
}
});
}
private void rSavePasswords(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cbSavePasswords.setChecked(!cbSavePasswords.isChecked());
}
});
}
private void rClearCacheExit(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cbClearCacheExit.setChecked(!cbClearCacheExit.isChecked());
}
});
}
private void rClearHistoryExit(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cbClearHistoryExit.setChecked(!cbClearHistoryExit.isChecked());
}
});
}
private void rClearCookiesExit(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
cbClearCookiesExit.setChecked(!cbClearCookiesExit.isChecked());
}
});
}
private void rClearHistory(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(PrivacySettingsActivity.this); // dialog
builder.setTitle(getResources().getString(R.string.title_clear_history));
builder.setMessage(getResources().getString(R.string.dialog_history))
.setPositiveButton(getResources().getString(R.string.action_yes),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
Thread clear = new Thread(new Runnable() {
@Override
public void run() {
clearHistory();
}
});
clear.start();
}
})
.setNegativeButton(getResources().getString(R.string.action_no),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
// TODO Auto-generated method stub
}
}).show();
}
});
}
private void rClearCookies(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(PrivacySettingsActivity.this); // dialog
builder.setTitle(getResources().getString(R.string.title_clear_cookies));
builder.setMessage(getResources().getString(R.string.dialog_cookies))
.setPositiveButton(getResources().getString(R.string.action_yes),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
Thread clear = new Thread(new Runnable() {
@Override
public void run() {
clearCookies();
}
});
clear.start();
}
})
.setNegativeButton(getResources().getString(R.string.action_no),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
}
}).show();
}
});
}
private void rClearCache(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
clearCache();
}
});
}
public void clearCache() {
WebView webView = new WebView(this);
webView.clearCache(true);
webView.destroy();
Utils.showToast(mContext, getResources().getString(R.string.message_cache_cleared));
}
@SuppressWarnings("deprecation")
public void clearHistory() {
deleteDatabase(HistoryDatabaseHandler.DATABASE_NAME);
WebViewDatabase m = WebViewDatabase.getInstance(this);
m.clearFormData();
m.clearHttpAuthUsernamePassword();
if (API < 18) {
m.clearUsernamePassword();
WebIconDatabase.getInstance().removeAllIcons();
}
if (mSystemBrowser) {
try {
Browser.clearHistory(getContentResolver());
} catch (Exception ignored) {
}
}
SettingsController.setClearHistory(true);
Utils.trimCache(this);
messageHandler.sendEmptyMessage(1);
}
public void clearCookies() {
CookieManager c = CookieManager.getInstance();
CookieSyncManager.createInstance(this);
c.removeAllCookie();
messageHandler.sendEmptyMessage(2);
}
}

689
src/acr/browser/lightning/SettingsActivity.java

@ -13,37 +13,25 @@ import android.content.DialogInterface.OnCancelListener; @@ -13,37 +13,25 @@ import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.util.TypedValue;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.*;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.RelativeLayout;
import android.widget.Switch;
import info.guardianproject.onionkit.ui.OrbotHelper;
public class SettingsActivity extends Activity {
private static int API = android.os.Build.VERSION.SDK_INT;
private SharedPreferences.Editor mEditPrefs;
private int mAgentChoice;
private String mHomepage;
private TextView mAgentTextView;
private TextView mDownloadTextView;
private int mEasterEggCounter;
private String mDownloadLocation;
private TextView mHomepageText;
private SharedPreferences mPreferences;
private TextView mSearchText;
private TextView mRenderText;
private Context mContext;
private Activity mActivity;
@ -80,10 +68,10 @@ public class SettingsActivity extends Activity { @@ -80,10 +68,10 @@ public class SettingsActivity extends Activity {
mEditPrefs = mPreferences.edit();
// initialize UI
RelativeLayout layoutLocation = (RelativeLayout) findViewById(R.id.layoutLocation);
RelativeLayout layoutFullScreen = (RelativeLayout) findViewById(R.id.layoutFullScreen);
RelativeLayout layoutFlash = (RelativeLayout) findViewById(R.id.layoutFlash);
RelativeLayout layoutBlockAds = (RelativeLayout) findViewById(R.id.layoutAdBlock);
RelativeLayout layoutImages = (RelativeLayout) findViewById(R.id.layoutImages);
RelativeLayout layoutEnableJS = (RelativeLayout) findViewById(R.id.layoutEnableJS);
RelativeLayout layoutOrbot = (RelativeLayout) findViewById(R.id.layoutUseOrbot);
RelativeLayout layoutBookmarks = (RelativeLayout) findViewById(R.id.layoutBookmarks);
@ -96,145 +84,34 @@ public class SettingsActivity extends Activity { @@ -96,145 +84,34 @@ public class SettingsActivity extends Activity {
});
mSearchText = (TextView) findViewById(R.id.searchText);
mRenderText = (TextView) findViewById(R.id.renderText);
switch (mPreferences.getInt(PreferenceConstants.SEARCH, 1)) {
case 0:
mSearchText.setText(getResources().getString(R.string.custom_url));
break;
case 1:
mSearchText.setText("Google");
break;
case 2:
mSearchText.setText("Android Search");
break;
case 3:
mSearchText.setText("Bing");
break;
case 4:
mSearchText.setText("Yahoo");
break;
case 5:
mSearchText.setText("StartPage");
break;
case 6:
mSearchText.setText("StartPage (Mobile)");
break;
case 7:
mSearchText.setText("DuckDuckGo");
break;
case 8:
mSearchText.setText("DuckDuckGo Lite");
break;
case 9:
mSearchText.setText("Baidu");
break;
case 10:
mSearchText.setText("Yandex");
}
switch (mPreferences.getInt(PreferenceConstants.RENDERING_MODE, 0)) {
case 0:
mRenderText.setText(mContext.getString(R.string.name_normal));
break;
case 1:
mRenderText.setText(mContext.getString(R.string.name_inverted));
break;
case 2:
mRenderText.setText(mContext.getString(R.string.name_grayscale));
break;
case 3:
mRenderText.setText(mContext.getString(R.string.name_inverted_grayscale));
break;
}
mAgentTextView = (TextView) findViewById(R.id.agentText);
mHomepageText = (TextView) findViewById(R.id.homepageText);
mDownloadTextView = (TextView) findViewById(R.id.downloadText);
if (API >= 19) {
mEditPrefs.putInt(PreferenceConstants.ADOBE_FLASH_SUPPORT, 0);
mEditPrefs.commit();
}
boolean locationBool = mPreferences.getBoolean(PreferenceConstants.LOCATION, false);
int flashNum = mPreferences.getInt(PreferenceConstants.ADOBE_FLASH_SUPPORT, 0);
boolean fullScreenBool = mPreferences.getBoolean(PreferenceConstants.FULL_SCREEN, false);
mAgentChoice = mPreferences.getInt(PreferenceConstants.USER_AGENT, 1);
mHomepage = mPreferences.getString(PreferenceConstants.HOMEPAGE, Constants.HOMEPAGE);
mDownloadLocation = mPreferences.getString(PreferenceConstants.DOWNLOAD_DIRECTORY,
Environment.DIRECTORY_DOWNLOADS);
mDownloadTextView.setText(Constants.EXTERNAL_STORAGE + '/' + mDownloadLocation);
String code = "HOLO";
try {
PackageInfo p = getPackageManager().getPackageInfo(getPackageName(), 0);
code = p.versionName;
} catch (NameNotFoundException e) {
// TODO add logging
e.printStackTrace();
}
TextView version = (TextView) findViewById(R.id.versionCode);
version.setText(code + "");
if (mHomepage.contains("about:home")) {
mHomepageText.setText(getResources().getString(R.string.action_homepage));
} else if (mHomepage.contains("about:blank")) {
mHomepageText.setText(getResources().getString(R.string.action_blank));
} else if (mHomepage.contains("about:bookmarks")) {
mHomepageText.setText(getResources().getString(R.string.action_bookmarks));
} else {
mHomepageText.setText(mHomepage);
}
boolean imagesBool = mPreferences.getBoolean(PreferenceConstants.BLOCK_IMAGES, false);
boolean enableJSBool = mPreferences.getBoolean(PreferenceConstants.JAVASCRIPT, true);
switch (mAgentChoice) {
case 1:
mAgentTextView.setText(getResources().getString(R.string.agent_default));
break;
case 2:
mAgentTextView.setText(getResources().getString(R.string.agent_desktop));
break;
case 3:
mAgentTextView.setText(getResources().getString(R.string.agent_mobile));
break;
case 4:
mAgentTextView.setText(getResources().getString(R.string.agent_custom));
}
RelativeLayout r1, r2, r3, r4, r5, licenses;
RelativeLayout r1, r2, r3, r4, r5;
r1 = (RelativeLayout) findViewById(R.id.setR1);
r2 = (RelativeLayout) findViewById(R.id.setR2);
r3 = (RelativeLayout) findViewById(R.id.setR3);
r4 = (RelativeLayout) findViewById(R.id.setR4);
r5 = (RelativeLayout) findViewById(R.id.setR5);
licenses = (RelativeLayout) findViewById(R.id.layoutLicense);
licenses.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// NOTE: In order to comply with the open source license,
// it is advised that you leave this code so that the License
// Activity may be viewed by the user.
startActivity(new Intent(mContext, LicenseActivity.class));
}
});
Switch location = new Switch(this);
Switch fullScreen = new Switch(this);
Switch flash = new Switch(this);
Switch adblock = new Switch(this);
Switch images = new Switch(this);
Switch enablejs = new Switch(this);
Switch orbot = new Switch(this);
r1.addView(location);
r2.addView(fullScreen);
r3.addView(flash);
r4.addView(adblock);
r1.addView(flash);
r2.addView(adblock);
r3.addView(images);
r4.addView(enablejs);
r5.addView(orbot);
location.setChecked(locationBool);
fullScreen.setChecked(fullScreenBool);
images.setChecked(imagesBool);
enablejs.setChecked(enableJSBool);
if (flashNum > 0) {
flash.setChecked(true);
} else {
@ -243,177 +120,41 @@ public class SettingsActivity extends Activity { @@ -243,177 +120,41 @@ public class SettingsActivity extends Activity {
adblock.setChecked(mPreferences.getBoolean(PreferenceConstants.BLOCK_ADS, false));
orbot.setChecked(mPreferences.getBoolean(PreferenceConstants.USE_PROXY, false));
initSwitch(location, fullScreen, flash, adblock, orbot);
clickListenerForSwitches(layoutLocation, layoutFullScreen, layoutFlash, layoutBlockAds,
layoutOrbot, location, fullScreen, flash, adblock, orbot);
initSwitch(flash, adblock, images, enablejs, orbot);
clickListenerForSwitches(layoutFlash, layoutBlockAds, layoutImages, layoutEnableJS,
layoutOrbot, flash, adblock, images, enablejs, orbot);
RelativeLayout agent = (RelativeLayout) findViewById(R.id.layoutUserAgent);
RelativeLayout download = (RelativeLayout) findViewById(R.id.layoutDownload);
RelativeLayout homepage = (RelativeLayout) findViewById(R.id.layoutHomepage);
RelativeLayout general = (RelativeLayout) findViewById(R.id.layoutGeneral);
RelativeLayout display = (RelativeLayout) findViewById(R.id.layoutDisplay);
RelativeLayout privacy = (RelativeLayout) findViewById(R.id.layoutPrivacy);
RelativeLayout advanced = (RelativeLayout) findViewById(R.id.layoutAdvanced);
RelativeLayout source = (RelativeLayout) findViewById(R.id.layoutSource);
RelativeLayout about = (RelativeLayout) findViewById(R.id.layoutAbout);
agent(agent);
download(download);
homepage(homepage);
general(general);
display(display);
privacy(privacy);
advanced(advanced);
source(source);
search();
renderPicker();
easterEgg();
about(about);
}
public void search() {
RelativeLayout search = (RelativeLayout) findViewById(R.id.layoutSearch);
search.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
picker.setTitle(getResources().getString(R.string.title_search_engine));
CharSequence[] chars = { getResources().getString(R.string.custom_url), "Google",
"Android Search", "Bing", "Yahoo", "StartPage", "StartPage (Mobile)",
"DuckDuckGo (Privacy)", "DuckDuckGo Lite (Privacy)", "Baidu (Chinese)",
"Yandex (Russian)" };
int n = mPreferences.getInt(PreferenceConstants.SEARCH, 1);
picker.setSingleChoiceItems(chars, n, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mEditPrefs.putInt(PreferenceConstants.SEARCH, which);
mEditPrefs.commit();
switch (which) {
case 0:
searchUrlPicker();
break;
case 1:
mSearchText.setText("Google");
break;
case 2:
mSearchText.setText("Android Search");
break;
case 3:
mSearchText.setText("Bing");
break;
case 4:
mSearchText.setText("Yahoo");
break;
case 5:
mSearchText.setText("StartPage");
break;
case 6:
mSearchText.setText("StartPage (Mobile)");
break;
case 7:
mSearchText.setText("DuckDuckGo");
break;
case 8:
mSearchText.setText("DuckDuckGo Lite");
break;
case 9:
mSearchText.setText("Baidu");
break;
case 10:
mSearchText.setText("Yandex");
}
}
});
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
picker.show();
}
});
}
public void renderPicker() {
LinearLayout layout = (LinearLayout) findViewById(R.id.layoutRendering);
layout.setOnClickListener(new OnClickListener() {
public void clickListenerForSwitches(RelativeLayout layoutFlash, RelativeLayout layoutBlockAds,
RelativeLayout layoutImages, RelativeLayout layoutEnableJS, RelativeLayout layoutOrbot,
final Switch flash, final Switch adblock, final Switch images, final Switch enablejs,
final Switch orbot) {
layoutFlash.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
picker.setTitle(getResources().getString(R.string.rendering_mode));
CharSequence[] chars = { mContext.getString(R.string.name_normal),
mContext.getString(R.string.name_inverted),
mContext.getString(R.string.name_grayscale),
mContext.getString(R.string.name_inverted_grayscale) };
int n = mPreferences.getInt(PreferenceConstants.RENDERING_MODE, 0);
picker.setSingleChoiceItems(chars, n, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mEditPrefs.putInt(PreferenceConstants.RENDERING_MODE, which).apply();
switch (which) {
case 0:
mRenderText.setText(mContext.getString(R.string.name_normal));
break;
case 1:
mRenderText.setText(mContext.getString(R.string.name_inverted));
break;
case 2:
mRenderText.setText(mContext.getString(R.string.name_grayscale));
break;
case 3:
mRenderText.setText(mContext
.getString(R.string.name_inverted_grayscale));
break;
}
}
});
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
picker.show();
if (API < 19) {
flash.setChecked(!flash.isChecked());
} else {
Utils.createInformativeDialog(mContext,
getResources().getString(R.string.title_warning), getResources()
.getString(R.string.dialog_adobe_dead));
}
}
});
}
public void searchUrlPicker() {
final AlertDialog.Builder urlPicker = new AlertDialog.Builder(this);
urlPicker.setTitle(getResources().getString(R.string.custom_url));
final EditText getSearchUrl = new EditText(this);
String mSearchUrl = mPreferences.getString(PreferenceConstants.SEARCH_URL,
Constants.GOOGLE_SEARCH);
getSearchUrl.setText(mSearchUrl);
urlPicker.setView(getSearchUrl);
urlPicker.setPositiveButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String text = getSearchUrl.getText().toString();
mEditPrefs.putString(PreferenceConstants.SEARCH_URL, text);
mEditPrefs.commit();
mSearchText.setText(getResources().getString(R.string.custom_url) + ": "
+ text);
}
});
urlPicker.show();
}
public void clickListenerForSwitches(RelativeLayout one, RelativeLayout two,
RelativeLayout three, RelativeLayout layoutBlockAds, RelativeLayout layoutOrbot,
final Switch loc, final Switch full, final Switch flash, final Switch adblock,
final Switch orbot) {
layoutBlockAds.setOnClickListener(new OnClickListener() {
@Override
@ -422,33 +163,19 @@ public class SettingsActivity extends Activity { @@ -422,33 +163,19 @@ public class SettingsActivity extends Activity {
}
});
one.setOnClickListener(new OnClickListener() {
layoutImages.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
loc.setChecked(!loc.isChecked());
images.setChecked(!images.isChecked());
}
});
two.setOnClickListener(new OnClickListener() {
layoutEnableJS.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
full.setChecked(!full.isChecked());
}
});
three.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (API < 19) {
flash.setChecked(!flash.isChecked());
} else {
Utils.createInformativeDialog(mContext,
getResources().getString(R.string.title_warning), getResources()
.getString(R.string.dialog_adobe_dead));
}
enablejs.setChecked(!enablejs.isChecked());
}
});
@ -466,47 +193,8 @@ public class SettingsActivity extends Activity { @@ -466,47 +193,8 @@ public class SettingsActivity extends Activity {
});
}
public void easterEgg() {
RelativeLayout easter = (RelativeLayout) findViewById(R.id.layoutVersion);
easter.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mEasterEggCounter++;
if (mEasterEggCounter == 10) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse("http://imgs.xkcd.com/comics/compiling.png"), mContext,
MainActivity.class));
finish();
mEasterEggCounter = 0;
}
}
});
}
public void initSwitch(Switch location, Switch fullscreen, Switch flash, Switch adblock,
public void initSwitch(Switch flash, Switch adblock, Switch images, Switch enablejs,
Switch orbot) {
adblock.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.BLOCK_ADS, isChecked);
mEditPrefs.commit();
}
});
location.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.LOCATION, isChecked);
mEditPrefs.commit();
}
});
flash.setEnabled(API < 19);
flash.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@ -545,11 +233,30 @@ public class SettingsActivity extends Activity { @@ -545,11 +233,30 @@ public class SettingsActivity extends Activity {
}
});
fullscreen.setOnCheckedChangeListener(new OnCheckedChangeListener() {
adblock.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.BLOCK_ADS, isChecked);
mEditPrefs.commit();
}
});
images.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.FULL_SCREEN, isChecked);
mEditPrefs.putBoolean(PreferenceConstants.BLOCK_IMAGES, isChecked);
mEditPrefs.commit();
}
});
enablejs.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.JAVASCRIPT, isChecked);
mEditPrefs.commit();
}
@ -606,17 +313,7 @@ public class SettingsActivity extends Activity { @@ -606,17 +313,7 @@ public class SettingsActivity extends Activity {
alert.show();
}
public void initCheckBox(CheckBox location, CheckBox fullscreen, CheckBox flash) {
location.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.LOCATION, isChecked);
mEditPrefs.commit();
}
});
public void initCheckBox(CheckBox flash, CheckBox images, CheckBox enablejs) {
flash.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
@ -653,73 +350,22 @@ public class SettingsActivity extends Activity { @@ -653,73 +350,22 @@ public class SettingsActivity extends Activity {
}
});
fullscreen.setOnCheckedChangeListener(new OnCheckedChangeListener() {
images.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.FULL_SCREEN, isChecked);
mEditPrefs.putBoolean(PreferenceConstants.BLOCK_IMAGES, isChecked);
mEditPrefs.commit();
}
});
}
public void agent(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
enablejs.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder agentPicker = new AlertDialog.Builder(mActivity);
agentPicker.setTitle(getResources().getString(R.string.title_user_agent));
mAgentChoice = mPreferences.getInt(PreferenceConstants.USER_AGENT, 1);
agentPicker.setSingleChoiceItems(R.array.user_agent, mAgentChoice - 1,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mEditPrefs.putInt(PreferenceConstants.USER_AGENT, which + 1);
mEditPrefs.commit();
switch (which + 1) {
case 1:
mAgentTextView.setText(getResources().getString(
R.string.agent_default));
break;
case 2:
mAgentTextView.setText(getResources().getString(
R.string.agent_desktop));
break;
case 3:
mAgentTextView.setText(getResources().getString(
R.string.agent_mobile));
break;
case 4:
mAgentTextView.setText(getResources().getString(
R.string.agent_custom));
agentPicker();
break;
}
}
});
agentPicker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
agentPicker.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
// TODO Auto-generated method stub
Log.i("Cancelled", "");
}
});
agentPicker.show();
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mEditPrefs.putBoolean(PreferenceConstants.JAVASCRIPT, isChecked);
mEditPrefs.commit();
}
@ -747,195 +393,34 @@ public class SettingsActivity extends Activity { @@ -747,195 +393,34 @@ public class SettingsActivity extends Activity {
agentStringPicker.show();
}
public void download(RelativeLayout view) {
public void general(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
picker.setTitle(getResources().getString(R.string.title_download_location));
mDownloadLocation = mPreferences.getString(PreferenceConstants.DOWNLOAD_DIRECTORY,
Environment.DIRECTORY_DOWNLOADS);
int n;
if (mDownloadLocation.contains(Environment.DIRECTORY_DOWNLOADS)) {
n = 1;
} else {
n = 2;
}
picker.setSingleChoiceItems(R.array.download_folder, n - 1,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which + 1) {
case 1:
mEditPrefs.putString(
PreferenceConstants.DOWNLOAD_DIRECTORY,
Environment.DIRECTORY_DOWNLOADS);
mEditPrefs.commit();
mDownloadTextView.setText(Constants.EXTERNAL_STORAGE + '/'
+ Environment.DIRECTORY_DOWNLOADS);
break;
case 2:
downPicker();
break;
}
}
});
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
picker.show();
startActivity(new Intent(mContext, GeneralSettingsActivity.class));
}
});
}
public void homePicker() {
final AlertDialog.Builder homePicker = new AlertDialog.Builder(mActivity);
homePicker.setTitle(getResources().getString(R.string.title_custom_homepage));
final EditText getHome = new EditText(this);
mHomepage = mPreferences.getString(PreferenceConstants.HOMEPAGE, Constants.HOMEPAGE);
if (!mHomepage.startsWith("about:")) {
getHome.setText(mHomepage);
} else {
getHome.setText("http://www.google.com");
}
homePicker.setView(getHome);
homePicker.setPositiveButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String text = getHome.getText().toString();
mEditPrefs.putString(PreferenceConstants.HOMEPAGE, text);
mEditPrefs.commit();
mHomepageText.setText(text);
}
});
homePicker.show();
}
public void display(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@SuppressWarnings("deprecation")
public void downPicker() {
final AlertDialog.Builder downLocationPicker = new AlertDialog.Builder(mActivity);
LinearLayout layout = new LinearLayout(this);
downLocationPicker.setTitle(getResources().getString(R.string.title_download_location));
final EditText getDownload = new EditText(this);
getDownload.setBackgroundResource(0);
mDownloadLocation = mPreferences.getString(PreferenceConstants.DOWNLOAD_DIRECTORY,
Environment.DIRECTORY_DOWNLOADS);
int padding = Utils.convertToDensityPixels(this, 10);
LinearLayout.LayoutParams lparams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
getDownload.setLayoutParams(lparams);
getDownload.setTextColor(Color.DKGRAY);
getDownload.setText(mDownloadLocation);
getDownload.setPadding(0, padding, padding, padding);
TextView v = new TextView(this);
v.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
v.setTextColor(Color.DKGRAY);
v.setText(Constants.EXTERNAL_STORAGE + '/');
v.setPadding(padding, padding, 0, padding);
layout.addView(v);
layout.addView(getDownload);
if (API < 16) {
layout.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.edit_text));
} else {
layout.setBackground(getResources().getDrawable(android.R.drawable.edit_text));
}
downLocationPicker.setView(layout);
downLocationPicker.setPositiveButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(mContext, DisplaySettingsActivity.class));
}
@Override
public void onClick(DialogInterface dialog, int which) {
String text = getDownload.getText().toString();
mEditPrefs.putString(PreferenceConstants.DOWNLOAD_DIRECTORY, text);
mEditPrefs.commit();
mDownloadTextView.setText(Constants.EXTERNAL_STORAGE + '/' + text);
}
});
downLocationPicker.show();
});
}
public void homepage(RelativeLayout view) {
public void privacy(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
picker.setTitle(getResources().getString(R.string.home));
mHomepage = mPreferences
.getString(PreferenceConstants.HOMEPAGE, Constants.HOMEPAGE);
int n;
if (mHomepage.contains("about:home")) {
n = 1;
} else if (mHomepage.contains("about:blank")) {
n = 2;
} else if (mHomepage.contains("about:bookmarks")) {
n = 3;
} else {
n = 4;
}
picker.setSingleChoiceItems(R.array.homepage, n - 1,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which + 1) {
case 1:
mEditPrefs.putString(PreferenceConstants.HOMEPAGE,
"about:home");
mEditPrefs.commit();
mHomepageText.setText(getResources().getString(
R.string.action_homepage));
break;
case 2:
mEditPrefs.putString(PreferenceConstants.HOMEPAGE,
"about:blank");
mEditPrefs.commit();
mHomepageText.setText(getResources().getString(
R.string.action_blank));
break;
case 3:
mEditPrefs.putString(PreferenceConstants.HOMEPAGE,
"about:bookmarks");
mEditPrefs.commit();
mHomepageText.setText(getResources().getString(
R.string.action_bookmarks));
break;
case 4:
homePicker();
break;
}
}
});
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
picker.show();
startActivity(new Intent(mContext, PrivacySettingsActivity.class));
}
});
@ -952,14 +437,12 @@ public class SettingsActivity extends Activity { @@ -952,14 +437,12 @@ public class SettingsActivity extends Activity {
});
}
public void source(RelativeLayout view) {
public void about(RelativeLayout view) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse("http://twitter.com/ACRDevelopment"), mContext, MainActivity.class));
finish();
startActivity(new Intent(mContext, AboutSettingsActivity.class));
}
});

Loading…
Cancel
Save