categories for advanced settings
This commit is contained in:
parent
6589cd454f
commit
c405b626d3
@ -70,6 +70,8 @@
|
|||||||
|
|
||||||
<string name="pref_ui_cat">UI</string>
|
<string name="pref_ui_cat">UI</string>
|
||||||
<string name="pref_misc_cat">Misc</string>
|
<string name="pref_misc_cat">Misc</string>
|
||||||
|
<string name="pref_developer_options_cat">Developer options</string>
|
||||||
|
<string name="pref_tweaks_cat">Tweaks</string>
|
||||||
<string name="pref_plugins">IITC Plugins</string>
|
<string name="pref_plugins">IITC Plugins</string>
|
||||||
<string name="pref_plugins_title">Available plugins</string>
|
<string name="pref_plugins_title">Available plugins</string>
|
||||||
<string name="pref_user_loc">Display user location</string>
|
<string name="pref_user_loc">Display user location</string>
|
||||||
@ -84,7 +86,6 @@
|
|||||||
<string name="pref_force_https_sum">Disabling may improve performance</string>
|
<string name="pref_force_https_sum">Disabling may improve performance</string>
|
||||||
<string name="pref_press_twice_to_exit">Press back button twice to exit</string>
|
<string name="pref_press_twice_to_exit">Press back button twice to exit</string>
|
||||||
<string name="pref_press_twice_to_exit_sum">Avoids accidental exits</string>
|
<string name="pref_press_twice_to_exit_sum">Avoids accidental exits</string>
|
||||||
<string name="pref_developer_options_cat">Developer options</string>
|
|
||||||
<string name="pref_advanced_options">Advanced settings</string>
|
<string name="pref_advanced_options">Advanced settings</string>
|
||||||
<string name="pref_enable_dev_mode">Enable developer mode</string>
|
<string name="pref_enable_dev_mode">Enable developer mode</string>
|
||||||
<string name="pref_enable_dev_mode_sum">If enabled, all IITC sources will be loaded from external storage of the Android device.
|
<string name="pref_enable_dev_mode_sum">If enabled, all IITC sources will be loaded from external storage of the Android device.
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
android:dialogTitle="@string/pref_about_title"/>
|
android:dialogTitle="@string/pref_about_title"/>
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:key="pref_about_cat"
|
android:key="pref_ui_cat"
|
||||||
android:title="@string/pref_ui_cat">
|
android:title="@string/pref_ui_cat">
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="pref_user_loc"
|
android:key="pref_user_loc"
|
||||||
@ -72,13 +72,15 @@
|
|||||||
android:title="@string/pref_advanced_options"
|
android:title="@string/pref_advanced_options"
|
||||||
android:persistent="false">
|
android:persistent="false">
|
||||||
|
|
||||||
<ListPreference
|
<CheckBoxPreference
|
||||||
android:key="pref_caching"
|
android:key="pref_dev_checkbox"
|
||||||
android:title="@string/pref_caching"
|
android:title="@string/pref_enable_dev_mode"
|
||||||
android:summary="@string/pref_caching_sum"
|
android:summary="@string/pref_enable_dev_mode_sum"
|
||||||
android:defaultValue="1"
|
android:defaultValue="false" />
|
||||||
android:entries="@array/pref_caching_array"
|
|
||||||
android:entryValues="@array/pref_caching_array_vals" />
|
<PreferenceCategory
|
||||||
|
android:key="pref_advanced_ui_cat"
|
||||||
|
android:title="@string/pref_ui_cat">
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="pref_advanced_menu"
|
android:key="pref_advanced_menu"
|
||||||
@ -91,11 +93,19 @@
|
|||||||
android:title="@string/pref_disable_splash"
|
android:title="@string/pref_disable_splash"
|
||||||
android:defaultValue="false" />
|
android:defaultValue="false" />
|
||||||
|
|
||||||
<CheckBoxPreference
|
</PreferenceCategory>
|
||||||
android:key="pref_dev_checkbox"
|
|
||||||
android:title="@string/pref_enable_dev_mode"
|
<PreferenceCategory
|
||||||
android:summary="@string/pref_enable_dev_mode_sum"
|
android:key="pref_advanced_tweaks_cat"
|
||||||
android:defaultValue="false" />
|
android:title="@string/pref_tweaks_cat">
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:key="pref_caching"
|
||||||
|
android:title="@string/pref_caching"
|
||||||
|
android:summary="@string/pref_caching_sum"
|
||||||
|
android:defaultValue="1"
|
||||||
|
android:entries="@array/pref_caching_array"
|
||||||
|
android:entryValues="@array/pref_caching_array_vals" />
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="pref_fake_user_agent"
|
android:key="pref_fake_user_agent"
|
||||||
@ -103,6 +113,8 @@
|
|||||||
android:summary="@string/pref_fake_user_agent_sum"
|
android:summary="@string/pref_fake_user_agent_sum"
|
||||||
android:defaultValue="false" />
|
android:defaultValue="false" />
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
|
@ -127,7 +127,7 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
|
|||||||
} else if (key.equals("pref_fake_user_agent")) {
|
} else if (key.equals("pref_fake_user_agent")) {
|
||||||
mIitcWebView.setUserAgent();
|
mIitcWebView.setUserAgent();
|
||||||
} else if (key.equals("pref_caching")) {
|
} else if (key.equals("pref_caching")) {
|
||||||
mIitcWebView.updateCaching();
|
mIitcWebView.updateCaching(false);
|
||||||
} else if (key.equals("pref_press_twice_to_exit")
|
} else if (key.equals("pref_press_twice_to_exit")
|
||||||
|| key.equals("pref_share_selected_tab")
|
|| key.equals("pref_share_selected_tab")
|
||||||
|| key.equals("pref_messages"))
|
|| key.equals("pref_messages"))
|
||||||
@ -271,7 +271,7 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
|
|||||||
|
|
||||||
// enough idle...let's do some work
|
// enough idle...let's do some work
|
||||||
Log.d("iitcm", "resuming...reset idleTimer");
|
Log.d("iitcm", "resuming...reset idleTimer");
|
||||||
mIitcWebView.updateCaching();
|
mIitcWebView.updateCaching(false);
|
||||||
|
|
||||||
if (mIsLocEnabled) {
|
if (mIsLocEnabled) {
|
||||||
// Register the mSharedPrefChangeListener with the Location Manager to receive
|
// Register the mSharedPrefChangeListener with the Location Manager to receive
|
||||||
|
@ -159,7 +159,7 @@ public class IITC_WebView extends WebView {
|
|||||||
return mJsInterface;
|
return mJsInterface;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateCaching() {
|
public void updateCaching(boolean login) {
|
||||||
switch(Integer.parseInt(mSharedPrefs.getString("pref_caching", "1"))) {
|
switch(Integer.parseInt(mSharedPrefs.getString("pref_caching", "1"))) {
|
||||||
case 0:
|
case 0:
|
||||||
mSettings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
|
mSettings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
|
||||||
@ -168,7 +168,6 @@ public class IITC_WebView extends WebView {
|
|||||||
mSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
|
mSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
boolean login = false;
|
|
||||||
if (getUrl() != null) {
|
if (getUrl() != null) {
|
||||||
login = getUrl().contains("accounts.google.com");
|
login = getUrl().contains("accounts.google.com");
|
||||||
}
|
}
|
||||||
|
@ -160,8 +160,8 @@ public class IITC_WebViewClient extends WebViewClient {
|
|||||||
@Override
|
@Override
|
||||||
public void onReceivedLoginRequest(WebView view, String realm, String account, String args) {
|
public void onReceivedLoginRequest(WebView view, String realm, String account, String args) {
|
||||||
Log.d("iitcm", "Login requested: " + realm + " " + account + " " + args);
|
Log.d("iitcm", "Login requested: " + realm + " " + account + " " + args);
|
||||||
Log.d("iitcm", "logging in...set caching mode to default");
|
Log.d("iitcm", "logging in...updating caching mode");
|
||||||
view.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
|
((IITC_WebView) view).updateCaching(true);
|
||||||
//((IITC_Mobile) mContext).onReceivedLoginRequest(this, view, realm, account, args);
|
//((IITC_Mobile) mContext).onReceivedLoginRequest(this, view, realm, account, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,8 +284,8 @@ public class IITC_WebViewClient extends WebViewClient {
|
|||||||
((IITC_Mobile) mContext).loadUrl(url);
|
((IITC_Mobile) mContext).loadUrl(url);
|
||||||
}
|
}
|
||||||
if (url.contains("logout")) {
|
if (url.contains("logout")) {
|
||||||
Log.d("iitcm", "logging out...set caching mode to default");
|
Log.d("iitcm", "logging out...updating caching mode");
|
||||||
view.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
|
((IITC_WebView) view).updateCaching(true);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user