DF1E
10 years ago
5 changed files with 367 additions and 848 deletions
@ -0,0 +1,262 @@
@@ -0,0 +1,262 @@
|
||||
/* |
||||
* Copyright 2014 A.C.R. Development |
||||
*/ |
||||
package acr.browser.lightning.fragment; |
||||
|
||||
import android.app.Activity; |
||||
import android.app.AlertDialog; |
||||
import android.content.DialogInterface; |
||||
import android.content.pm.PackageInfo; |
||||
import android.content.pm.PackageManager; |
||||
import android.os.Bundle; |
||||
import android.preference.CheckBoxPreference; |
||||
import android.preference.Preference; |
||||
import android.preference.PreferenceFragment; |
||||
import android.view.View; |
||||
import android.widget.EditText; |
||||
|
||||
import acr.browser.lightning.R; |
||||
import acr.browser.lightning.constant.Constants; |
||||
import acr.browser.lightning.preference.PreferenceManager; |
||||
import acr.browser.lightning.utils.ProxyUtils; |
||||
import acr.browser.lightning.utils.Utils; |
||||
|
||||
public class SettingsFragment extends PreferenceFragment implements Preference.OnPreferenceClickListener, Preference.OnPreferenceChangeListener { |
||||
|
||||
// TODO: - fix toast on flash cb click
|
||||
// - test proxy settings
|
||||
// - test flash settings
|
||||
|
||||
private Activity mActivity; |
||||
private static final int API = android.os.Build.VERSION.SDK_INT; |
||||
private PreferenceManager mPreferences; |
||||
private CharSequence[] mProxyChoices; |
||||
private Preference proxy, version; |
||||
private CheckBoxPreference cbFlash, cbAds, cbImages, cbJsScript, cbColorMode; |
||||
|
||||
private static final String SETTINGS_PROXY = "proxy"; |
||||
private static final String SETTINGS_FLASH = "cb_flash"; |
||||
private static final String SETTINGS_ADS = "cb_ads"; |
||||
private static final String SETTINGS_IMAGES = "cb_images"; |
||||
private static final String SETTINGS_JAVASCRIPT = "cb_javascript"; |
||||
private static final String SETTINGS_COLORMODE = "cb_colormode"; |
||||
private static final String SETTINGS_VERSION = "pref_version"; |
||||
|
||||
@Override |
||||
public void onCreate(Bundle savedInstanceState) { |
||||
super.onCreate(savedInstanceState); |
||||
// Load the preferences from an XML resource
|
||||
addPreferencesFromResource(R.xml.main_preferences); |
||||
|
||||
mActivity = getActivity(); |
||||
|
||||
initPrefs(); |
||||
} |
||||
|
||||
private void initPrefs() { |
||||
// mPreferences storage
|
||||
mPreferences = PreferenceManager.getInstance(); |
||||
|
||||
proxy = findPreference(SETTINGS_PROXY); |
||||
version = findPreference(SETTINGS_VERSION); |
||||
cbFlash = (CheckBoxPreference) findPreference(SETTINGS_FLASH); |
||||
cbAds = (CheckBoxPreference) findPreference(SETTINGS_ADS); |
||||
cbImages = (CheckBoxPreference) findPreference(SETTINGS_IMAGES); |
||||
cbJsScript = (CheckBoxPreference) findPreference(SETTINGS_JAVASCRIPT); |
||||
cbColorMode = (CheckBoxPreference) findPreference(SETTINGS_COLORMODE); |
||||
|
||||
proxy.setOnPreferenceChangeListener(this); |
||||
cbFlash.setOnPreferenceChangeListener(this); |
||||
cbAds.setOnPreferenceChangeListener(this); |
||||
cbImages.setOnPreferenceChangeListener(this); |
||||
cbJsScript.setOnPreferenceChangeListener(this); |
||||
cbColorMode.setOnPreferenceChangeListener(this); |
||||
|
||||
version.setSummary(getVersion()); |
||||
|
||||
mProxyChoices = getResources().getStringArray(R.array.proxy_choices_array); |
||||
int choice = mPreferences.getProxyChoice(); |
||||
if (choice == Constants.PROXY_MANUAL) { |
||||
proxy.setSummary(mPreferences.getProxyHost() + ":" + mPreferences.getProxyPort()); |
||||
} else { |
||||
proxy.setSummary(mProxyChoices[choice]); |
||||
} |
||||
|
||||
if (API >= 19) { |
||||
mPreferences.setFlashSupport(0); |
||||
} |
||||
|
||||
int flashNum = mPreferences.getFlashSupport(); |
||||
boolean imagesBool = mPreferences.getBlockImagesEnabled(); |
||||
boolean enableJSBool = mPreferences.getJavaScriptEnabled(); |
||||
|
||||
proxy.setEnabled(Constants.FULL_VERSION); |
||||
cbAds.setEnabled(Constants.FULL_VERSION); |
||||
cbFlash.setEnabled(API < 19); |
||||
|
||||
cbImages.setChecked(imagesBool); |
||||
cbJsScript.setChecked(enableJSBool); |
||||
cbFlash.setChecked(flashNum > 0); |
||||
cbAds.setChecked(Constants.FULL_VERSION && mPreferences.getAdBlockEnabled()); |
||||
cbColorMode.setChecked(mPreferences.getColorModeEnabled()); |
||||
} |
||||
|
||||
private void getFlashChoice() { |
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); |
||||
builder.setTitle(mActivity.getResources().getString(R.string.title_flash)); |
||||
builder.setMessage(getResources().getString(R.string.flash)) |
||||
.setCancelable(true) |
||||
.setPositiveButton(getResources().getString(R.string.action_manual), |
||||
new DialogInterface.OnClickListener() { |
||||
@Override |
||||
public void onClick(DialogInterface dialog, int id) { |
||||
mPreferences.setFlashSupport(1); |
||||
} |
||||
}) |
||||
.setNegativeButton(getResources().getString(R.string.action_auto), |
||||
new DialogInterface.OnClickListener() { |
||||
|
||||
@Override |
||||
public void onClick(DialogInterface dialog, int which) { |
||||
mPreferences.setFlashSupport(2); |
||||
} |
||||
}).setOnCancelListener(new DialogInterface.OnCancelListener() { |
||||
|
||||
@Override |
||||
public void onCancel(DialogInterface dialog) { |
||||
mPreferences.setFlashSupport(0); |
||||
} |
||||
|
||||
}); |
||||
AlertDialog alert = builder.create(); |
||||
alert.show(); |
||||
} |
||||
|
||||
private void proxyChoicePicker() { |
||||
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity); |
||||
picker.setTitle(getResources().getString(R.string.http_proxy)); |
||||
picker.setSingleChoiceItems(mProxyChoices, mPreferences.getProxyChoice(), |
||||
new DialogInterface.OnClickListener() { |
||||
|
||||
@Override |
||||
public void onClick(DialogInterface dialog, int which) { |
||||
setProxyChoice(which); |
||||
} |
||||
}); |
||||
picker.setNeutralButton(getResources().getString(R.string.action_ok), |
||||
new DialogInterface.OnClickListener() { |
||||
@Override |
||||
public void onClick(DialogInterface dialog, int which) { |
||||
} |
||||
}); |
||||
picker.show(); |
||||
} |
||||
|
||||
private void setProxyChoice(int choice) { |
||||
ProxyUtils utils = ProxyUtils.getInstance(mActivity); |
||||
switch (choice) { |
||||
case Constants.PROXY_ORBOT: |
||||
choice = utils.setProxyChoice(choice, mActivity); |
||||
break; |
||||
case Constants.PROXY_I2P: |
||||
choice = utils.setProxyChoice(choice, mActivity); |
||||
break; |
||||
case Constants.PROXY_MANUAL: |
||||
manualProxyPicker(); |
||||
break; |
||||
} |
||||
|
||||
mPreferences.setProxyChoice(choice); |
||||
if (choice < mProxyChoices.length) |
||||
proxy.setSummary(mProxyChoices[choice]); |
||||
} |
||||
|
||||
public void manualProxyPicker() { |
||||
View v = mActivity.getLayoutInflater().inflate(R.layout.picker_manual_proxy, null); |
||||
final EditText eProxyHost = (EditText) v.findViewById(R.id.proxyHost); |
||||
final EditText eProxyPort = (EditText) v.findViewById(R.id.proxyPort); |
||||
eProxyHost.setText(mPreferences.getProxyHost()); |
||||
eProxyPort.setText(Integer.toString(mPreferences.getProxyPort())); |
||||
|
||||
new AlertDialog.Builder(mActivity) |
||||
.setTitle(R.string.manual_proxy) |
||||
.setView(v) |
||||
.setPositiveButton(R.string.action_ok, new DialogInterface.OnClickListener() { |
||||
@Override |
||||
public void onClick(DialogInterface dialogInterface, int i) { |
||||
String proxyHost = eProxyHost.getText().toString(); |
||||
int proxyPort = Integer.parseInt(eProxyPort.getText().toString()); |
||||
mPreferences.setProxyHost(proxyHost); |
||||
mPreferences.setProxyPort(proxyPort); |
||||
proxy.setSummary(proxyHost + ":" + proxyPort); |
||||
} |
||||
}) |
||||
.show(); |
||||
} |
||||
|
||||
private String getVersion() { |
||||
try { |
||||
PackageInfo p = mActivity.getPackageManager().getPackageInfo(mActivity.getPackageName(), 0); |
||||
return p.versionName; |
||||
} catch (PackageManager.NameNotFoundException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
return "1.0"; |
||||
} |
||||
|
||||
@Override |
||||
public boolean onPreferenceClick(Preference preference) { |
||||
switch (preference.getKey()) { |
||||
case SETTINGS_PROXY: |
||||
proxyChoicePicker(); |
||||
return true; |
||||
default: |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public boolean onPreferenceChange(Preference preference, Object newValue) { |
||||
// switch preferences
|
||||
switch (preference.getKey()) { |
||||
case SETTINGS_FLASH: |
||||
if (cbFlash.isChecked()) { |
||||
getFlashChoice(); |
||||
} else { |
||||
mPreferences.setFlashSupport(0); |
||||
} |
||||
|
||||
if (!Utils.isFlashInstalled(mActivity) && cbFlash.isChecked()) { |
||||
Utils.createInformativeDialog(mActivity, |
||||
mActivity.getResources().getString(R.string.title_warning), |
||||
mActivity.getResources().getString(R.string.dialog_adobe_not_installed)); |
||||
cbFlash.setEnabled(false); |
||||
mPreferences.setFlashSupport(0); |
||||
} else if ((API >= 17) && cbFlash.isChecked()) { |
||||
Utils.createInformativeDialog(mActivity, |
||||
mActivity.getResources().getString(R.string.title_warning), |
||||
mActivity.getResources().getString(R.string.dialog_adobe_unsupported)); |
||||
} |
||||
cbFlash.setChecked((Boolean) newValue); |
||||
return true; |
||||
case SETTINGS_ADS: |
||||
mPreferences.setAdBlockEnabled((Boolean) newValue); |
||||
cbAds.setChecked((Boolean) newValue); |
||||
return true; |
||||
case SETTINGS_IMAGES: |
||||
mPreferences.setBlockImagesEnabled((Boolean) newValue); |
||||
cbImages.setChecked((Boolean) newValue); |
||||
return true; |
||||
case SETTINGS_JAVASCRIPT: |
||||
mPreferences.setJavaScriptEnabled((Boolean) newValue); |
||||
cbJsScript.setChecked((Boolean) newValue); |
||||
return true; |
||||
case SETTINGS_COLORMODE: |
||||
mPreferences.setColorModeEnabled((Boolean) newValue); |
||||
cbColorMode.setChecked((Boolean) newValue); |
||||
return true; |
||||
default: |
||||
return false; |
||||
} |
||||
} |
||||
} |
@ -1,411 +1,14 @@
@@ -1,411 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:orientation="vertical"> |
||||
|
||||
<include layout="@layout/toolbar_settings" /> |
||||
|
||||
<ScrollView |
||||
android:id="@+id/scrollView1" |
||||
<fragment |
||||
android:name="acr.browser.lightning.fragment.SettingsFragment" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent"> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="vertical"> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/layoutFlash" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="?attr/listChoiceBackgroundIndicator" |
||||
android:minHeight="60dp" |
||||
android:paddingBottom="10dp" |
||||
android:paddingRight="10dp" |
||||
android:paddingTop="10dp"> |
||||
|
||||
<TextView |
||||
android:id="@+id/textView1" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_centerVertical="true" |
||||
android:paddingLeft="16dp" |
||||
android:paddingRight="60dp" |
||||
android:text="@string/flash" |
||||
android:textAppearance="?android:attr/textAppearanceMedium" /> |
||||
|
||||
<CheckBox |
||||
android:id="@+id/cbFlash" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_centerVertical="true" /> |
||||
</RelativeLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="1dp" |
||||
android:layout_marginLeft="10dp" |
||||
android:layout_marginRight="10dp" |
||||
android:background="?attr/dividerColor" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/layoutAdBlock" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="?attr/listChoiceBackgroundIndicator" |
||||
android:minHeight="60dp" |
||||
android:paddingBottom="10dp" |
||||
android:paddingRight="10dp" |
||||
android:paddingTop="10dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_centerVertical="true" |
||||
android:paddingLeft="16dp" |
||||
android:paddingRight="60dp" |
||||
android:text="@string/block_ads" |
||||
android:textAppearance="?android:attr/textAppearanceMedium" /> |
||||
|
||||
<CheckBox |
||||
android:id="@+id/cbAdblock" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_centerVertical="true" /> |
||||
</RelativeLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="1dp" |
||||
android:layout_marginLeft="10dp" |
||||
android:layout_marginRight="10dp" |
||||
android:background="?attr/dividerColor" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/layoutImages" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="?attr/listChoiceBackgroundIndicator" |
||||
android:minHeight="60dp" |
||||
android:paddingBottom="10dp" |
||||
android:paddingRight="10dp" |
||||
android:paddingTop="10dp"> |
||||
|
||||
<TextView |
||||
android:id="@+id/textView2" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_centerVertical="true" |
||||
android:paddingLeft="16dp" |
||||
android:paddingRight="60dp" |
||||
android:text="@string/block" |
||||
android:textAppearance="?android:attr/textAppearanceMedium" /> |
||||
|
||||
<CheckBox |
||||
android:id="@+id/cbImageBlock" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_centerVertical="true" /> |
||||
</RelativeLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="1dp" |
||||
android:layout_marginLeft="10dp" |
||||
android:layout_marginRight="10dp" |
||||
android:background="?attr/dividerColor" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/layoutEnableJS" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="?attr/listChoiceBackgroundIndicator" |
||||
android:minHeight="60dp" |
||||
android:paddingBottom="10dp" |
||||
android:paddingRight="10dp" |
||||
android:paddingTop="10dp"> |
||||
|
||||
<TextView |
||||
android:id="@+id/textView3" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_centerVertical="true" |
||||
android:paddingLeft="16dp" |
||||
android:paddingRight="60dp" |
||||
android:text="@string/java" |
||||
android:textAppearance="?android:attr/textAppearanceMedium" /> |
||||
|
||||
<CheckBox |
||||
android:id="@+id/cbJavascript" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_centerVertical="true" /> |
||||
</RelativeLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="1dp" |
||||
android:layout_marginLeft="10dp" |
||||
android:layout_marginRight="10dp" |
||||
android:background="?attr/dividerColor" /> |
||||
|
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/layoutColorMode" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="?attr/listChoiceBackgroundIndicator" |
||||
android:minHeight="60dp" |
||||
android:paddingBottom="10dp" |
||||
android:paddingRight="10dp" |
||||
android:paddingTop="10dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_centerVertical="true" |
||||
android:paddingLeft="16dp" |
||||
android:paddingRight="60dp" |
||||
android:text="@string/color_mode" |
||||
android:textAppearance="?android:attr/textAppearanceMedium" /> |
||||
|
||||
<CheckBox |
||||
android:id="@+id/cbColorMode" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_centerVertical="true" /> |
||||
</RelativeLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="1dp" |
||||
android:layout_marginLeft="10dp" |
||||
android:layout_marginRight="10dp" |
||||
android:background="?attr/dividerColor" /> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/layoutProxyChoice" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="?attr/listChoiceBackgroundIndicator" |
||||
android:minHeight="60dp" |
||||
android:orientation="vertical" |
||||
android:paddingBottom="10dp" |
||||
android:paddingTop="10dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:paddingLeft="16dp" |
||||
android:text="@string/http_proxy" |
||||
android:textAppearance="?android:attr/textAppearanceMedium" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/proxyChoiceName" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:paddingLeft="16dp" |
||||
android:textAppearance="?android:attr/textAppearanceSmall" |
||||
android:textColor="@color/light" |
||||
tools:text="Disabled" /> |
||||
</LinearLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="1dp" |
||||
android:layout_marginLeft="10dp" |
||||
android:layout_marginRight="10dp" |
||||
android:background="?attr/dividerColor" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/layoutGeneral" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="?attr/listChoiceBackgroundIndicator" |
||||
android:minHeight="60dp" |
||||
android:paddingBottom="10dp" |
||||
android:paddingTop="10dp"> |
||||
|
||||
<TextView |
||||
android:id="@+id/textView7" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_centerVertical="true" |
||||
android:paddingLeft="16dp" |
||||
android:text="@string/settings_general" |
||||
android:textAppearance="?android:attr/textAppearanceMedium" /> |
||||
</RelativeLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="1dp" |
||||
android:layout_marginLeft="10dp" |
||||
android:layout_marginRight="10dp" |
||||
android:background="?attr/dividerColor" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/layoutBookmarks" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="?attr/listChoiceBackgroundIndicator" |
||||
android:minHeight="60dp" |
||||
android:paddingBottom="10dp" |
||||
android:paddingTop="10dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_centerVertical="true" |
||||
android:paddingLeft="16dp" |
||||
android:text="@string/bookmark_settings" |
||||
android:textAppearance="?android:attr/textAppearanceMedium" /> |
||||
</RelativeLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="1dp" |
||||
android:layout_marginLeft="10dp" |
||||
android:layout_marginRight="10dp" |
||||
android:background="?attr/dividerColor" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/layoutDisplay" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="?attr/listChoiceBackgroundIndicator" |
||||
android:minHeight="60dp" |
||||
android:paddingBottom="10dp" |
||||
android:paddingTop="10dp"> |
||||
|
||||
<TextView |
||||
android:id="@+id/textView8" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_centerVertical="true" |
||||
android:paddingLeft="16dp" |
||||
android:text="@string/settings_display" |
||||
android:textAppearance="?android:attr/textAppearanceMedium" /> |
||||
</RelativeLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="1dp" |
||||
android:layout_marginLeft="10dp" |
||||
android:layout_marginRight="10dp" |
||||
android:background="?attr/dividerColor" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/layoutPrivacy" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="?attr/listChoiceBackgroundIndicator" |
||||
android:minHeight="60dp" |
||||
android:paddingBottom="10dp" |
||||
android:paddingTop="10dp"> |
||||
|
||||
<TextView |
||||
android:id="@+id/textView9" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_centerVertical="true" |
||||
android:paddingLeft="16dp" |
||||
android:text="@string/settings_privacy" |
||||
android:textAppearance="?android:attr/textAppearanceMedium" /> |
||||
</RelativeLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="1dp" |
||||
android:layout_marginLeft="10dp" |
||||
android:layout_marginRight="10dp" |
||||
android:background="?attr/dividerColor" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/layoutAdvanced" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="?attr/listChoiceBackgroundIndicator" |
||||
android:minHeight="60dp" |
||||
android:paddingBottom="10dp" |
||||
android:paddingTop="10dp"> |
||||
|
||||
<TextView |
||||
android:id="@+id/textView10" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_centerVertical="true" |
||||
android:paddingLeft="16dp" |
||||
android:text="@string/settings_advanced" |
||||
android:textAppearance="?android:attr/textAppearanceMedium" /> |
||||
</RelativeLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="1dp" |
||||
android:layout_marginLeft="10dp" |
||||
android:layout_marginRight="10dp" |
||||
android:background="?attr/dividerColor" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/layoutAbout" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="?attr/listChoiceBackgroundIndicator" |
||||
android:minHeight="60dp" |
||||
android:paddingBottom="10dp" |
||||
android:paddingTop="10dp"> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_centerVertical="true" |
||||
android:orientation="vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/textView11" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:paddingLeft="16dp" |
||||
android:text="@string/settings_about" |
||||
android:textAppearance="?android:attr/textAppearanceMedium" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/isImportAvailable" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:paddingLeft="16dp" |
||||
android:text="@string/settings_about_explain" |
||||
android:textAppearance="?android:attr/textAppearanceSmall" |
||||
android:textColor="@color/light" /> |
||||
</LinearLayout> |
||||
</RelativeLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="1dp" |
||||
android:layout_marginLeft="10dp" |
||||
android:layout_marginRight="10dp" |
||||
android:background="?attr/dividerColor" /> |
||||
</LinearLayout> |
||||
</ScrollView> |
||||
|
||||
android:layout_height="match_parent" |
||||
android:tag="settingsFragment" /> |
||||
</LinearLayout> |
@ -0,0 +1,74 @@
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
|
||||
<PreferenceCategory android:title="@string/settings"> |
||||
<CheckBoxPreference |
||||
android:defaultValue="false" |
||||
android:key="cb_flash" |
||||
android:title="@string/flash" /> |
||||
<CheckBoxPreference |
||||
android:defaultValue="false" |
||||
android:key="cb_ads" |
||||
android:title="@string/block_ads" /> |
||||
<CheckBoxPreference |
||||
android:defaultValue="false" |
||||
android:key="cb_images" |
||||
android:title="@string/block" /> |
||||
<CheckBoxPreference |
||||
android:defaultValue="true" |
||||
android:key="cb_javascript" |
||||
android:title="@string/java" /> |
||||
<Preference |
||||
android:key="proxy" |
||||
android:title="@string/http_proxy" /> |
||||
<CheckBoxPreference |
||||
android:defaultValue="true" |
||||
android:key="cb_colormode" |
||||
android:title="@string/color_mode" /> |
||||
</PreferenceCategory> |
||||
<Preference android:title="@string/settings_general"> |
||||
<intent |
||||
android:targetPackage="acr.browser.lightning" |
||||
android:targetClass="acr.browser.lightning.activity.GeneralSettingsActivity" /> |
||||
</Preference> |
||||
<Preference android:title="@string/bookmark_settings"> |
||||
<intent |
||||
android:targetPackage="acr.browser.lightning" |
||||
android:targetClass="acr.browser.lightning.activity.BookmarkSettingsActivity" /> |
||||
</Preference> |
||||
<Preference android:title="@string/settings_display"> |
||||
<intent |
||||
android:targetPackage="acr.browser.lightning" |
||||
android:targetClass="acr.browser.lightning.activity.DisplaySettingsActivity" /> |
||||
</Preference> |
||||
<Preference android:title="@string/settings_privacy"> |
||||
<intent |
||||
android:targetPackage="acr.browser.lightning" |
||||
android:targetClass="acr.browser.lightning.activity.PrivacySettingsActivity" /> |
||||
</Preference> |
||||
<Preference android:title="@string/settings_advanced"> |
||||
<intent |
||||
android:targetPackage="acr.browser.lightning" |
||||
android:targetClass="acr.browser.lightning.activity.AdvancedSettingsActivity" /> |
||||
</Preference> |
||||
<PreferenceScreen |
||||
android:title="@string/settings_about" |
||||
android:summary="@string/settings_about_explain" |
||||
android:persistent="false"> |
||||
<Preference |
||||
android:title="@string/action_follow_me" |
||||
android:summary="@string/url_twitter"> |
||||
<intent |
||||
android:action="android.intent.action.VIEW" |
||||
android:data="http://twitter.com/RestainoAnthony" /> |
||||
</Preference> |
||||
<Preference android:title="@string/licenses"> |
||||
<intent |
||||
android:targetPackage="acr.browser.lightning" |
||||
android:targetClass="acr.browser.lightning.activity.LicenseActivity" /> |
||||
</Preference> |
||||
<Preference |
||||
android:title="@string/version" |
||||
android:key="pref_version" /> |
||||
</PreferenceScreen> |
||||
</PreferenceScreen> |
Loading…
Reference in new issue