Browse Source

new Settings 2/3

master
DF1E 10 years ago
parent
commit
2127863465
  1. 13
      app/src/main/AndroidManifest.xml
  2. 214
      app/src/main/java/acr/browser/lightning/activity/DisplaySettingsActivity.java
  3. 2
      app/src/main/java/acr/browser/lightning/activity/ThemableSettingsActivity.java
  4. 13
      app/src/main/java/acr/browser/lightning/fragment/AdvancedSettingsFragment.java
  5. 158
      app/src/main/java/acr/browser/lightning/fragment/DisplaySettingsFragment.java
  6. 14
      app/src/main/java/acr/browser/lightning/fragment/PrivacySettingsFragment.java
  7. 301
      app/src/main/res/layout/display_settings.xml
  8. 25
      app/src/main/res/xml/preference_advanced.xml
  9. 29
      app/src/main/res/xml/preference_display.xml
  10. 5
      app/src/main/res/xml/preference_general.xml
  11. 39
      app/src/main/res/xml/preference_privacy.xml

13
app/src/main/AndroidManifest.xml

@ -56,8 +56,6 @@ @@ -56,8 +56,6 @@
<!--
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" />
@ -118,17 +116,6 @@ @@ -118,17 +116,6 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activity.DisplaySettingsActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/settings_display"
android:theme="@style/Theme.SettingsTheme" >
<intent-filter>
<action android:name="android.intent.action.DISPLAY_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activity.PrivacySettingsActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"

214
app/src/main/java/acr/browser/lightning/activity/DisplaySettingsActivity.java

