Browse Source

3.0.0 Sync for old version

master
Anthony Restaino 11 years ago
parent
commit
0f12931ff3
  1. 263
      AndroidManifest.xml
  2. BIN
      ic_launcher.png
  3. BIN
      ic_launcher_small.png
  4. BIN
      res/drawable-hdpi/ic_action_refresh.png
  5. BIN
      res/drawable-hdpi/ic_launcher.png
  6. BIN
      res/drawable-mdpi/ic_action_refresh.png
  7. BIN
      res/drawable-mdpi/ic_launcher.png
  8. BIN
      res/drawable-xhdpi/ic_action_refresh.png
  9. BIN
      res/drawable-xhdpi/ic_launcher.png
  10. BIN
      res/drawable-xxhdpi/ic_launcher.png
  11. BIN
      res/drawable-xxxhdpi/ic_launcher.png
  12. 2
      res/layout/activity_main.xml
  13. 6
      res/menu/incognito_menu.xml
  14. 12
      res/menu/menu.xml
  15. 113
      res/values-ar/strings.xml
  16. 2
      res/values-de/strings.xml
  17. 4
      res/values-es/strings.xml
  18. 2
      res/values-fr/strings.xml
  19. 40
      res/values-iw/strings.xml
  20. 2
      res/values-ru/strings.xml
  21. 6
      res/values-tr/strings.xml
  22. 82
      res/values-zh-rCN/strings.xml
  23. 112
      res/values-zh-rTW/strings.xml
  24. 94
      res/values/strings.xml
  25. 28
      src/acr/browser/barebones/activities/AdvancedSettingsActivity.java
  26. 133
      src/acr/browser/barebones/activities/BrowserActivity.java
  27. 125
      src/acr/browser/barebones/activities/IncognitoModeActivity.java
  28. 185
      src/acr/browser/barebones/activities/SettingsActivity.java
  29. 2
      src/acr/browser/barebones/utilities/Utils.java
  30. 15
      src/acr/browser/barebones/webviewclasses/CustomDownloadListener.java

263
AndroidManifest.xml

@ -1,126 +1,139 @@ @@ -1,126 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="acr.browser.barebones"
android:versionCode="60"
android:versionName="2.5.1.4" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS" />
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
<uses-feature android:name="android.hardware.location" android:required="false"/>
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".activities.BrowserActivity"
android:alwaysRetainTaskState="true"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/app_name"
android:launchMode="singleTask" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.APP_BROWSER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="about" />
<data android:scheme="javascript" />
</intent-filter>
<!--
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="acr.browser.barebones"
android:versionCode="66"
android:versionName="3.0.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS" />
<uses-feature
android:name="android.hardware.location.gps"
android:required="false" />
<uses-feature
android:name="android.hardware.location"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".activities.BrowserActivity"
android:alwaysRetainTaskState="true"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/app_name"
android:launchMode="singleTask" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.APP_BROWSER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="about" />
<data android:scheme="javascript" />
</intent-filter>
<!--
For these schemes where any of these particular MIME types
have been supplied, we are a good candidate.
-->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="inline" />
<data android:mimeType="text/html" />
<data android:mimeType="text/plain" />
<data android:mimeType="application/xhtml+xml" />
<data android:mimeType="application/vnd.wap.xhtml+xml" />
</intent-filter>
<!-- For viewing saved web archives. -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="file" />
<data android:mimeType="application/x-webarchive-xml" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.WEB_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="" />
<data android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
</activity>
<activity
android:name=".activities.IncognitoModeActivity"
android:alwaysRetainTaskState="true"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/app_name"
android:launchMode="singleTask" >
<intent-filter>
<action android:name="android.intent.action.BROWSER_INCOGNITO" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activities.SettingsActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activities.AdvancedSettingsActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/title_activity_advanced_settings" >
<intent-filter>
<action android:name="android.intent.action.ADVANCED_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
have been supplied, we are a good candidate.
-->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="inline" />
<data android:mimeType="text/html" />
<data android:mimeType="text/plain" />
<data android:mimeType="application/xhtml+xml" />
<data android:mimeType="application/vnd.wap.xhtml+xml" />
</intent-filter>
<!-- For viewing saved web archives. -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="file" />
<data android:mimeType="application/x-webarchive-xml" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.WEB_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="" />
<data android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
</activity>
<activity
android:name=".activities.IncognitoModeActivity"
android:alwaysRetainTaskState="true"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/app_name"
android:launchMode="singleTask" >
<intent-filter>
<action android:name="android.intent.action.BROWSER_INCOGNITO" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activities.SettingsActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activities.AdvancedSettingsActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/advanced" >
<intent-filter>
<action android:name="android.intent.action.ADVANCED_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>

BIN
ic_launcher.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 59 KiB

BIN
ic_launcher_small.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
res/drawable-hdpi/ic_action_refresh.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
res/drawable-hdpi/ic_launcher.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
res/drawable-mdpi/ic_action_refresh.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 B

BIN
res/drawable-mdpi/ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
res/drawable-xhdpi/ic_action_refresh.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
res/drawable-xhdpi/ic_launcher.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
res/drawable-xxhdpi/ic_launcher.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
res/drawable-xxxhdpi/ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

2
res/layout/activity_main.xml

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
android:id="@+id/urlBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
>

6
res/menu/incognito_menu.xml

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/history" android:title="@string/menu_history" android:titleCondensed="@string/menu_history" android:orderInCategory="1"></item>
<item android:id="@+id/allBookmarks" android:titleCondensed="@string/menu_bookmarks" android:title="@string/menu_bookmarks" android:orderInCategory="3"></item>
<item android:id="@+id/incognito" android:title="@string/menu_new_tab" android:orderInCategory="5" android:titleCondensed="@string/menu_new_tab"></item>
<item android:id="@+id/history" android:title="@string/action_history" android:titleCondensed="@string/action_history" android:orderInCategory="1"></item>
<item android:id="@+id/allBookmarks" android:titleCondensed="@string/action_bookmarks" android:title="@string/action_bookmarks" android:orderInCategory="3"></item>
<item android:id="@+id/incognito" android:title="@string/action_new_tab" android:orderInCategory="5" android:titleCondensed="@string/action_new_tab"></item>
</menu>

12
res/menu/menu.xml

@ -1,11 +1,11 @@ @@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/history" android:title="@string/menu_history" android:titleCondensed="@string/menu_history" android:orderInCategory="1"></item>
<item android:id="@+id/bookmark" android:title="@string/menu_add" android:titleCondensed="@string/menu_add" android:orderInCategory="2"></item>
<item android:id="@+id/allBookmarks" android:titleCondensed="@string/menu_bookmarks" android:title="@string/menu_bookmarks" android:orderInCategory="3"></item>
<item android:id="@+id/share" android:title="@string/menu_share" android:titleCondensed="@string/menu_share" android:orderInCategory="4"></item>
<item android:id="@+id/settings" android:title="@string/menu_settings" android:titleCondensed="@string/menu_settings" android:orderInCategory="6"></item>
<item android:id="@+id/incognito" android:title="@string/menu_incognito" android:orderInCategory="5" android:titleCondensed="@string/menu_incognito"></item>
<item android:id="@+id/history" android:title="@string/action_history" android:titleCondensed="@string/action_history" android:orderInCategory="1"></item>
<item android:id="@+id/bookmark" android:title="@string/action_add_bookmark" android:titleCondensed="@string/action_add_bookmark" android:orderInCategory="2"></item>
<item android:id="@+id/allBookmarks" android:titleCondensed="@string/action_bookmarks" android:title="@string/action_bookmarks" android:orderInCategory="3"></item>
<item android:id="@+id/share" android:title="@string/action_share" android:titleCondensed="@string/action_share" android:orderInCategory="4"></item>
<item android:id="@+id/settings" android:title="@string/action_settings" android:titleCondensed="@string/action_settings" android:orderInCategory="6"></item>
<item android:id="@+id/incognito" android:title="@string/action_incognito" android:orderInCategory="5" android:titleCondensed="@string/action_incognito"></item>
</menu>

113
res/values-ar/strings.xml