@ -1,214 +0,0 @@ @@ -1,214 +0,0 @@
/*
* Copyright 2014 A.C.R. Development
*/
package acr.browser.lightning.activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.RelativeLayout;
import android.widget.TextView;
import acr.browser.lightning.preference.PreferenceManager;
import acr.browser.lightning.R;
public class DisplaySettingsActivity extends ThemableSettingsActivity {
// mPreferences variables
private PreferenceManager mPreferences;
private CheckBox cbHideStatusBar, cbFullScreen, cbWideViewPort, cbOverView, cbTextReflow;
private String[] mThemeOptions;
private TextView mThemeText;
private int mCurrentTheme;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.display_settings);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mPreferences = PreferenceManager.getInstance();
mThemeOptions = this.getResources().getStringArray(R.array.themes);
initialize();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
finish();
return true;
}
private void initialize() {
RelativeLayout rHideStatusBar, rFullScreen, rWideViewPort, rOverView, rTextReflow, rTextSize, rDarkTheme;
LayoutClickListener clickListener = new LayoutClickListener();
CheckBoxToggleListener toggleListener = new CheckBoxToggleListener();
rHideStatusBar = (RelativeLayout) findViewById(R.id.rHideStatusBar);
rFullScreen = (RelativeLayout) findViewById(R.id.rFullScreen);
rWideViewPort = (RelativeLayout) findViewById(R.id.rWideViewPort);
rOverView = (RelativeLayout) findViewById(R.id.rOverView);
rTextReflow = (RelativeLayout) findViewById(R.id.rTextReflow);
rTextSize = (RelativeLayout) findViewById(R.id.rTextSize);
rDarkTheme = (RelativeLayout) findViewById(R.id.rTheme);
rHideStatusBar.setOnClickListener(clickListener);
rFullScreen.setOnClickListener(clickListener);
rWideViewPort.setOnClickListener(clickListener);
rOverView.setOnClickListener(clickListener);
rTextReflow.setOnClickListener(clickListener);
rTextSize.setOnClickListener(clickListener);
rDarkTheme.setOnClickListener(clickListener);
mThemeText = (TextView) findViewById(R.id.textViewTheme);
mCurrentTheme = mPreferences.getUseTheme();
mThemeText.setText(mThemeOptions[mPreferences.getUseTheme()]);
cbHideStatusBar = (CheckBox) findViewById(R.id.cbHideStatusBar);
cbFullScreen = (CheckBox) findViewById(R.id.cbFullScreen);
cbWideViewPort = (CheckBox) findViewById(R.id.cbWideViewPort);
cbOverView = (CheckBox) findViewById(R.id.cbOverView);
cbTextReflow = (CheckBox) findViewById(R.id.cbTextReflow);
cbHideStatusBar.setChecked(mPreferences.getHideStatusBarEnabled());
cbFullScreen.setChecked(mPreferences.getFullScreenEnabled());
cbWideViewPort.setChecked(mPreferences.getUseWideViewportEnabled());
cbOverView.setChecked(mPreferences.getOverviewModeEnabled());
cbTextReflow.setChecked(mPreferences.getTextReflowEnabled());
cbHideStatusBar.setOnCheckedChangeListener(toggleListener);
cbFullScreen.setOnCheckedChangeListener(toggleListener);
cbWideViewPort.setOnCheckedChangeListener(toggleListener);
cbOverView.setOnCheckedChangeListener(toggleListener);
cbTextReflow.setOnCheckedChangeListener(toggleListener);
}
private class LayoutClickListener implements OnClickListener {
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.rHideStatusBar:
cbHideStatusBar.setChecked(!cbHideStatusBar.isChecked());
break;
case R.id.rFullScreen:
cbFullScreen.setChecked(!cbFullScreen.isChecked());
break;
case R.id.rWideViewPort:
cbWideViewPort.setChecked(!cbWideViewPort.isChecked());
break;
case R.id.rOverView:
cbOverView.setChecked(!cbOverView.isChecked());
break;
case R.id.rTextReflow:
cbTextReflow.setChecked(!cbTextReflow.isChecked());
break;
case R.id.rTextSize:
textSizePicker();
break;
case R.id.rTheme:
themePicker();
break;
}
}
}
private class CheckBoxToggleListener implements OnCheckedChangeListener {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
switch (buttonView.getId()) {
case R.id.cbHideStatusBar:
mPreferences.setHideStatusBarEnabled(isChecked);
break;
case R.id.cbFullScreen:
mPreferences.setFullScreenEnabled(isChecked);
break;
case R.id.cbWideViewPort:
mPreferences.setUseWideViewportEnabled(isChecked);
break;
case R.id.cbOverView:
mPreferences.setOverviewModeEnabled(isChecked);
break;
case R.id.cbTextReflow:
mPreferences.setTextReflowEnabled(isChecked);
break;
}
}
}
private void textSizePicker() {
AlertDialog.Builder picker = new AlertDialog.Builder(DisplaySettingsActivity.this);
picker.setTitle(getResources().getString(R.string.title_text_size));
int n = mPreferences.getTextSize();
picker.setSingleChoiceItems(R.array.text_size, n - 1,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mPreferences.setTextSize(which + 1);
}
});
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
picker.show();
}
private void themePicker() {
AlertDialog.Builder picker = new AlertDialog.Builder(DisplaySettingsActivity.this);
picker.setTitle(getResources().getString(R.string.url_contents));
int n = mPreferences.getUseTheme();
picker.setSingleChoiceItems(mThemeOptions, n, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mPreferences.setUseTheme(which);
if (which < mThemeOptions.length) {
mThemeText.setText(mThemeOptions[which]);
}
}
});
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (mCurrentTheme != mPreferences.getUseTheme()) {
restart();
}
}
});
picker.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
if (mCurrentTheme != mPreferences.getUseTheme()) {
restart();
}
}
});
picker.show();
}
}

2
app/src/main/java/acr/browser/lightning/activity/ThemableSettingsActivity.java