@ -0,0 +1,113 @@ @@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="app_name">Lightning</string>
<string name="google">جوجل</string>
<string name="settings">إعدادات المتصفح</string>
<string name="location">الوصول إلى موقعك</string>
<string name="password">حفظ كلمات السر</string>
<string name="agent">وكيل المستخدم</string>
<string name="history">مسح السجل</string>
<string name="email">راسلني</string>
<string name="flash">تفعيل مشغل الفلاش</string>
<string name="mobile">عرض بشكل الجوال</string>
<string name="desk">عرض بشكل الكمبيوتر</string>
<string name="custom">عرض وكيل مستخدم مخصص</string>
<string name="home">الصفحة الرئيسية</string>
<string name="settingshelp">سوف يتم تطبيق الإعدادات فقط على علامات التبويب الجديدة</string>
<string name="fullscreen">وضع ملء الشاشة</string>
<string name="java">تفعيل الجافا</string>
<string name="saveTab">استعادة علامات التبويب المفقودة</string>
<string name="settings_title">الإعدادات</string>
<string name="download">مسار التحميلات</string>
<string name="advanced">الإعدادات المتقدمة</string>
<string name="source">رمز المصدر</string>
<string name="license">الرخصة</string>
<string name="github">github.com/anthonycr/Lightning-Browser</string>
<string name="apache"> ترخيص اباتشي 2.0</string>
<string name="title_activity_new_settings">الإعدادات الجديدة</string>
<string name="action_settings">الإعدادات</string>
<string name="version">إصدار التطبيق</string>
<string name="cache"> مسح ذاكرة التخزين المؤقتة عند الخروج</string>
<string name="reflow">تفعيل إلتفاف النص</string>
<string name="block">حظر الصور</string>
<string name="window">السماح للمواقع بالفتح في نوافذ جديدة</string>
<string name="cookies">تفعيل ملفات تعريف الارتباط</string>
<string name="importbookmarks">استيراد العلامات المرجعية من المتصفح</string>
<string name="size">حجم النص</string>
<string name="title_activity_advanced_settings">الإعدادات المتقدمة</string>
<string name="recommended">(مستحسن)</string>
<string name="weird_look">(مواقع قد تبدو غريبة)</string>
<string name="search">محرك البحث</string>
<string name="search_hint">بحث</string>
<string name="wideViewPort">استخدام إطار عرض واسع</string>
<string name="overViewMode">تحميل الصفحات في نظرة عامة</string>
<string name="restore">استعادة علامات التبويب المفقودة عند البدء</string>
<string name="menu_history">السجل</string>
<string name="menu_add">إضافة إلى العلامات المرجعية</string>
<string name="menu_bookmarks">العلامات المرجعية</string>
<string name="menu_share">مشاركة</string>
<string name="menu_settings">الإعدادات</string>
<string name="menu_incognito">علامة تبويب التخفي</string>
<string name="menu_new_tab">علامة تبويب جديدة</string>
<string name="stock_browser_unavailable">(لا يوجد مخزون في المتصفح)</string>
<string name="stock_browser_available">(دعم مخزون المتصفح )</string>
<string name="fullScreenOption">إخفاء شريط الحالة أثناء التصفح</string>
<string name="clear_cookies">مسح ملفات تعريف الارتباط</string>
<string name="gestures">تفعيل إيماءات الأمام و الخلف</string>
<string name="dialog_image">ماذا تريد أن تفعل مع هذه الصورة؟</string>
<string name="action_download">تحميل</string>
<string name="action_open">فتح</string>
<string name="dialog_link">ماذا تريد أن تفعل مع هذا الرابط؟</string>
<string name="dialog_title_share">مشاركة هذه الصفحة</string>
<string name="dialog_bookmark">ماذا تريد ان تفعل مع هذه العلامة المرجعية ؟</string>
<string name="action_delete">حذف</string>
<string name="action_blank">صفحة فارغة</string>
<string name="agent_default">الافتراضي</string>
<string name="agent_desktop">الكمبيوتر</string>
<string name="agent_mobile">الجوال</string>
<string name="agent_custom">مخصص</string>
<string name="title_search_engine">محرك البحث</string>
<string name="action_ok">حسنا</string>
<string name="dialog_download">هل ترغب في تحميل هذا الملف؟</string>
<string name="action_cancel">إلغاء</string>
<string name="title_warning">تحذير</string>
<string name="dialog_adobe_dead">عفوا, لقد أجريت جوجل بعض التغييرات , و مشغل الفلاش لم يعد يعمل على أندرويد 4.4 فما فوق.</string>
<string name="dialog_adobe_not_installed">لم يتم العثور على مشغل الفلاش يرجى تثبيته من المتجر.</string>
<string name="dialog_adobe_unsupported">مشغل الفلاش لا يدعم أندرويد 4.2 فما فوق , و عند تفعيل الفلاش سوف يتعطل المتصفح . يرجى عدم إبلاغنا بالمشاكل في حال تفعيل مشغل الفلاش.</string>
<string name="title_user_agent">وكيل المستخدم</string>
<string name="title_download_location">مسار التحميلات</string>
<string name="title_custom_homepage">صفحة رئيسية مخصصة</string>
<string name="action_webpage">صفحة ويب</string>
<string name="dialog_reflow_warning">عفوا , لقد أجريت جوجل بعض التغييرات و إلتفاف النص لم يعد يعمل على أندرويد 4.4 فما فوق.</string>
<string name="title_clear_history">مسح السجل</string>
<string name="title_clear_cookies">مسح ملفات تعريف الارتباط</string>
<string name="dialog_history">هل تريد مسح جميع سجلات التصفح ؟</string>
<string name="dialog_cookies">هل تريد مسح جميع ملفات تعريف الارتباط ؟</string>
<string name="action_yes">نعم</string>
<string name="action_no">لا</string>
<string name="title_text_size">حجم النص</string>
<string name="size_largest">ضخم</string>
<string name="size_large">كبير</string>
<string name="size_normal">عادي</string>
<string name="size_small">صغير</string>
<string name="size_smallest">ضئيل</string>
<string name="title_error">خطأ</string>
<string name="dialog_import_error">لم يتم العثور على متصفح ليتم إستيراد العلامات مرجعية .</string>
<string name="hint_title">العنوان</string>
<string name="hint_url">الرابط</string>
<string name="title_edit_bookmark">تعديل العلامة المرجعية</string>
<string name="action_edit">تعديل</string>
<string name="action_incognito">علامة تبويب التخفي</string>
<string name="action_homepage">الافتراضي</string>
<string name="drawer_open">فتح قائمة التنقل</string>
<string name="drawer_close">إغلاق قائمة التنقل</string>
<string name="action_websearch">البحث في الويب</string>
<string name="action_refresh">تحديث</string>
<string name="action_new_tab">علامة تبويب جديدة</string>
<string name="action_share">مشاركة</string>
<string name="action_history">السجل</string>
<string name="action_bookmarks">العلامات المرجعية </string>
<string name="action_add_bookmark">إضافة إلى العلامات المرجعية</string>
<string name="action_copy">نسخ الرابط</string>
<string name="action_forward">الأمام</string>
</resources>

2
res/values-de/strings.xml

@ -57,4 +57,4 @@ @@ -57,4 +57,4 @@
<string name="clear_cookies">Cookies löschen</string>
<string name="gestures">Vor- und Zurückgesten aktivieren</string>
</resources>
</resources>

4
res/values-es/strings.xml

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Lightning</string>
<string name="app_name">Lightning</string>
<string name="google">Google</string>
<string name="settings">Ajustes del navegador</string>
<string name="location">Acceder a tu ubicación</string>
@ -56,4 +56,4 @@ @@ -56,4 +56,4 @@
<string name="clear_cookies">Limpiar cookies</string>
<string name="gestures">Habilitar gestos de atrás y adelante</string>
</resources>
</resources>

2
res/values-fr/strings.xml

@ -22,4 +22,4 @@ @@ -22,4 +22,4 @@
<string name="menu_settings">Paramètres</string>
<string name="menu_incognito">Onglet incognito</string>
<string name="menu_new_tab">Nouvel onglet</string>
</resources>
</resources>

40
res/values-iw/strings.xml

@ -1,21 +1,21 @@ @@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Lightning</string>
<string name="google">Google</string>
<string name="settings">הגדרות דפדפן</string>
<string name="location">מאפשר לאתרים לגשת למיקומך</string>
<string name="password">שמור את הסיסמאות שלך</string>
<string name="agent">סוכן משתמש</string>
<string name="history">מחק הסטוריה ביציאה</string>
<string name="email">שלח לי דוא\"ל</string>
<string name="flash">הפעל תכני פלאש (אם מותקן)</string>
<string name="mobile">הצג כנייד</string>
<string name="desk">הצג כמחשב</string>
<string name="custom">הצג כסוכן משתמש מותאם אישית</string>
<string name="home">דף הבית</string>
<string name="settingshelp">הגדות מוחלות על כרטיסיות חדשות בלבד</string>
<string name="fullscreen">הפעל מצב מסך מלא</string>
<string name="java">הפעל JavaScript</string>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Lightning</string>
<string name="google">Google</string>
<string name="settings">הגדרות דפדפן</string>
<string name="location">מאפשר לאתרים לגשת למיקומך</string>
<string name="password">שמור את הסיסמאות שלך</string>
<string name="agent">סוכן משתמש</string>
<string name="history">מחק הסטוריה ביציאה</string>
<string name="email">שלח לי דוא\"ל</string>
<string name="flash">הפעל תכני פלאש (אם מותקן)</string>
<string name="mobile">הצג כנייד</string>
<string name="desk">הצג כמחשב</string>
<string name="custom">הצג כסוכן משתמש מותאם אישית</string>
<string name="home">דף הבית</string>
<string name="settingshelp">הגדות מוחלות על כרטיסיות חדשות בלבד</string>
<string name="fullscreen">הפעל מצב מסך מלא</string>
<string name="java">הפעל JavaScript</string>
</resources>

2
res/values-ru/strings.xml

@ -107,4 +107,4 @@ @@ -107,4 +107,4 @@
<string name="download_no_sdcard_dlg_msg">Для загрузки файла необходима карта памяти</string>
<string name="download_sdcard_busy_dlg_title">Карта памяти недоступна</string>
<string name="download_sdcard_busy_dlg_msg">Карта памяти подключена к ПК. Для начала загрузки отключите её от ПК, нажав на уведомление</string>
</resources>
</resources>

6
res/values-tr/strings.xml

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
<string name="app_name">Lightning</string>
<string name="google">Google</string>
<string name="settings">Tarayıcı ayarlarıstring>
<string name="settings">Tarayıcı ayarlarıstring</string>
<string name="location">Konum erişimi</string>
<string name="password">Parolarınızı kaydetme</string>
<string name="agent">Kullanıcı arayüzü</string>
@ -53,5 +53,5 @@ @@ -53,5 +53,5 @@
<string name="menu_new_tab">Yeni pencere</string>
<string name="stock_browser_unavailable">(Hiçbir stok tarayıcı tespit edilemedi)</string>
<string name="stock_browser_available">(Desteklenen stok tarayıcı tespit edildi)</string>
</resources>
</resources>

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

@ -1,17 +1,7 @@ @@ -1,17 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Lightning+</string>
<string name="drawer_open">打开导航抽屉</string>
<string name="drawer_close">关闭导航抽屉</string>
<string name="action_websearch">网页搜索</string>
<string name="action_refresh">刷新页面</string>
<string name="action_new_tab">新建标签</string>
<string name="action_share">分享页面</string>
<string name="action_history">历史记录</string>
<string name="action_bookmarks">书签列表</string>
<string name="action_add_bookmark">添加书签</string>
<string name="action_copy">复制链接</string>
<string name="action_forward">前进</string>
<string name="app_name">Lightning</string>
<string name="google">Google</string>
<string name="settings">浏览器设置</string>
<string name="location">允许站点访问地理位置</string>
@ -45,6 +35,8 @@ @@ -45,6 +35,8 @@
<string name="cookies">启用 Cookies</string>
<string name="importbookmarks">从浏览器中导入书签</string>
<string name="size">页面文本尺寸</string>
<string name="title_activity_advanced_settings">AdvancedSettings</string>
<string name="hello_world">Hello world!</string>
<string name="recommended">(推荐)</string>
<string name="weird_look">(可能导致部分网页排版混乱)</string>
<string name="search">搜索引擎</string>
@ -52,63 +44,17 @@ @@ -52,63 +44,17 @@
<string name="wideViewPort">使用宽视图</string>
<string name="overViewMode">使用概览模式载入页面</string>
<string name="restore">启动时恢复丢失页面</string>
<string name="menu_history">历史记录</string>
<string name="menu_add">添加书签</string>
<string name="menu_bookmarks">书签列表</string>
<string name="menu_share">分享页面</string>
<string name="menu_settings">应用设置</string>
<string name="menu_incognito">隐身标签</string>
<string name="menu_new_tab">新建标签</string>
<string name="stock_browser_unavailable">(尚未检测到已支持原生浏览器)</string>
<string name="stock_browser_available">(已检测到受支持的原生浏览器)</string>
<string name="fullScreenOption">浏览时隐藏状态栏</string>
<string name="clear_cookies">清除浏览器 Cookies</string>
<string name="dialog_image">您希望对此图片进行什么操作?</string>
<string name="action_download">下载</string>
<string name="action_open">打开</string>
<string name="dialog_link">您希望对此链接进行什么操作?</string>
<string name="dialog_title_share">分享此页面</string>
<string name="dialog_bookmark">What would you like to do with this bookmark?</string>
<string name="action_delete">删除</string>
<string name="action_blank">Blank Page</string>
<string name="agent_default">默认 UA</string>
<string name="agent_desktop">桌面访问</string>
<string name="agent_mobile">移动设备</string>
<string name="agent_custom">自定义 UA</string>
<string name="title_search_engine">搜索引擎</string>
<string name="action_ok">确认</string>
<string name="dialog_download">您是否需要下载此文件?</string>
<string name="action_cancel">取消</string>
<string name="title_warning">警告</string>
<string name="dialog_adobe_dead">"非常抱歉,Google 对此做了一些更改导致 Adobe Flash 无法支持 Android 4.4 以及更高版本。"</string>
<string name="dialog_adobe_not_installed">"未检测到您的设备中安装了 Adobe Flash Player,
请先安装 Adobe Flash Player 后再启用此选项。"</string>
<string name="dialog_adobe_unsupported">Adobe Flash 无法正常支持 Android 4.2 以及更高版本并且可能导致浏览器崩溃,若您启用后出现浏览器崩溃的问题请勿对此问题进行反馈。</string>
<string name="title_user_agent">User Agent</string>
<string name="title_download_location">下载目录</string>
<string name="title_custom_homepage">自定义主页</string>
<string name="action_webpage">网页</string>
<string name="dialog_reflow_warning">"非常抱歉,Google 对此做了一些更改导致文本重拍无法支持 Android 4.4 以及更高版本。"</string>
<string name="title_clear_history">清除历史记录</string>
<string name="title_clear_cookies">清除 Cookies</string>
<string name="dialog_history">您是否确认清除所有浏览器历史记录?</string>
<string name="dialog_cookies">您是否确认清除所有浏览器历史记录 Cookies?</string>
<string name="action_yes">确认</string>
<string name="action_no">取消</string>
<string name="title_text_size">文本大小</string>
<string name="size_largest">最大</string>
<string name="size_large">较大</string>
<string name="size_normal">普通</string>
<string name="size_small">较小</string>
<string name="size_smallest">最小</string>
<string name="title_error">错误</string>
<string name="dialog_import_error">暂未检测到任何可导入书签的浏览器</string>
<string name="hint_title">Title</string>
<string name="hint_url">URL</string>
<string name="title_edit_bookmark">编辑书签</string>
<string name="action_edit">编辑</string>
<string name="action_incognito">新建隐身标签</string>
<string name="hello_world">Hello world!</string>
<string name="action_homepage">默认页面</string>
<string name="action_back">返回</string>
<string name="action_find">页内搜索</string>
<string name="download_pending">正在开始下载…</string>
<string name="cannot_download">仅可下载以 \"http\" 或 \"https\" 开头的链接地址</string>
<string name="download_no_sdcard_dlg_title">未发现 SDCard</string>
<string name="download_no_sdcard_dlg_msg">为正常下载此文件需要 USB 存储设备。</string>
<string name="download_sdcard_busy_dlg_title">USB 存储不可用</string>
<string name="download_sdcard_busy_dlg_msg">USB 存储设备目前正忙,为确保正常下载此文件请在通知栏中确认关闭 USB 大容量存储。</string>
</resources>
<string name="gestures">启用前进后退手势控制</string>
</resources>

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