@ -33,7 +33,7 @@ public abstract class ThemableSettingsActivity extends AppCompatPreferenceActivi @@ -33,7 +33,7 @@ public abstract class ThemableSettingsActivity extends AppCompatPreferenceActivi
}
}
protected void restart() {
public void restart() {
final Bundle outState = new Bundle();
onSaveInstanceState(outState);
final Intent intent = new Intent(this, getClass());

13
app/src/main/java/acr/browser/lightning/fragment/AdvancedSettingsFragment.java

@ -5,13 +5,19 @@ package acr.browser.lightning.fragment; @@ -5,13 +5,19 @@ package acr.browser.lightning.fragment;
import android.app.Activity;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import acr.browser.lightning.R;
import acr.browser.lightning.preference.PreferenceManager;
public class AdvancedSettingsFragment extends PreferenceFragment {
private Activity mActivity;
private PreferenceManager mPreferences;
private CheckBoxPreference newwindow, enablecookies, cookieInkognito, restoreTabs;
private Preference renderingmode, urlcontent;
@Override
public void onCreate(Bundle savedInstanceState) {
@ -20,5 +26,12 @@ public class AdvancedSettingsFragment extends PreferenceFragment { @@ -20,5 +26,12 @@ public class AdvancedSettingsFragment extends PreferenceFragment {
addPreferencesFromResource(R.xml.preference_advanced);
mActivity = getActivity();
initPrefs();
}
private void initPrefs() {
// mPreferences storage
mPreferences = PreferenceManager.getInstance();
}
}

158
app/src/main/java/acr/browser/lightning/fragment/DisplaySettingsFragment.java

@ -4,14 +4,33 @@ @@ -4,14 +4,33 @@
package acr.browser.lightning.fragment;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import acr.browser.lightning.R;
import acr.browser.lightning.activity.SettingsActivity;
import acr.browser.lightning.preference.PreferenceManager;
public class DisplaySettingsFragment extends PreferenceFragment {
public class DisplaySettingsFragment extends PreferenceFragment implements Preference.OnPreferenceClickListener, Preference.OnPreferenceChangeListener {
private static final String SETTINGS_HIDESTATUSBAR = "fullScreenOption";
private static final String SETTINGS_FULLSCREEN = "fullscreen";
private static final String SETTINGS_VIEWPORT = "wideViewPort";
private static final String SETTINGS_OVERVIEWMODE = "overViewMode";
private static final String SETTINGS_REFLOW = "text_reflow";
private static final String SETTINGS_THEME = "app_theme";
private static final String SETTINGS_TEXTSIZE = "text_size";
private Activity mActivity;
private PreferenceManager mPreferences;
private CheckBoxPreference cbstatus, cbfullscreen, cbviewport, cboverview, cbreflow;
private Preference theme, textsize;
private String[] mThemeOptions;
private int mCurrentTheme;
@Override
public void onCreate(Bundle savedInstanceState) {
@ -20,5 +39,142 @@ public class DisplaySettingsFragment extends PreferenceFragment { @@ -20,5 +39,142 @@ public class DisplaySettingsFragment extends PreferenceFragment {
addPreferencesFromResource(R.xml.preference_display);
mActivity = getActivity();
initPrefs();
}
private void initPrefs() {
// mPreferences storage
mPreferences = PreferenceManager.getInstance();
mThemeOptions = this.getResources().getStringArray(R.array.themes);
mCurrentTheme = mPreferences.getUseTheme();
theme = findPreference(SETTINGS_THEME);
textsize = findPreference(SETTINGS_TEXTSIZE);
cbstatus = (CheckBoxPreference) findPreference(SETTINGS_HIDESTATUSBAR);
cbfullscreen = (CheckBoxPreference) findPreference(SETTINGS_FULLSCREEN);
cbviewport = (CheckBoxPreference) findPreference(SETTINGS_VIEWPORT);
cboverview = (CheckBoxPreference) findPreference(SETTINGS_OVERVIEWMODE);
cbreflow = (CheckBoxPreference) findPreference(SETTINGS_REFLOW);
theme.setOnPreferenceClickListener(this);
textsize.setOnPreferenceClickListener(this);
cbstatus.setOnPreferenceChangeListener(this);
cbfullscreen.setOnPreferenceChangeListener(this);
cbviewport.setOnPreferenceChangeListener(this);
cboverview.setOnPreferenceChangeListener(this);
cbreflow.setOnPreferenceChangeListener(this);
cbstatus.setChecked(mPreferences.getHideStatusBarEnabled());
cbfullscreen.setChecked(mPreferences.getFullScreenEnabled());
cbviewport.setChecked(mPreferences.getUseWideViewportEnabled());
cboverview.setChecked(mPreferences.getOverviewModeEnabled());
cbreflow.setChecked(mPreferences.getTextReflowEnabled());
theme.setSummary(mThemeOptions[mPreferences.getUseTheme()]);
}
@Override
public boolean onPreferenceClick(Preference preference) {
switch (preference.getKey()) {
case SETTINGS_THEME:
themePicker();
return true;
case SETTINGS_TEXTSIZE:
textSizePicker();
return true;
default:
return false;
}
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
// switch preferences
switch (preference.getKey()) {
case SETTINGS_HIDESTATUSBAR:
mPreferences.setHideStatusBarEnabled((Boolean) newValue);
cbstatus.setChecked((Boolean) newValue);
return true;
case SETTINGS_FULLSCREEN:
mPreferences.setFullScreenEnabled((Boolean) newValue);
cbfullscreen.setChecked((Boolean) newValue);
return true;
case SETTINGS_VIEWPORT:
mPreferences.setUseWideViewportEnabled((Boolean) newValue);
cbviewport.setChecked((Boolean) newValue);
return true;
case SETTINGS_OVERVIEWMODE:
mPreferences.setOverviewModeEnabled((Boolean) newValue);
cboverview.setChecked((Boolean) newValue);
return true;
case SETTINGS_REFLOW:
mPreferences.setTextReflowEnabled((Boolean) newValue);
cbreflow.setChecked((Boolean) newValue);
return true;
default:
return false;
}
}
private void textSizePicker() {
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
picker.setTitle(getResources().getString(R.string.title_text_size));
int n = mPreferences.getTextSize();
picker.setSingleChoiceItems(R.array.text_size, n - 1,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mPreferences.setTextSize(which + 1);
}
});
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
picker.show();
}
private void themePicker() {
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
picker.setTitle(getResources().getString(R.string.url_contents));
int n = mPreferences.getUseTheme();
picker.setSingleChoiceItems(mThemeOptions, n, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mPreferences.setUseTheme(which);
if (which < mThemeOptions.length) {
theme.setSummary(mThemeOptions[which]);
}
}
});
picker.setNeutralButton(getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (mCurrentTheme != mPreferences.getUseTheme()) {
((SettingsActivity) getActivity()).restart();
}
}
});
picker.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
if (mCurrentTheme != mPreferences.getUseTheme()) {
((SettingsActivity) getActivity()).restart();
}
}
});
picker.show();
}
}