@ -1,57 +1,57 @@ @@ -1,57 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Lightning</string>
<string name="google">Google</string>
<string name="settings">瀏覽器設置</string>
<string name="location">允許站點訪問地理位置</string>
<string name="password">保存密碼</string>
<string name="agent">User Agent</string>
<string name="history">清空歷史記錄</string>
<string name="email">郵件開發者</string>
<string name="flash">啟用 Adobe Flash</string>
<string name="mobile">作為移動設備訪問</string>
<string name="desk">作為桌面設備訪問</string>
<string name="custom">自定義 User Agent</string>
<string name="home">首頁</string>
<string name="settingshelp">設置僅將應用於新標簽頁</string>
<string name="fullscreen">啟用全屏模式</string>
<string name="java">啟用 JavaScript</string>
<string name="saveTab">恢復丟失標簽</string>
<string name="settings_title">設置</string>
<string name="download">下載位置</string>
<string name="advanced">高級設置</string>
<string name="source">源碼</string>
<string name="license">許可證</string>
<string name="github">github.com/anthonycr/Lightning-Browser</string>
<string name="apache">Apache License 2.0</string>
<string name="title_activity_new_settings">NewSettings</string>
<string name="action_settings">設置</string>
<string name="version">應用版本</string>
<string name="cache">退出時清理緩存</string>
<string name="reflow">啟用文本重排</string>
<string name="block">屏蔽網頁圖像</string>
<string name="window">允許站點打開新窗口</string>
<string name="cookies">啟用 Cookies</string>
<string name="importbookmarks">從瀏覽器中導入書簽</string>
<string name="size">頁面文本尺寸</string>
<string name="title_activity_advanced_settings">AdvancedSettings</string>
<string name="hello_world">Hello world!</string>
<string name="recommended">(推薦)</string>
<string name="weird_look">(部分網頁可能看起來很奇怪)</string>
<string name="search">搜索引擎</string>
<string name="search_hint">搜索</string>
<string name="wideViewPort">使用寬視圖</string>
<string name="overViewMode">使用概覽模式載入頁面</string>
<string name="restore">啟動時恢復丟失頁面</string>
<string name="menu_history">歷史記錄</string>
<string name="menu_add">添加書簽</string>
<string name="menu_bookmarks">書簽列表</string>
<string name="menu_share">分享頁面</string>
<string name="menu_settings">應用設置</string>
<string name="menu_incognito">隱身標簽</string>
<string name="menu_new_tab">新建標簽</string>
<string name="stock_browser_unavailable">(尚未檢測到原生瀏覽器)</string>
<string name="stock_browser_available">(檢測到已支持的原生瀏覽器)</string>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Lightning</string>
<string name="google">Google</string>
<string name="settings">瀏覽器設置</string>
<string name="location">允許站點訪問地理位置</string>
<string name="password">保存密碼</string>
<string name="agent">User Agent</string>
<string name="history">清空歷史記錄</string>
<string name="email">郵件開發者</string>
<string name="flash">啟用 Adobe Flash</string>
<string name="mobile">作為移動設備訪問</string>
<string name="desk">作為桌面設備訪問</string>
<string name="custom">自定義 User Agent</string>
<string name="home">首頁</string>
<string name="settingshelp">設置僅將應用於新標簽頁</string>
<string name="fullscreen">啟用全屏模式</string>
<string name="java">啟用 JavaScript</string>
<string name="saveTab">恢復丟失標簽</string>
<string name="settings_title">設置</string>
<string name="download">下載位置</string>
<string name="advanced">高級設置</string>
<string name="source">源碼</string>
<string name="license">許可證</string>
<string name="github">github.com/anthonycr/Lightning-Browser</string>
<string name="apache">Apache License 2.0</string>
<string name="title_activity_new_settings">NewSettings</string>
<string name="action_settings">設置</string>
<string name="version">應用版本</string>
<string name="cache">退出時清理緩存</string>
<string name="reflow">啟用文本重排</string>
<string name="block">屏蔽網頁圖像</string>
<string name="window">允許站點打開新窗口</string>
<string name="cookies">啟用 Cookies</string>
<string name="importbookmarks">從瀏覽器中導入書簽</string>
<string name="size">頁面文本尺寸</string>
<string name="title_activity_advanced_settings">AdvancedSettings</string>
<string name="hello_world">Hello world!</string>
<string name="recommended">(推薦)</string>
<string name="weird_look">(部分網頁可能看起來很奇怪)</string>
<string name="search">搜索引擎</string>
<string name="search_hint">搜索</string>
<string name="wideViewPort">使用寬視圖</string>
<string name="overViewMode">使用概覽模式載入頁面</string>
<string name="restore">啟動時恢復丟失頁面</string>
<string name="menu_history">歷史記錄</string>
<string name="menu_add">添加書簽</string>
<string name="menu_bookmarks">書簽列表</string>
<string name="menu_share">分享頁面</string>
<string name="menu_settings">應用設置</string>
<string name="menu_incognito">隱身標簽</string>
<string name="menu_new_tab">新建標簽</string>
<string name="stock_browser_unavailable">(尚未檢測到原生瀏覽器)</string>
<string name="stock_browser_available">(檢測到已支持的原生瀏覽器)</string>
</resources>

94
res/values/strings.xml

@ -1,9 +1,36 @@ @@ -1,9 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2014 A.C.R. Development
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<string name="app_name">Lightning</string>
<string name="drawer_open">Open navigation drawer</string>
<string name="drawer_close">Close navigation drawer</string>
<string name="action_websearch">Web search</string>
<string name="action_refresh">Refresh</string>
<string name="action_new_tab">New Tab</string>
<string name="action_share">Share</string>
<string name="action_history">History</string>
<string name="action_bookmarks">Bookmarks</string>
<string name="action_add_bookmark">Add Bookmark</string>
<string name="action_copy">Copy Link</string>
<string name="action_forward">Forward</string>
<string name="google">Google</string>
<string name="settings">Browser Settings</string>
<string name="settings">Settings</string>
<string name="location">Location Access</string>
<string name="password">Save your passwords</string>
<string name="agent">User Agent</string>
@ -21,6 +48,7 @@ @@ -21,6 +48,7 @@
<string name="settings_title">Settings</string>
<string name="download">Download Location</string>
<string name="advanced">Advanced Settings</string>
<string name="gestures">Enable back and forward gestures</string>
<string name="source">Source Code</string>
<string name="license">License</string>
<string name="github">github.com/anthonycr/Lightning-Browser</string>
@ -35,8 +63,6 @@ @@ -35,8 +63,6 @@
<string name="cookies">Enable Cookies</string>
<string name="importbookmarks">Import bookmarks from Browser</string>
<string name="size">Text size</string>
<string name="title_activity_advanced_settings">AdvancedSettings</string>
<string name="hello_world">Hello world!</string>
<string name="recommended">(Recommended)</string>
<string name="weird_look">(Websites may look weird)</string>
<string name="search">Search Engine</string>
@ -44,17 +70,63 @@ @@ -44,17 +70,63 @@
<string name="wideViewPort">Use wide viewport</string>
<string name="overViewMode">Load pages in overview mode</string>
<string name="restore">Restore lost tabs on start</string>
<string name="menu_history">History</string>
<string name="menu_add">Add bookmark</string>
<string name="menu_bookmarks">Bookmarks</string>
<string name="menu_share">Share</string>
<string name="menu_settings">Settings</string>
<string name="menu_incognito">Incognito tab</string>
<string name="menu_new_tab">New tab</string>
<string name="stock_browser_unavailable">(No stock browser detected)</string>
<string name="stock_browser_available">(Supported stock browser detected)</string>
<string name="fullScreenOption">Hide status bar while browsing</string>
<string name="clear_cookies">Clear browser cookies</string>
<string name="gestures">Enable back and foward gestures</string>
<string name="dialog_image">What would you like to do with this image?</string>
<string name="action_download">Download</string>
<string name="action_open">Open</string>
<string name="dialog_link">What would you like to do with this link?</string>
<string name="dialog_title_share">Share this page</string>
<string name="dialog_bookmark">What would you like to do with this bookmark?</string>
<string name="action_delete">Delete</string>
<string name="action_blank">Blank Page</string>
<string name="agent_default">Default</string>
<string name="agent_desktop">Desktop</string>
<string name="agent_mobile">Mobile</string>
<string name="agent_custom">Custom</string>
<string name="title_search_engine">Search Engine</string>
<string name="action_ok">OK</string>
<string name="dialog_download">Do you want to download this file?</string>
<string name="action_cancel">Cancel</string>
<string name="title_warning">Warning</string>
<string name="dialog_adobe_dead">We\'re sorry, Google made some changes, and Adobe Flash no longer works on Android 4.4+</string>
<string name="dialog_adobe_not_installed">Adobe Flash Player was not detected.\nPlease install Flash Player.</string>
<string name="dialog_adobe_unsupported">Adobe Flash does not support Andoid 4.2 and above, and will crash the browser. Please do not report any crashes that occur if you enable Flash.</string>
<string name="title_user_agent">User Agent</string>
<string name="title_download_location">Download Location</string>
<string name="title_custom_homepage">Custom Homepage</string>
<string name="action_webpage">Webpage</string>
<string name="dialog_reflow_warning">We\'re sorry, Google made some changes, and Text Reflow no longer works on Android 4.4+</string>
<string name="title_clear_history">Clear History</string>
<string name="title_clear_cookies">Clear Cookies</string>
<string name="dialog_history">Would you like to clear all browser history?</string>
<string name="dialog_cookies">Would you like to clear all browser cookies?</string>
<string name="action_yes">Yes</string>
<string name="action_no">No</string>
<string name="title_text_size">Text Size</string>
<string name="size_largest">Largest</string>
<string name="size_large">Large</string>
<string name="size_normal">Normal</string>
<string name="size_small">Small</string>
<string name="size_smallest">Smallest</string>
<string name="title_error">Error</string>
<string name="dialog_import_error">No browser was detected to import bookmarks from.</string>
<string name="hint_title">Title</string>
<string name="hint_url">URL</string>
<string name="title_edit_bookmark">Edit Bookmark</string>
<string name="action_edit">Edit</string>
<string name="action_incognito">New Incognito Tab</string>
<string name="hello_world">Hello world!</string>
<string name="action_homepage">Default</string>
<string name="action_back">Back</string>
<string name="action_find">Find in Page</string>
<string name="download_pending">Starting download\u2026</string>
<string name="cannot_download">Can only download \"http\" or \"https\" URLs.</string>
<string name="download_no_sdcard_dlg_title" >No SD card</string>
<string name="download_no_sdcard_dlg_msg" >USB storage is required to download the file.</string>
<string name="download_sdcard_busy_dlg_title">USB storage unavailable</string>
<string name="download_sdcard_busy_dlg_msg" >The storage is busy. To allow downloads, touch Turn Off USB Storage in the notification.</string>
</resources>

28
src/acr/browser/barebones/activities/AdvancedSettingsActivity.java

@ -422,10 +422,10 @@ public class AdvancedSettingsActivity extends Activity { @@ -422,10 +422,10 @@ public class AdvancedSettingsActivity extends Activity {
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(
AdvancedSettingsActivity.this); // dialog
builder.setTitle("Clear History");
builder.setTitle(CONTEXT.getResources().getString(R.string.title_clear_history));
builder.setMessage(
"Would you like to clear all browser history?")
.setPositiveButton("Yes",
CONTEXT.getResources().getString(R.string.dialog_history))
.setPositiveButton(CONTEXT.getResources().getString(R.string.action_yes),
new DialogInterface.OnClickListener() {
@Override
@ -444,7 +444,7 @@ public class AdvancedSettingsActivity extends Activity { @@ -444,7 +444,7 @@ public class AdvancedSettingsActivity extends Activity {
}
})
.setNegativeButton("No",
.setNegativeButton(CONTEXT.getResources().getString(R.string.action_no),
new DialogInterface.OnClickListener() {
@Override
@ -513,10 +513,10 @@ public class AdvancedSettingsActivity extends Activity { @@ -513,10 +513,10 @@ public class AdvancedSettingsActivity extends Activity {
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(
AdvancedSettingsActivity.this); // dialog
builder.setTitle("Clear Cookies");
builder.setTitle(CONTEXT.getResources().getString(R.string.title_clear_cookies));
builder.setMessage(
"Would you like to clear all browser cookies?")
.setPositiveButton("Yes",
CONTEXT.getResources().getString(R.string.dialog_cookies))
.setPositiveButton(CONTEXT.getResources().getString(R.string.action_yes),
new DialogInterface.OnClickListener() {
@Override
@ -535,7 +535,7 @@ public class AdvancedSettingsActivity extends Activity { @@ -535,7 +535,7 @@ public class AdvancedSettingsActivity extends Activity {
}
})
.setNegativeButton("No",
.setNegativeButton(CONTEXT.getResources().getString(R.string.action_no),
new DialogInterface.OnClickListener() {
@Override
@ -612,8 +612,14 @@ public class AdvancedSettingsActivity extends Activity { @@ -612,8 +612,14 @@ public class AdvancedSettingsActivity extends Activity {
public void onClick(View v) {
AlertDialog.Builder picker = new AlertDialog.Builder(
AdvancedSettingsActivity.this);
picker.setTitle("Text Size");
CharSequence[] chars = { "Largest", "Large", "Normal", "Small", "Smallest"};
picker.setTitle(getResources().getString(
R.string.title_text_size));
CharSequence[] chars = {
getResources().getString(R.string.size_largest),
getResources().getString(R.string.size_large),
getResources().getString(R.string.size_normal),
getResources().getString(R.string.size_small),
getResources().getString(R.string.size_smallest) };
int n = settings.getInt("textsize", 3);
@ -628,7 +634,7 @@ public class AdvancedSettingsActivity extends Activity { @@ -628,7 +634,7 @@ public class AdvancedSettingsActivity extends Activity {
}
});
picker.setNeutralButton("OK",
picker.setNeutralButton(CONTEXT.getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override

133
src/acr/browser/barebones/activities/BrowserActivity.java

@ -168,7 +168,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -168,7 +168,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
public static boolean DEVICE_HAS_GPS = false;
// semi constants
public static Context CONTEXT;
public static Context mContext;
public static String SEARCH;
public static List<Integer> tabList;
@ -250,8 +250,8 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -250,8 +250,8 @@ public class BrowserActivity extends Activity implements OnTouchListener {
currentTabTitle.setPadding(leftPad, 0, rightPad, 0);
}
}
final TextView title = new TextView(CONTEXT);
title.setText("New Tab");
final TextView title = new TextView(mContext);
title.setText(mContext.getResources().getString(R.string.action_new_tab));
if (display) {
if (API < 16) {
title.setBackgroundDrawable(active);
@ -278,7 +278,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -278,7 +278,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
Drawable[] drawables = title.getCompoundDrawables();
bounds = drawables[2].getBounds();
title.setOnTouchListener(ACTIVITY);
Animation holo = AnimationUtils.loadAnimation(CONTEXT, R.anim.up);
Animation holo = AnimationUtils.loadAnimation(mContext, R.anim.up);
tabLayout.addView(title);
title.setVisibility(View.INVISIBLE);
holo.setAnimationListener(new AnimationListener() {
@ -300,7 +300,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -300,7 +300,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
title.startAnimation(holo);
urlTitle[id] = title;
urlTitle[id].setText("New Tab");
urlTitle[id].setText(mContext.getResources().getString(R.string.action_new_tab));
if (theUrl != null) {
main[id] = generateTab(id, theUrl, display);
@ -309,14 +309,14 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -309,14 +309,14 @@ public class BrowserActivity extends Activity implements OnTouchListener {
}
} else {
Utils.showToast(CONTEXT, "Max number of tabs reached");
Utils.showToast(mContext, "Max number of tabs reached");
}
return id;
}
public static void deleteBookmark(String url) {
File book = new File(CONTEXT.getFilesDir(), "bookmarks");
File bookUrl = new File(CONTEXT.getFilesDir(), "bookurl");
File book = new File(mContext.getFilesDir(), "bookmarks");
File bookUrl = new File(mContext.getFilesDir(), "bookurl");
int n = 0;
try {
BufferedWriter bookWriter = new BufferedWriter(new FileWriter(book));
@ -355,7 +355,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -355,7 +355,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
readUrl.close();
} catch (IOException ignored) {
}
openBookmarks(CONTEXT, currentTab);
openBookmarks(mContext, currentTab);
}
public static void generateHistory(final CustomWebView view,
@ -425,7 +425,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -425,7 +425,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
e.printStackTrace();
}
if (uBar.isShown()) {
currentTabTitle.setText("History");
currentTabTitle.setText(mContext.getResources().getString(R.string.menu_history));
setUrlText("");
getUrl.setPadding(tenPad, 0, tenPad, 0);
}
@ -439,7 +439,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -439,7 +439,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
public static CustomWebView generateTab(final int pageToView, String Url,
final boolean display) {
CustomWebView view = new CustomWebView(CONTEXT);
CustomWebView view = new CustomWebView(mContext);
view.setId(pageToView);
view.setWebViewClient(new CustomWebViewClient(ACTIVITY));
view.setWebChromeClient(new CustomChromeClient(ACTIVITY));
@ -459,7 +459,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -459,7 +459,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
}
uBar.bringToFront();
if (Url.contains("about:home")) {
goBookmarks(CONTEXT, view);
goBookmarks(mContext, view);
} else if (Url.contains("about:blank")) {
view.loadUrl("");
} else {
@ -477,15 +477,15 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -477,15 +477,15 @@ public class BrowserActivity extends Activity implements OnTouchListener {
if (view.isShown() && view.canGoBack() && gestures) {
view.goBack();
}
Animation left = AnimationUtils.loadAnimation(CONTEXT, R.anim.left);
Animation left = AnimationUtils.loadAnimation(mContext, R.anim.left);
background.startAnimation(left);
}
static List<Map<String, String>> getBookmarks() {
List<Map<String, String>> bookmarks = new ArrayList<Map<String, String>>();
File bookUrl = new File(CONTEXT.getFilesDir(), "bookurl");
File book = new File(CONTEXT.getFilesDir(), "bookmarks");
File bookUrl = new File(mContext.getFilesDir(), "bookurl");
File book = new File(mContext.getFilesDir(), "bookmarks");
try {
BufferedReader readUrl = new BufferedReader(new FileReader(bookUrl));
BufferedReader readBook = new BufferedReader(new FileReader(book));
@ -532,7 +532,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -532,7 +532,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
if (view.isShown() && view.canGoForward() && gestures) {
view.goForward();
}
Animation right = AnimationUtils.loadAnimation(CONTEXT, R.anim.right);
Animation right = AnimationUtils.loadAnimation(mContext, R.anim.right);
background.startAnimation(right);
}
@ -560,11 +560,11 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -560,11 +560,11 @@ public class BrowserActivity extends Activity implements OnTouchListener {
}
};
AlertDialog.Builder builder = new AlertDialog.Builder(CONTEXT); // dialog
builder.setMessage("What would you like to do with this bookmark?")
.setPositiveButton("Rename", dialogClickListener)
.setNegativeButton("Open", dialogClickListener)
.setNeutralButton("Delete", dialogClickListener).show();
AlertDialog.Builder builder = new AlertDialog.Builder(mContext); // dialog
builder.setMessage(mContext.getResources().getString(R.string.dialog_bookmark))
.setPositiveButton(mContext.getResources().getString(R.string.action_edit), dialogClickListener)
.setNegativeButton(mContext.getResources().getString(R.string.action_open), dialogClickListener)
.setNeutralButton(mContext.getResources().getString(R.string.action_delete), dialogClickListener).show();
}
}
@ -620,7 +620,8 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -620,7 +620,8 @@ public class BrowserActivity extends Activity implements OnTouchListener {
FrameLayout screen = (FrameLayout) ACTIVITY.getWindow().getDecorView();
screen.removeView(fullScreenContainer);
fullScreenContainer = null;
mCustomViewCallback.onCustomViewHidden();
//mCustomViewCallback.onCustomViewHidden();
//apparently causing browser to crash when video ends
ACTIVITY.setRequestedOrientation(orientation);
background.addView(currentTab);
uBar.setVisibility(View.VISIBLE);
@ -636,7 +637,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -636,7 +637,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
}
final HitTestResult result = currentTab.getHitTestResult();
if (currentTab.getUrl().contains(
"file://" + CONTEXT.getFilesDir() + "/bookmarks.html")) {
"file://" + mContext.getFilesDir() + "/bookmarks.html")) {
click = new Message();
click.arg1 = n;
click.setTarget(new ClickHandler());
@ -667,7 +668,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -667,7 +668,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
if (API > 8) {
String url = result.getExtra();
Utils.downloadFile(CONTEXT, url, null, null);
Utils.downloadFile(mContext, url, null, null);
}
break;
@ -677,14 +678,14 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -677,14 +678,14 @@ public class BrowserActivity extends Activity implements OnTouchListener {
};
AlertDialog.Builder builder = new AlertDialog.Builder(
CONTEXT); // dialog
mContext); // dialog
builder.setMessage(
"What would you like to do with this image?")
.setPositiveButton("Open in New Tab",
mContext.getResources().getString(R.string.dialog_image))
.setPositiveButton(mContext.getResources().getString(R.string.action_new_tab),
dialogClickListener)
.setNegativeButton("Open Normally",
.setNegativeButton(mContext.getResources().getString(R.string.action_open),
dialogClickListener)
.setNeutralButton("Download Image",
.setNeutralButton(mContext.getResources().getString(R.string.action_download),
dialogClickListener).show();
} else {
@ -723,15 +724,15 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -723,15 +724,15 @@ public class BrowserActivity extends Activity implements OnTouchListener {
};
AlertDialog.Builder builder = new AlertDialog.Builder(
CONTEXT); // dialog
mContext); // dialog
builder.setTitle(result.getExtra())
.setMessage(
"What do you want to do with this link?")
.setPositiveButton("Open in New Tab",
mContext.getResources().getString(R.string.dialog_link))
.setPositiveButton(mContext.getResources().getString(R.string.action_new_tab),
dialogClickListener)
.setNegativeButton("Open Normally",
.setNegativeButton(mContext.getResources().getString(R.string.action_open),
dialogClickListener)
.setNeutralButton("Copy link", dialogClickListener)
.setNeutralButton(mContext.getResources().getString(R.string.action_copy), dialogClickListener)
.show();
}
}
@ -807,7 +808,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -807,7 +808,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
if (title != null && title.length() != 0) {
urlTitle[numberPage].setText(title);
urlToLoad[numberPage][1] = title;
Utils.updateHistory(CONTEXT, CONTEXT.getContentResolver(),
Utils.updateHistory(mContext, mContext.getContentResolver(),
noStockBrowser, urlToLoad[numberPage][0], title);
}
}
@ -861,10 +862,10 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -861,10 +862,10 @@ public class BrowserActivity extends Activity implements OnTouchListener {
public static void reinitializeSettings() {
int size = tabList.size();
cookieManager = CookieManager.getInstance();
CookieSyncManager.createInstance(CONTEXT);
CookieSyncManager.createInstance(mContext);
cookieManager.setAcceptCookie(settings.getBoolean("cookies", true));
for (int n = 0; n < size; n++) {
main[tabList.get(n)].settingsInitialization(CONTEXT);
main[tabList.get(n)].settingsInitialization(mContext);
}
}
@ -879,20 +880,20 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -879,20 +880,20 @@ public class BrowserActivity extends Activity implements OnTouchListener {
}
}
final AlertDialog.Builder homePicker = new AlertDialog.Builder(CONTEXT);
homePicker.setTitle("Rename Bookmark");
final EditText getText = new EditText(CONTEXT);
final AlertDialog.Builder homePicker = new AlertDialog.Builder(mContext);
homePicker.setTitle(mContext.getResources().getString(R.string.title_edit_bookmark));
final EditText getText = new EditText(mContext);
getText.setText(bTitle[index]);
homePicker.setView(getText);
homePicker.setPositiveButton("OK",
homePicker.setPositiveButton(mContext.getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
bTitle[index] = getText.getText().toString();
File book = new File(CONTEXT.getFilesDir(), "bookmarks");
File bookUrl = new File(CONTEXT.getFilesDir(),
File book = new File(mContext.getFilesDir(), "bookmarks");
File bookUrl = new File(mContext.getFilesDir(),
"bookurl");
int n = 0;
try {
@ -934,7 +935,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -934,7 +935,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
readUrl.close();
} catch (IOException ignored) {
}
openBookmarks(CONTEXT, currentTab);
openBookmarks(mContext, currentTab);
}
});
homePicker.show();
@ -1020,8 +1021,8 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -1020,8 +1021,8 @@ public class BrowserActivity extends Activity implements OnTouchListener {
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareMessage);
// start the chooser for sharing
CONTEXT.startActivity(Intent.createChooser(shareIntent,
"Share this page"));
mContext.startActivity(Intent.createChooser(shareIntent,
mContext.getResources().getString(R.string.dialog_title_share)));
}
public static void toggleFullScreen() {
@ -1140,7 +1141,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -1140,7 +1141,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
case KeyEvent.KEYCODE_ENTER:
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(getUrl.getWindowToken(), 0);
searchTheWeb(getUrl.getText().toString(), CONTEXT);
searchTheWeb(getUrl.getText().toString(), mContext);
return true;
default:
break;
@ -1162,7 +1163,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -1162,7 +1163,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
|| (arg2.getAction() == KeyEvent.KEYCODE_ENTER)) {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(getUrl.getWindowToken(), 0);
searchTheWeb(getUrl.getText().toString(), CONTEXT);
searchTheWeb(getUrl.getText().toString(), mContext);
return true;
}
return false;
@ -1192,7 +1193,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -1192,7 +1193,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
switch (msg.what) {
case 1: {
SimpleAdapter adapter = new SimpleAdapter(CONTEXT, list,
SimpleAdapter adapter = new SimpleAdapter(mContext, list,
R.layout.two_line_autocomplete, new String[] {
"title", "url" }, new int[] { R.id.title,
R.id.url });
@ -1304,7 +1305,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -1304,7 +1305,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
url = ((TextView) arg1.findViewById(R.id.url)).getText()
.toString();
getUrl.setText(url);
searchTheWeb(url, CONTEXT);
searchTheWeb(url, mContext);
url = null;
getUrl.setPadding(tenPad, 0, tenPad, 0);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
@ -1487,7 +1488,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -1487,7 +1488,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
getWindowManager().getDefaultDisplay().getMetrics(metrics);
historyHandler = new DatabaseHandler(this);
cookieManager = CookieManager.getInstance();
CookieSyncManager.createInstance(CONTEXT);
CookieSyncManager.createInstance(mContext);
cookieManager.setAcceptCookie(settings.getBoolean("cookies", true));
progressBar = (ProgressBar) findViewById(R.id.progressBar1);
@ -1554,7 +1555,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -1554,7 +1555,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
// user agent
if (API < 17) {
user = new WebView(CONTEXT).getSettings().getUserAgentString();
user = new WebView(mContext).getSettings().getUserAgentString();
} else {
user = WebSettings.getDefaultUserAgent(this);
}
@ -1761,7 +1762,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -1761,7 +1762,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); // displays main xml layout
CONTEXT = this;
mContext = this;
ACTIVITY = this;
settings = getSharedPreferences("settings", 0);
edit = settings.edit();
@ -1778,7 +1779,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -1778,7 +1779,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
}
try {
LocationManager locationManager = (LocationManager) CONTEXT
LocationManager locationManager = (LocationManager) mContext
.getSystemService(Context.LOCATION_SERVICE);
if (locationManager.getAllProviders().contains(
LocationManager.GPS_PROVIDER)) {
@ -1821,7 +1822,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -1821,7 +1822,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
+ "4. Visit settings and advanced settings to change options\n\n"
+ "5. Long-press on the new tab button to open the last closed tab";
Utils.createInformativeDialog(CONTEXT, "Browser Tips", message);
Utils.createInformativeDialog(mContext, "Browser Tips", message);
edit.putInt("first", 1);
edit.putInt("version", code);
edit.commit();
@ -1937,7 +1938,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -1937,7 +1938,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
if (id >= 0) {
main[id].loadUrl(url);
} else if (download == 1) {
Utils.downloadFile(CONTEXT, url, null, null);
Utils.downloadFile(mContext, url, null, null);
} else if (url != null) {
newTab(url, true);
}
@ -1950,12 +1951,12 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -1950,12 +1951,12 @@ public class BrowserActivity extends Activity implements OnTouchListener {
switch (item.getItemId()) {
case R.id.history:
generateHistory(currentTab, CONTEXT);
generateHistory(currentTab, mContext);
return true;
case R.id.bookmark:
if (urlToLoad[currentId][1] != null) {
if (!urlToLoad[currentId][1].equals("Bookmarks")) {
Utils.addBookmark(CONTEXT, urlToLoad[currentId][1],
Utils.addBookmark(mContext, urlToLoad[currentId][1],
urlToLoad[currentId][0]);
}
}
@ -1965,9 +1966,9 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -1965,9 +1966,9 @@ public class BrowserActivity extends Activity implements OnTouchListener {
return true;
case R.id.allBookmarks:
if (urlToLoad[currentId][1] == null) {
goBookmarks(CONTEXT, currentTab);
goBookmarks(mContext, currentTab);
} else if (!urlToLoad[currentId][1].equals("Bookmarks")) {
goBookmarks(CONTEXT, currentTab);
goBookmarks(mContext, currentTab);
}
return true;
@ -2046,7 +2047,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -2046,7 +2047,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
private boolean xPress;
private Rect edge;
private final GestureDetector mGestureDetector = new GestureDetector(
CONTEXT, new CustomGestureListener());
mContext, new CustomGestureListener());
private class CustomGestureListener extends SimpleOnGestureListener {
@Override
@ -2157,7 +2158,7 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -2157,7 +2158,7 @@ public class BrowserActivity extends Activity implements OnTouchListener {
public void onClick(View v) {
if (API >= 11) {
PopupMenu menu = new PopupMenu(CONTEXT, v);
PopupMenu menu = new PopupMenu(mContext, v);
MenuInflater inflate = menu.getMenuInflater();
inflate.inflate(R.menu.menu, menu.getMenu());
menu.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@ -2167,13 +2168,13 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -2167,13 +2168,13 @@ public class BrowserActivity extends Activity implements OnTouchListener {
switch (item.getItemId()) {
case R.id.history:
generateHistory(currentTab, CONTEXT);
generateHistory(currentTab, mContext);
return true;
case R.id.bookmark:
if (urlToLoad[currentId][1] != null) {
if (!urlToLoad[currentId][1]
.equals("Bookmarks")) {
Utils.addBookmark(CONTEXT,
Utils.addBookmark(mContext,
urlToLoad[currentId][1],
urlToLoad[currentId][0]);
}
@ -2184,10 +2185,10 @@ public class BrowserActivity extends Activity implements OnTouchListener { @@ -2184,10 +2185,10 @@ public class BrowserActivity extends Activity implements OnTouchListener {
return true;
case R.id.allBookmarks:
if (urlToLoad[currentId][1] == null) {
goBookmarks(CONTEXT, currentTab);
goBookmarks(mContext, currentTab);
} else if (!urlToLoad[currentId][1]
.equals("Bookmarks")) {
goBookmarks(CONTEXT, currentTab);
goBookmarks(mContext, currentTab);
}
return true;
case R.id.share:

125
src/acr/browser/barebones/activities/IncognitoModeActivity.java

@ -163,7 +163,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -163,7 +163,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
public static final int API = FinalVariables.API;
public static final String SEPARATOR = "\\|\\$\\|SEPARATOR\\|\\$\\|";
// semi constants
public static Context CONTEXT;
public static Context mContext;
public static String SEARCH;
public static List<Integer> tabList;
@ -242,8 +242,8 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -242,8 +242,8 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
currentTabTitle.setPadding(leftPad, 0, rightPad, 0);
}
}
final TextView title = new TextView(CONTEXT);
title.setText("New Tab");
final TextView title = new TextView(mContext);
title.setText(mContext.getResources().getString(R.string.action_new_tab));
if (display) {
if (API < 16) {
title.setBackgroundDrawable(active);
@ -270,7 +270,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -270,7 +270,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
Drawable[] drawables = title.getCompoundDrawables();
bounds = drawables[2].getBounds();
title.setOnTouchListener(ACTIVITY);
Animation holo = AnimationUtils.loadAnimation(CONTEXT, R.anim.up);
Animation holo = AnimationUtils.loadAnimation(mContext, R.anim.up);
tabLayout.addView(title);
title.setVisibility(View.INVISIBLE);
holo.setAnimationListener(new AnimationListener() {
@ -292,7 +292,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -292,7 +292,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
title.startAnimation(holo);
urlTitle[id] = title;
urlTitle[id].setText("New Tab");
urlTitle[id].setText(mContext.getResources().getString(R.string.action_new_tab));
if (theUrl != null) {
main[id] = generateTab(id, theUrl, display);
@ -301,14 +301,14 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -301,14 +301,14 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
}
} else {
Utils.showToast(CONTEXT, "Max number of tabs reached");
Utils.showToast(mContext, "Max number of tabs reached");
}
return id;
}
public static void deleteBookmark(String url) {
File book = new File(CONTEXT.getFilesDir(), "bookmarks");
File bookUrl = new File(CONTEXT.getFilesDir(), "bookurl");
File book = new File(mContext.getFilesDir(), "bookmarks");
File bookUrl = new File(mContext.getFilesDir(), "bookurl");
int n = 0;
try {
BufferedWriter bookWriter = new BufferedWriter(new FileWriter(book));
@ -347,7 +347,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -347,7 +347,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
readUrl.close();
} catch (IOException ignored) {
}
openBookmarks(CONTEXT, currentTab);
openBookmarks(mContext, currentTab);
}
public static void generateHistory(final IncognitoWebView view,
@ -431,7 +431,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -431,7 +431,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
public static IncognitoWebView generateTab(final int pageToView,
String Url, final boolean display) {
IncognitoWebView view = new IncognitoWebView(CONTEXT);
IncognitoWebView view = new IncognitoWebView(mContext);
view.setId(pageToView);
view.setWebViewClient(new IncognitoWebViewClient(ACTIVITY));
view.setWebChromeClient(new IncognitoChromeClient(ACTIVITY));
@ -451,7 +451,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -451,7 +451,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
}
uBar.bringToFront();
if (Url.contains("about:home")) {
goBookmarks(CONTEXT, view);
goBookmarks(mContext, view);
} else if (Url.contains("about:blank")) {
view.loadUrl("");
} else {
@ -465,7 +465,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -465,7 +465,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
if (view.isShown() && view.canGoBack()) {
view.goBack();
}
Animation left = AnimationUtils.loadAnimation(CONTEXT, R.anim.left);
Animation left = AnimationUtils.loadAnimation(mContext, R.anim.left);
background.startAnimation(left);
}
@ -497,7 +497,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -497,7 +497,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
if (view.isShown() && view.canGoForward()) {
view.goForward();
}
Animation right = AnimationUtils.loadAnimation(CONTEXT, R.anim.right);
Animation right = AnimationUtils.loadAnimation(mContext, R.anim.right);
background.startAnimation(right);
}
@ -525,11 +525,11 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -525,11 +525,11 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
}
};
AlertDialog.Builder builder = new AlertDialog.Builder(CONTEXT); // dialog
builder.setMessage("What would you like to do with this bookmark?")
.setPositiveButton("Rename", dialogClickListener)
.setNegativeButton("Open", dialogClickListener)
.setNeutralButton("Delete", dialogClickListener).show();
AlertDialog.Builder builder = new AlertDialog.Builder(mContext); // dialog
builder.setMessage(mContext.getResources().getString(R.string.dialog_bookmark))
.setPositiveButton(mContext.getResources().getString(R.string.action_edit), dialogClickListener)
.setNegativeButton(mContext.getResources().getString(R.string.action_open), dialogClickListener)
.setNeutralButton(mContext.getResources().getString(R.string.action_delete), dialogClickListener).show();
}
}
@ -585,7 +585,8 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -585,7 +585,8 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
FrameLayout screen = (FrameLayout) ACTIVITY.getWindow().getDecorView();
screen.removeView(fullScreenContainer);
fullScreenContainer = null;
mCustomViewCallback.onCustomViewHidden();
//causing video crashes
//mCustomViewCallback.onCustomViewHidden();
ACTIVITY.setRequestedOrientation(orientation);
background.addView(currentTab);
uBar.setVisibility(View.VISIBLE);
@ -602,7 +603,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -602,7 +603,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
final HitTestResult result = currentTab.getHitTestResult();
if (currentTab.getUrl().contains(
"file://" + CONTEXT.getFilesDir() + "/bookmarks.html")) {
"file://" + mContext.getFilesDir() + "/bookmarks.html")) {
click = new Message();
click.arg1 = n;
click.setTarget(new ClickHandler());
@ -633,7 +634,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -633,7 +634,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
if (API > 8) {
String url = result.getExtra();
Utils.downloadFile(CONTEXT, url, null, null);
Utils.downloadFile(mContext, url, null, null);
}
break;
@ -643,14 +644,14 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -643,14 +644,14 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
};
AlertDialog.Builder builder = new AlertDialog.Builder(
CONTEXT); // dialog
mContext); // dialog
builder.setMessage(
"What would you like to do with this image?")
.setPositiveButton("Open in New Tab",
mContext.getResources().getString(R.string.dialog_image))
.setPositiveButton(mContext.getResources().getString(R.string.action_new_tab),
dialogClickListener)
.setNegativeButton("Open Normally",
.setNegativeButton(mContext.getResources().getString(R.string.action_open),
dialogClickListener)
.setNeutralButton("Download Image",
.setNeutralButton(mContext.getResources().getString(R.string.action_download),
dialogClickListener).show();
} else {
@ -689,15 +690,15 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -689,15 +690,15 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
};
AlertDialog.Builder builder = new AlertDialog.Builder(
CONTEXT); // dialog
mContext); // dialog
builder.setTitle(result.getExtra())
.setMessage(
"What do you want to do with this link?")
.setPositiveButton("Open in New Tab",
mContext.getResources().getString(R.string.dialog_link))
.setPositiveButton(mContext.getResources().getString(R.string.action_new_tab),
dialogClickListener)
.setNegativeButton("Open Normally",
.setNegativeButton(mContext.getResources().getString(R.string.action_open),
dialogClickListener)
.setNeutralButton("Copy link", dialogClickListener)
.setNeutralButton(mContext.getResources().getString(R.string.action_copy), dialogClickListener)
.show();
}
}
@ -825,7 +826,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -825,7 +826,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
public static void reinitializeSettings() {
int size = tabList.size();
for (int n = 0; n < size; n++) {
main[tabList.get(n)].settingsInitialization(CONTEXT);
main[tabList.get(n)].settingsInitialization(mContext);
}
}
@ -840,20 +841,20 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -840,20 +841,20 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
}
}
final AlertDialog.Builder homePicker = new AlertDialog.Builder(CONTEXT);
homePicker.setTitle("Rename Bookmark");
final EditText getText = new EditText(CONTEXT);
final AlertDialog.Builder homePicker = new AlertDialog.Builder(mContext);
homePicker.setTitle(mContext.getResources().getString(R.string.title_edit_bookmark));
final EditText getText = new EditText(mContext);
getText.setText(bTitle[index]);
homePicker.setView(getText);
homePicker.setPositiveButton("OK",
homePicker.setPositiveButton(mContext.getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
bTitle[index] = getText.getText().toString();
File book = new File(CONTEXT.getFilesDir(), "bookmarks");
File bookUrl = new File(CONTEXT.getFilesDir(),
File book = new File(mContext.getFilesDir(), "bookmarks");
File bookUrl = new File(mContext.getFilesDir(),
"bookurl");
int n = 0;
try {
@ -895,7 +896,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -895,7 +896,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
readUrl.close();
} catch (IOException ignored) {
}
openBookmarks(CONTEXT, currentTab);
openBookmarks(mContext, currentTab);
}
});
homePicker.show();
@ -975,8 +976,8 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -975,8 +976,8 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareMessage);
// start the chooser for sharing
CONTEXT.startActivity(Intent.createChooser(shareIntent,
"Share this page"));
mContext.startActivity(Intent.createChooser(shareIntent,
mContext.getResources().getString(R.string.dialog_title_share)));
}
public static void toggleFullScreen() {
@ -1095,7 +1096,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -1095,7 +1096,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
case KeyEvent.KEYCODE_ENTER:
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(getUrl.getWindowToken(), 0);
searchTheWeb(getUrl.getText().toString(), CONTEXT);
searchTheWeb(getUrl.getText().toString(), mContext);
return true;
default:
break;
@ -1117,7 +1118,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -1117,7 +1118,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
|| (arg2.getAction() == KeyEvent.KEYCODE_ENTER)) {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(getUrl.getWindowToken(), 0);
searchTheWeb(getUrl.getText().toString(), CONTEXT);
searchTheWeb(getUrl.getText().toString(), mContext);
return true;
}
return false;
@ -1128,8 +1129,8 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -1128,8 +1129,8 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
static List<Map<String, String>> getBookmarks() {
List<Map<String, String>> bookmarks = new ArrayList<Map<String, String>>();
File bookUrl = new File(CONTEXT.getFilesDir(), "bookurl");
File book = new File(CONTEXT.getFilesDir(), "bookmarks");
File bookUrl = new File(mContext.getFilesDir(), "bookurl");
File book = new File(mContext.getFilesDir(), "bookmarks");
try {
BufferedReader readUrl = new BufferedReader(new FileReader(bookUrl));
BufferedReader readBook = new BufferedReader(new FileReader(book));
@ -1170,7 +1171,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -1170,7 +1171,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
switch (msg.what) {
case 1: {
SimpleAdapter adapter = new SimpleAdapter(CONTEXT, list,
SimpleAdapter adapter = new SimpleAdapter(mContext, list,
R.layout.two_line_autocomplete, new String[] {
"title", "url" }, new int[] { R.id.title,
R.id.url });
@ -1282,7 +1283,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -1282,7 +1283,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
url = ((TextView) arg1.findViewById(R.id.url)).getText()
.toString();
getUrl.setText(url);
searchTheWeb(url, CONTEXT);
searchTheWeb(url, mContext);
url = null;
getUrl.setPadding(tenPad, 0, tenPad, 0);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
@ -1458,7 +1459,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -1458,7 +1459,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
getWindowManager().getDefaultDisplay().getMetrics(metrics);
historyHandler = new DatabaseHandler(this);
cookieManager = CookieManager.getInstance();
CookieSyncManager.createInstance(CONTEXT);
CookieSyncManager.createInstance(mContext);
cookieManager.setAcceptCookie(false);
progressBar = (ProgressBar) findViewById(R.id.progressBar1);
@ -1525,7 +1526,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -1525,7 +1526,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
// user agent
if (API < 17) {
user = new WebView(CONTEXT).getSettings().getUserAgentString();
user = new WebView(mContext).getSettings().getUserAgentString();
} else {
user = WebSettings.getDefaultUserAgent(this);
}
@ -1728,7 +1729,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -1728,7 +1729,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); // displays main xml layout
CONTEXT = this;
mContext = this;
ACTIVITY = this;
settings = getSharedPreferences("settings", 0);
edit = settings.edit();
@ -1760,7 +1761,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -1760,7 +1761,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
+ "disabled to ensure as best we can that you are not being tracked. "
+ "Happy Browsing!";
Utils.createInformativeDialog(CONTEXT, "About Incognito", message);
Utils.createInformativeDialog(mContext, "About Incognito", message);
edit.putInt("first", 1);
edit.commit();
}
@ -1872,7 +1873,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -1872,7 +1873,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
if (id >= 0) {
main[id].loadUrl(url);
} else if (download == 1) {
Utils.downloadFile(CONTEXT, url, null, null);
Utils.downloadFile(mContext, url, null, null);
} else if (url != null) {
newTab(url, true);
}
@ -1885,12 +1886,12 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -1885,12 +1886,12 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
switch (item.getItemId()) {
case R.id.history:
generateHistory(currentTab, CONTEXT);
generateHistory(currentTab, mContext);
return true;
case R.id.bookmark:
if (urlToLoad[currentId][1] != null) {
if (!urlToLoad[currentId][1].equals("Bookmarks")) {
Utils.addBookmark(CONTEXT, urlToLoad[currentId][1],
Utils.addBookmark(mContext, urlToLoad[currentId][1],
urlToLoad[currentId][0]);
}
}
@ -1900,9 +1901,9 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -1900,9 +1901,9 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
return true;
case R.id.allBookmarks:
if (urlToLoad[currentId][1] == null) {
goBookmarks(CONTEXT, currentTab);
goBookmarks(mContext, currentTab);
} else if (!urlToLoad[currentId][1].equals("Bookmarks")) {
goBookmarks(CONTEXT, currentTab);
goBookmarks(mContext, currentTab);
}
return true;
@ -1958,7 +1959,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -1958,7 +1959,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
private Rect edge;
private boolean xPress;
private final GestureDetector mGestureDetector = new GestureDetector(
CONTEXT, new CustomGestureListener());
mContext, new CustomGestureListener());
private class CustomGestureListener extends SimpleOnGestureListener {
@Override
@ -2070,7 +2071,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -2070,7 +2071,7 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
public void onClick(View v) {
if (API >= 11) {
PopupMenu menu = new PopupMenu(CONTEXT, v);
PopupMenu menu = new PopupMenu(mContext, v);
MenuInflater inflate = menu.getMenuInflater();
inflate.inflate(R.menu.incognito_menu, menu.getMenu());
menu.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@ -2080,13 +2081,13 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -2080,13 +2081,13 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
switch (item.getItemId()) {
case R.id.history:
generateHistory(currentTab, CONTEXT);
generateHistory(currentTab, mContext);
return true;
case R.id.bookmark:
if (urlToLoad[currentId][1] != null) {
if (!urlToLoad[currentId][1]
.equals("Bookmarks")) {
Utils.addBookmark(CONTEXT,
Utils.addBookmark(mContext,
urlToLoad[currentId][1],
urlToLoad[currentId][0]);
}
@ -2097,10 +2098,10 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener { @@ -2097,10 +2098,10 @@ public class IncognitoModeActivity extends Activity implements OnTouchListener {
return true;
case R.id.allBookmarks:
if (urlToLoad[currentId][1] == null) {
goBookmarks(CONTEXT, currentTab);
goBookmarks(mContext, currentTab);
} else if (!urlToLoad[currentId][1]
.equals("Bookmarks")) {
goBookmarks(CONTEXT, currentTab);
goBookmarks(mContext, currentTab);
}
return true;
case R.id.share:

185
src/acr/browser/barebones/activities/SettingsActivity.java

@ -35,7 +35,7 @@ import android.widget.TextView; @@ -35,7 +35,7 @@ import android.widget.TextView;
public class SettingsActivity extends Activity {
static int API = FinalVariables.API;
static final String preferences = "settings";
static SharedPreferences.Editor edit;
static SharedPreferences.Editor mEditPrefs;
static int agentChoice;
static String homepage;
static TextView agentText;
@ -63,7 +63,7 @@ public class SettingsActivity extends Activity { @@ -63,7 +63,7 @@ public class SettingsActivity extends Activity {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
edit = settings.edit();
mEditPrefs= settings.edit();
// initialize UI
RelativeLayout layoutLocation = (RelativeLayout) findViewById(R.id.layoutLocation);
@ -131,29 +131,27 @@ public class SettingsActivity extends Activity { @@ -131,29 +131,27 @@ public class SettingsActivity extends Activity {
version.setText(code + "");
if (homepage.contains("about:home")) {
homepageText.setText("Bookmarks");
homepageText.setText(getResources().getString(
R.string.action_homepage));
} else if (homepage.contains("about:blank")) {
homepageText.setText("Blank Page");
homepageText.setText(getResources()
.getString(R.string.action_blank));
} else {
homepageText.setText(homepage);
}
switch (agentChoice) {
case 1:
agentText.setText("Default");
agent = BrowserActivity.defaultUser;
agentText.setText(getResources().getString(R.string.agent_default));
break;
case 2:
agentText.setText("Desktop");
agent = FinalVariables.DESKTOP_USER_AGENT;
agentText.setText(getResources().getString(R.string.agent_desktop));
break;
case 3:
agentText.setText("Mobile");
agent = FinalVariables.MOBILE_USER_AGENT;
agentText.setText(getResources().getString(R.string.agent_mobile));
break;
case 4:
agentText.setText("Custom");
agent = settings.getString("userAgentString", BrowserActivity.defaultUser);
agentText.setText(getResources().getString(R.string.agent_custom));
}
RelativeLayout r1, r2, r3;
r1 = (RelativeLayout) findViewById(R.id.setR1);
@ -226,7 +224,8 @@ public class SettingsActivity extends Activity { @@ -226,7 +224,8 @@ public class SettingsActivity extends Activity {
public void onClick(View v) {
AlertDialog.Builder picker = new AlertDialog.Builder(
SettingsActivity.this);
picker.setTitle("Search Engine");
picker.setTitle(getResources().getString(
R.string.title_search_engine));
CharSequence[] chars = { "Google", "Bing", "Yahoo",
"StartPage", "DuckDuckGo (Privacy)" , "Baidu (Chinese)", "Yandex (Russian)", "DuckDuckGo Lite (Privacy)"};
@ -238,8 +237,8 @@ public class SettingsActivity extends Activity { @@ -238,8 +237,8 @@ public class SettingsActivity extends Activity {
@Override
public void onClick(DialogInterface dialog,
int which) {
edit.putInt("search", which + 1);
edit.commit();
mEditPrefs.putInt("search", which + 1);
mEditPrefs.commit();
switch (which + 1) {
case 1:
searchText.setText("Google");
@ -268,7 +267,7 @@ public class SettingsActivity extends Activity { @@ -268,7 +267,7 @@ public class SettingsActivity extends Activity {
}
}
});
picker.setNeutralButton("OK",
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
@ -365,8 +364,8 @@ public class SettingsActivity extends Activity { @@ -365,8 +364,8 @@ public class SettingsActivity extends Activity {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
edit.putBoolean("location", isChecked);
edit.commit();
mEditPrefs.putBoolean("location", isChecked);
mEditPrefs.commit();
}
@ -380,8 +379,8 @@ public class SettingsActivity extends Activity { @@ -380,8 +379,8 @@ public class SettingsActivity extends Activity {
if (isChecked) {
n = 1;
}
edit.putInt("enableflash", n);
edit.commit();
mEditPrefs.putInt("enableflash", n);
mEditPrefs.commit();
boolean flashInstalled = false;
try {
PackageManager pm = getPackageManager();
@ -393,19 +392,21 @@ public class SettingsActivity extends Activity { @@ -393,19 +392,21 @@ public class SettingsActivity extends Activity {
flashInstalled = false;
}
if (!flashInstalled && isChecked) {
Utils.createInformativeDialog(SettingsActivity.this,
"Warning", "Adobe Flash Player was not detected.\n"
+ "Please install Flash Player.");
Utils.createInformativeDialog(
SettingsActivity.this,
getResources().getString(R.string.title_warning),
getResources().getString(
R.string.dialog_adobe_not_installed));
buttonView.setChecked(false);
edit.putInt("enableflash", 0);
edit.commit();
mEditPrefs.putInt("enableflash", 0);
mEditPrefs.commit();
} else if ((API > 17) && isChecked) {
} else if ((API >= 17) && isChecked) {
Utils.createInformativeDialog(
SettingsActivity.this,
"Warning",
"Adobe Flash does not support Android 4.3 and will "
+ "crash the browser, please do not report crashes that occur if you enable flash.");
getResources().getString(R.string.title_warning),
getResources().getString(
R.string.dialog_adobe_unsupported));
}
}
@ -415,8 +416,8 @@ public class SettingsActivity extends Activity { @@ -415,8 +416,8 @@ public class SettingsActivity extends Activity {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
edit.putBoolean("fullscreen", isChecked);
edit.commit();
mEditPrefs.putBoolean("fullscreen", isChecked);
mEditPrefs.commit();
}
@ -430,8 +431,8 @@ public class SettingsActivity extends Activity { @@ -430,8 +431,8 @@ public class SettingsActivity extends Activity {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
edit.putBoolean("location", isChecked);
edit.commit();
mEditPrefs.putBoolean("location", isChecked);
mEditPrefs.commit();
}
@ -445,8 +446,8 @@ public class SettingsActivity extends Activity { @@ -445,8 +446,8 @@ public class SettingsActivity extends Activity {
if (isChecked) {
n = 1;
}
edit.putInt("enableflash", n);
edit.commit();
mEditPrefs.putInt("enableflash", n);
mEditPrefs.commit();
boolean flashInstalled = false;
try {
PackageManager pm = getPackageManager();
@ -458,19 +459,21 @@ public class SettingsActivity extends Activity { @@ -458,19 +459,21 @@ public class SettingsActivity extends Activity {
flashInstalled = false;
}
if (!flashInstalled && isChecked) {
Utils.createInformativeDialog(SettingsActivity.this,
"Warning", "Adobe Flash Player was not detected.\n"
+ "Please install Flash Player.");
Utils.createInformativeDialog(
SettingsActivity.this,
getResources().getString(R.string.title_warning),
getResources().getString(
R.string.dialog_adobe_not_installed));
buttonView.setChecked(false);
edit.putInt("enableflash", 0);
edit.commit();
mEditPrefs.putInt("enableflash", 0);
mEditPrefs.commit();
} else if ((API > 17) && isChecked) {
Utils.createInformativeDialog(
SettingsActivity.this,
"Warning",
"Adobe Flash does not support Android 4.3 and will "
+ "crash the browser, please do not report crashes that occur if you enable flash.");
getResources().getString(R.string.title_warning),
getResources().getString(
R.string.dialog_adobe_unsupported));
}
}
@ -480,8 +483,8 @@ public class SettingsActivity extends Activity { @@ -480,8 +483,8 @@ public class SettingsActivity extends Activity {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
edit.putBoolean("fullscreen", isChecked);
edit.commit();
mEditPrefs.putBoolean("fullscreen", isChecked);
mEditPrefs.commit();
}
@ -506,8 +509,13 @@ public class SettingsActivity extends Activity { @@ -506,8 +509,13 @@ public class SettingsActivity extends Activity {
public void onClick(View v) {
AlertDialog.Builder agentPicker = new AlertDialog.Builder(
SettingsActivity.this);
agentPicker.setTitle("User Agent");
CharSequence[] chars = { "Default", "Desktop", "Mobile" };
agentPicker.setTitle(getResources().getString(
R.string.title_user_agent));
CharSequence[] chars = {
getResources().getString(R.string.agent_default),
getResources().getString(R.string.agent_desktop),
getResources().getString(R.string.agent_mobile),
getResources().getString(R.string.agent_custom) };
agentChoice = settings.getInt("agentchoose", 1);
agentPicker.setSingleChoiceItems(chars, agentChoice - 1,
new DialogInterface.OnClickListener() {
@ -515,30 +523,31 @@ public class SettingsActivity extends Activity { @@ -515,30 +523,31 @@ public class SettingsActivity extends Activity {
@Override
public void onClick(DialogInterface dialog,
int which) {
edit.putInt("agentchoose", which + 1);
edit.commit();
mEditPrefs.putInt("agentchoose", which + 1);
mEditPrefs.commit();
switch (which + 1) {
case 1:
agentText.setText("Default");
agent = BrowserActivity.defaultUser;
agentText.setText(getResources().getString(
R.string.agent_default));
break;
case 2:
agentText.setText("Desktop");
agent = FinalVariables.DESKTOP_USER_AGENT;
agentText.setText(getResources().getString(
R.string.agent_desktop));
break;
case 3:
agentText.setText("Mobile");
agent = FinalVariables.MOBILE_USER_AGENT;
agentText.setText(getResources().getString(
R.string.agent_mobile));
break;
case 4:
agentText.setText("Custom");
agent = settings.getString("userAgentString", BrowserActivity.defaultUser);
agentText.setText(getResources().getString(
R.string.agent_custom));
agentPicker();
break;
}
}
});
agentPicker.setNeutralButton("OK",
agentPicker.setNeutralButton(
getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
@ -569,18 +578,21 @@ public class SettingsActivity extends Activity { @@ -569,18 +578,21 @@ public class SettingsActivity extends Activity {
final AlertDialog.Builder agentStringPicker = new AlertDialog.Builder(
SettingsActivity.this);
agentStringPicker.setTitle("Custom Agent");
agentStringPicker.setTitle(getResources().getString(
R.string.title_user_agent));
final EditText getAgent = new EditText(SettingsActivity.this);
agentStringPicker.setView(getAgent);
agentStringPicker.setPositiveButton("OK",
agentStringPicker.setPositiveButton(
getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String text = getAgent.getText().toString();
edit.putString("userAgentString", text);
edit.commit();
agentText.setText("Custom");
mEditPrefs.putString("userAgentString", text);
mEditPrefs.commit();
agentText.setText(getResources().getString(
R.string.agent_custom));
}
});
agentStringPicker.show();
@ -594,8 +606,11 @@ public class SettingsActivity extends Activity { @@ -594,8 +606,11 @@ public class SettingsActivity extends Activity {
AlertDialog.Builder picker = new AlertDialog.Builder(
SettingsActivity.this);
picker.setTitle("Download Location");
CharSequence[] chars = { "Default", "Custom" };
picker.setTitle(getResources().getString(
R.string.title_download_location));
CharSequence[] chars = {
getResources().getString(R.string.agent_default),
getResources().getString(R.string.agent_custom) };
downloadLocation = settings.getString("download",
Environment.DIRECTORY_DOWNLOADS);
int n = -1;
@ -614,9 +629,9 @@ public class SettingsActivity extends Activity { @@ -614,9 +629,9 @@ public class SettingsActivity extends Activity {
switch (which + 1) {
case 1:
edit.putString("download",
mEditPrefs.putString("download",
Environment.DIRECTORY_DOWNLOADS);
edit.commit();
mEditPrefs.commit();
download.setText(FinalVariables.EXTERNAL_STORAGE
+ "/"
+ Environment.DIRECTORY_DOWNLOADS);
@ -628,7 +643,8 @@ public class SettingsActivity extends Activity { @@ -628,7 +643,8 @@ public class SettingsActivity extends Activity {
}
}
});
picker.setNeutralButton("OK",
picker.setNeutralButton(
getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
@ -645,8 +661,9 @@ public class SettingsActivity extends Activity { @@ -645,8 +661,9 @@ public class SettingsActivity extends Activity {
public void homePicker() {
final AlertDialog.Builder homePicker = new AlertDialog.Builder(
SettingsActivity.this);
homePicker.setTitle("Custom Homepage");
this);
homePicker.setTitle(getResources().getString(
R.string.title_custom_homepage));
final EditText getHome = new EditText(SettingsActivity.this);
homepage = settings.getString("home", FinalVariables.HOMEPAGE);
if (!homepage.startsWith("about:")) {
@ -655,14 +672,14 @@ public class SettingsActivity extends Activity { @@ -655,14 +672,14 @@ public class SettingsActivity extends Activity {
getHome.setText("http://www.google.com");
}
homePicker.setView(getHome);
homePicker.setPositiveButton("OK",
homePicker.setPositiveButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String text = getHome.getText().toString();
edit.putString("home", text);
edit.commit();
mEditPrefs.putString("home", text);
mEditPrefs.commit();
homepageText.setText(text);
}
});
@ -672,14 +689,15 @@ public class SettingsActivity extends Activity { @@ -672,14 +689,15 @@ public class SettingsActivity extends Activity {
@SuppressWarnings("deprecation")
public void downPicker() {
final AlertDialog.Builder downLocationPicker = new AlertDialog.Builder(
SettingsActivity.this);
this);
LinearLayout layout = new LinearLayout(this);
downLocationPicker.setTitle("Custom Location");
downLocationPicker.setTitle(getResources().getString(
R.string.title_download_location));
final EditText getDownload = new EditText(SettingsActivity.this);
getDownload.setBackgroundResource(0);
downloadLocation = settings.getString("download",
Environment.DIRECTORY_DOWNLOADS);
int padding = Utils.convertDensityPixesl(this, 10);
int padding = Utils.convertDensityPixels(this, 10);
LinearLayout.LayoutParams lparams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
@ -705,14 +723,15 @@ public class SettingsActivity extends Activity { @@ -705,14 +723,15 @@ public class SettingsActivity extends Activity {
android.R.drawable.edit_text));
}
downLocationPicker.setView(layout);
downLocationPicker.setPositiveButton("OK",
downLocationPicker.setPositiveButton(
getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String text = getDownload.getText().toString();
edit.putString("download", text);
edit.commit();
mEditPrefs.putString("download", text);
mEditPrefs.commit();
download.setText(FinalVariables.EXTERNAL_STORAGE + "/"
+ text);
}
@ -748,13 +767,13 @@ public class SettingsActivity extends Activity { @@ -748,13 +767,13 @@ public class SettingsActivity extends Activity {
switch (which + 1) {
case 1:
edit.putString("home", "about:home");
edit.commit();
mEditPrefs.putString("home", "about:home");
mEditPrefs.commit();
homepageText.setText("Bookmarks");
break;
case 2:
edit.putString("home", "about:blank");
edit.commit();
mEditPrefs.putString("home", "about:blank");
mEditPrefs.commit();
homepageText.setText("Blank Page");
break;
case 3:

2
src/acr/browser/barebones/utilities/Utils.java

@ -189,7 +189,7 @@ public class Utils { @@ -189,7 +189,7 @@ public class Utils {
return intent;
}
public static int convertDensityPixesl(Context context, int densityPixels) {
public static int convertDensityPixels(Context context, int densityPixels) {
float scale = context.getResources().getDisplayMetrics().density;
int pixels = (int) (densityPixels * scale + 0.5f);
return pixels;

15
src/acr/browser/barebones/webviewclasses/CustomDownloadListener.java

@ -1,6 +1,5 @@ @@ -1,6 +1,5 @@
package acr.browser.barebones.webviewclasses;
import acr.browser.barebones.activities.BrowserActivity;
import acr.browser.barebones.utilities.Utils;
import android.app.AlertDialog;
import android.content.Context;
@ -10,9 +9,9 @@ import android.net.Uri; @@ -10,9 +9,9 @@ import android.net.Uri;
import android.webkit.DownloadListener;
public class CustomDownloadListener implements DownloadListener {
private static Context context;
public CustomDownloadListener(BrowserActivity activity){
context = activity;
private static Context mContext;
public CustomDownloadListener(Context context){
mContext = context;
}
@ -22,7 +21,7 @@ public class CustomDownloadListener implements DownloadListener { @@ -22,7 +21,7 @@ public class CustomDownloadListener implements DownloadListener {
long contentLength) {
if (url.endsWith(".mp4") || url.endsWith(".m4a")) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder.setTitle("Open as...");
builder.setMessage(
"Do you want to download this video or watch it in an app?")
@ -32,7 +31,7 @@ public class CustomDownloadListener implements DownloadListener { @@ -32,7 +31,7 @@ public class CustomDownloadListener implements DownloadListener {
@Override
public void onClick(DialogInterface dialog,
int id) {
Utils.downloadFile(context, url,
Utils.downloadFile(mContext, url,
contentDisposition, mimetype);
}
})
@ -48,14 +47,14 @@ public class CustomDownloadListener implements DownloadListener { @@ -48,14 +47,14 @@ public class CustomDownloadListener implements DownloadListener {
intent.putExtra(
"acr.browser.barebones.Download",
1);
context.startActivity(intent);
mContext.startActivity(intent);
}
});
AlertDialog alert = builder.create();
alert.show();
} else {
Utils.downloadFile(context, url, contentDisposition, mimetype);
Utils.downloadFile(mContext, url, contentDisposition, mimetype);
}
}

Loading…
Cancel
Save