14
app/src/main/java/acr/browser/lightning/fragment/PrivacySettingsFragment.java

@ -5,13 +5,20 @@ package acr.browser.lightning.fragment; @@ -5,13 +5,20 @@ package acr.browser.lightning.fragment;
import android.app.Activity;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import acr.browser.lightning.R;
import acr.browser.lightning.preference.PreferenceManager;
public class PrivacySettingsFragment extends PreferenceFragment {
private Activity mActivity;
private PreferenceManager mPreferences;
private CheckBoxPreference cblocation, cb3cookies, cbsavepasswords, cbcacheexit, cbhistoryexit,
cbcookiesexit, synchistory;
private Preference clearcache, clearhistory, clearcookies;
@Override
public void onCreate(Bundle savedInstanceState) {
@ -20,5 +27,12 @@ public class PrivacySettingsFragment extends PreferenceFragment { @@ -20,5 +27,12 @@ public class PrivacySettingsFragment extends PreferenceFragment {
addPreferencesFromResource(R.xml.preference_privacy);
mActivity = getActivity();
initPrefs();
}
private void initPrefs() {
// mPreferences storage
mPreferences = PreferenceManager.getInstance();
}
}

301
app/src/main/res/layout/display_settings.xml

@ -1,301 +0,0 @@ @@ -1,301 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/toolbar_settings" />
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rHideStatusBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?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="30dp"
android:text="@string/fullScreenOption"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cbHideStatusBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="?attr/dividerColor" />
<RelativeLayout
android:id="@+id/rFullScreen"
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="30dp"
android:text="@string/fullscreen"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cbFullScreen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="?attr/dividerColor" />
<RelativeLayout
android:id="@+id/rTheme"
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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="16dp"
android:paddingRight="30dp"
android:text="@string/theme"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textViewTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="30dp"
android:text="CURRENT THEME"
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" />
<RelativeLayout
android:id="@+id/rWideViewPort"
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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="30dp"
android:text="@string/wideViewPort"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="30dp"
android:text="@string/recommended"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cbWideViewPort"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="?attr/dividerColor" />
<RelativeLayout
android:id="@+id/rOverView"
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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="30dp"
android:text="@string/overViewMode"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="30dp"
android:text="@string/recommended"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cbOverView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="?attr/dividerColor" />
<RelativeLayout
android:id="@+id/rTextReflow"
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_centerVertical="true"
android:paddingLeft="16dp"
android:paddingRight="30dp"
android:text="@string/reflow"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/cbTextReflow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="?attr/dividerColor" />
<RelativeLayout
android:id="@+id/rTextSize"
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/size"
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" />
</LinearLayout>
</ScrollView>
</LinearLayout>

25
app/src/main/res/xml/preference_advanced.xml

@ -2,6 +2,29 @@ @@ -2,6 +2,29 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/settings_advanced">
<CheckBoxPreference
android:defaultValue="true"
android:key="allow_new_window"
android:title="@string/window"
android:summary="@string/recommended" />
<CheckBoxPreference
android:defaultValue="true"
android:key="allow_cookies"
android:title="@string/cookies"
android:summary="@string/recommended" />
<CheckBoxPreference
android:defaultValue="false"
android:key="incognito_cookies"
android:title="@string/incognito_cookies" />
<CheckBoxPreference
android:defaultValue="true"
android:key="restore_tabs"
android:title="@string/restore" />
<Preference
android:key="rendering_mode"
android:title="@string/rendering_mode" />
<Preference
android:key="url_contents"
android:title="@string/url_contents" />
</PreferenceCategory>
</PreferenceScreen>

29
app/src/main/res/xml/preference_display.xml

@ -2,6 +2,33 @@ @@ -2,6 +2,33 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/settings_display">
<CheckBoxPreference
android:defaultValue="false"
android:key="fullScreenOption"
android:title="@string/fullScreenOption" />
<CheckBoxPreference
android:defaultValue="true"
android:key="fullscreen"
android:title="@string/fullscreen" />
<CheckBoxPreference
android:defaultValue="true"
android:key="wideViewPort"
android:title="@string/wideViewPort"
android:summary="@string/recommended" />
<CheckBoxPreference
android:defaultValue="true"
android:key="overViewMode"
android:title="@string/overViewMode"
android:summary="@string/recommended" />
<CheckBoxPreference
android:defaultValue="false"
android:key="text_reflow"
android:title="@string/reflow" />
<Preference
android:key="app_theme"
android:title="@string/theme" />
<Preference
android:key="text_size"
android:title="@string/title_text_size" />
</PreferenceCategory>
</PreferenceScreen>

5
app/src/main/res/xml/preference_general.xml

@ -31,11 +31,6 @@ @@ -31,11 +31,6 @@
android:targetPackage="acr.browser.lightning"
android:targetClass="acr.browser.lightning.activity.GeneralSettingsActivity" />
</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"

39
app/src/main/res/xml/preference_privacy.xml

@ -2,6 +2,43 @@ @@ -2,6 +2,43 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/settings_privacy">
<CheckBoxPreference
android:defaultValue="false"
android:key="location"
android:title="@string/location" />
<CheckBoxPreference
android:defaultValue="true"
android:key="third_party"
android:title="@string/third_party" />
<CheckBoxPreference
android:defaultValue="true"
android:key="password"
android:title="@string/password"
android:summary="@string/recommended" />
<CheckBoxPreference
android:defaultValue="true"
android:key="clear_cache_exit"
android:title="@string/cache" />
<CheckBoxPreference
android:defaultValue="false"
android:key="clear_history_exit"
android:title="@string/clear_history_exit" />
<CheckBoxPreference
android:defaultValue="false"
android:key="clear_cookies_exit"
android:title="@string/clear_cookies_exit" />
<CheckBoxPreference
android:defaultValue="false"
android:key="sync_history"
android:title="@string/sync_history" />
<Preference
android:key="clear_cache"
android:title="@string/clear_cache" />
<Preference
android:key="clear_history"
android:title="@string/title_clear_history" />
<Preference
android:key="clear_cookies"
android:title="@string/clear_cookies" />
</PreferenceCategory>
</PreferenceScreen>
Loading…
Cancel
Save