new Settings 3/3
now we have to bring the ToolBar back and fix some bugs... And testing!
This commit is contained in:
parent
2127863465
commit
b60f555553
@ -1,237 +0,0 @@
|
||||
/*
|
||||
* Copyright 2014 A.C.R. Development
|
||||
*/
|
||||
package acr.browser.lightning.activity;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
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.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import acr.browser.lightning.preference.PreferenceManager;
|
||||
import acr.browser.lightning.R;
|
||||
|
||||
public class AdvancedSettingsActivity extends ThemableSettingsActivity {
|
||||
|
||||
private CheckBox cbAllowPopups, cbAllowCookies, cbAllowIncognitoCookies, cbRestoreTabs;
|
||||
private Context mContext;
|
||||
private TextView mRenderText;
|
||||
private TextView mUrlText;
|
||||
private CharSequence[] mUrlOptions;
|
||||
private PreferenceManager mPreferences;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.advanced_settings);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
mContext = this;
|
||||
initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
|
||||
mPreferences = PreferenceManager.getInstance();
|
||||
|
||||
RelativeLayout rAllowPopups, rAllowCookies, rAllowIncognitoCookies, rRestoreTabs;
|
||||
LinearLayout lRenderPicker, lUrlContent;
|
||||
|
||||
rAllowPopups = (RelativeLayout) findViewById(R.id.rAllowPopups);
|
||||
rAllowCookies = (RelativeLayout) findViewById(R.id.rAllowCookies);
|
||||
rAllowIncognitoCookies = (RelativeLayout) findViewById(R.id.rAllowIncognitoCookies);
|
||||
rRestoreTabs = (RelativeLayout) findViewById(R.id.rRestoreTabs);
|
||||
lRenderPicker = (LinearLayout) findViewById(R.id.layoutRendering);
|
||||
lUrlContent = (LinearLayout) findViewById(R.id.rUrlBarContents);
|
||||
|
||||
cbAllowPopups = (CheckBox) findViewById(R.id.cbAllowPopups);
|
||||
cbAllowCookies = (CheckBox) findViewById(R.id.cbAllowCookies);
|
||||
cbAllowIncognitoCookies = (CheckBox) findViewById(R.id.cbAllowIncognitoCookies);
|
||||
cbRestoreTabs = (CheckBox) findViewById(R.id.cbRestoreTabs);
|
||||
|
||||
cbAllowPopups.setChecked(mPreferences.getPopupsEnabled());
|
||||
cbAllowCookies.setChecked(mPreferences.getCookiesEnabled());
|
||||
cbAllowIncognitoCookies.setChecked(mPreferences.getIncognitoCookiesEnabled());
|
||||
cbRestoreTabs.setChecked(mPreferences.getRestoreLostTabsEnabled());
|
||||
|
||||
mRenderText = (TextView) findViewById(R.id.renderText);
|
||||
mUrlText = (TextView) findViewById(R.id.urlText);
|
||||
|
||||
switch (mPreferences.getRenderingMode()) {
|
||||
case 0:
|
||||
mRenderText.setText(mContext.getString(R.string.name_normal));
|
||||
break;
|
||||
case 1:
|
||||
mRenderText.setText(mContext.getString(R.string.name_inverted));
|
||||
break;
|
||||
case 2:
|
||||
mRenderText.setText(mContext.getString(R.string.name_grayscale));
|
||||
break;
|
||||
case 3:
|
||||
mRenderText.setText(mContext.getString(R.string.name_inverted_grayscale));
|
||||
break;
|
||||
}
|
||||
|
||||
mUrlOptions = this.getResources().getStringArray(R.array.url_content_array);
|
||||
int option = mPreferences.getUrlBoxContentChoice();
|
||||
mUrlText.setText(mUrlOptions[option]);
|
||||
|
||||
LayoutClickListener listener = new LayoutClickListener();
|
||||
CheckListener cListener = new CheckListener();
|
||||
|
||||
rAllowPopups.setOnClickListener(listener);
|
||||
rAllowCookies.setOnClickListener(listener);
|
||||
rAllowIncognitoCookies.setOnClickListener(listener);
|
||||
rRestoreTabs.setOnClickListener(listener);
|
||||
lRenderPicker.setOnClickListener(listener);
|
||||
lUrlContent.setOnClickListener(listener);
|
||||
|
||||
cbAllowPopups.setOnCheckedChangeListener(cListener);
|
||||
cbAllowCookies.setOnCheckedChangeListener(cListener);
|
||||
cbAllowIncognitoCookies.setOnCheckedChangeListener(cListener);
|
||||
cbRestoreTabs.setOnCheckedChangeListener(cListener);
|
||||
|
||||
}
|
||||
|
||||
private class LayoutClickListener implements OnClickListener {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.rAllowPopups:
|
||||
cbAllowPopups.setChecked(!cbAllowPopups.isChecked());
|
||||
break;
|
||||
case R.id.rAllowIncognitoCookies:
|
||||
cbAllowIncognitoCookies.setChecked(!cbAllowIncognitoCookies.isChecked());
|
||||
break;
|
||||
case R.id.rAllowCookies:
|
||||
cbAllowCookies.setChecked(!cbAllowCookies.isChecked());
|
||||
break;
|
||||
case R.id.rRestoreTabs:
|
||||
cbRestoreTabs.setChecked(!cbRestoreTabs.isChecked());
|
||||
break;
|
||||
case R.id.layoutRendering:
|
||||
renderPicker();
|
||||
break;
|
||||
case R.id.rUrlBarContents:
|
||||
urlBoxPicker();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class CheckListener implements OnCheckedChangeListener {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
switch (buttonView.getId()) {
|
||||
case R.id.cbAllowPopups:
|
||||
mPreferences.setPopupsEnabled(isChecked);
|
||||
break;
|
||||
case R.id.cbAllowCookies:
|
||||
mPreferences.setCookiesEnabled(isChecked);
|
||||
break;
|
||||
case R.id.cbAllowIncognitoCookies:
|
||||
mPreferences.setIncognitoCookiesEnabled(isChecked);
|
||||
break;
|
||||
case R.id.cbRestoreTabs:
|
||||
mPreferences.setRestoreLostTabsEnabled(isChecked);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void renderPicker() {
|
||||
|
||||
AlertDialog.Builder picker = new AlertDialog.Builder(mContext);
|
||||
picker.setTitle(getResources().getString(R.string.rendering_mode));
|
||||
CharSequence[] chars = { mContext.getString(R.string.name_normal),
|
||||
mContext.getString(R.string.name_inverted),
|
||||
mContext.getString(R.string.name_grayscale),
|
||||
mContext.getString(R.string.name_inverted_grayscale) };
|
||||
|
||||
int n = mPreferences.getRenderingMode();
|
||||
|
||||
picker.setSingleChoiceItems(chars, n, new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
mPreferences.setRenderingMode(which);
|
||||
switch (which) {
|
||||
case 0:
|
||||
mRenderText.setText(mContext.getString(R.string.name_normal));
|
||||
break;
|
||||
case 1:
|
||||
mRenderText.setText(mContext.getString(R.string.name_inverted));
|
||||
break;
|
||||
case 2:
|
||||
mRenderText.setText(mContext.getString(R.string.name_grayscale));
|
||||
break;
|
||||
case 3:
|
||||
mRenderText.setText(mContext.getString(R.string.name_inverted_grayscale));
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
picker.setNeutralButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
picker.show();
|
||||
}
|
||||
|
||||
private void urlBoxPicker() {
|
||||
|
||||
AlertDialog.Builder picker = new AlertDialog.Builder(mContext);
|
||||
picker.setTitle(getResources().getString(R.string.url_contents));
|
||||
|
||||
int n = mPreferences.getUrlBoxContentChoice();
|
||||
|
||||
picker.setSingleChoiceItems(mUrlOptions, n, new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
mPreferences.setUrlBoxContentChoice(which);
|
||||
if (which < mUrlOptions.length) {
|
||||
mUrlText.setText(mUrlOptions[which]);
|
||||
}
|
||||
}
|
||||
});
|
||||
picker.setNeutralButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
picker.show();
|
||||
}
|
||||
|
||||
}
|
@ -1,536 +0,0 @@
|
||||
/*
|
||||
* Copyright 2014 A.C.R. Development
|
||||
*/
|
||||
package acr.browser.lightning.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
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.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import acr.browser.lightning.constant.Constants;
|
||||
import acr.browser.lightning.preference.PreferenceManager;
|
||||
import acr.browser.lightning.R;
|
||||
import acr.browser.lightning.utils.Utils;
|
||||
|
||||
public class GeneralSettingsActivity extends ThemableSettingsActivity {
|
||||
|
||||
// mPreferences variables
|
||||
private static final int API = android.os.Build.VERSION.SDK_INT;
|
||||
private PreferenceManager mPreferences;
|
||||
private int mAgentChoice;
|
||||
private String mHomepage;
|
||||
private TextView mAgentTextView;
|
||||
private TextView mDownloadTextView;
|
||||
private String mDownloadLocation;
|
||||
private TextView mHomepageText;
|
||||
private TextView mSearchText;
|
||||
private CheckBox cbSearchSuggestions;
|
||||
private Activity mActivity;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.general_settings);
|
||||
|
||||
// set up ActionBar
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
mPreferences = PreferenceManager.getInstance();
|
||||
|
||||
mActivity = this;
|
||||
initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
|
||||
mSearchText = (TextView) findViewById(R.id.searchText);
|
||||
|
||||
switch (mPreferences.getSearchChoice()) {
|
||||
case 0:
|
||||
mSearchText.setText(getResources().getString(R.string.custom_url));
|
||||
break;
|
||||
case 1:
|
||||
mSearchText.setText("Google");
|
||||
break;
|
||||
case 2:
|
||||
mSearchText.setText("Ask");
|
||||
break;
|
||||
case 3:
|
||||
mSearchText.setText("Bing");
|
||||
break;
|
||||
case 4:
|
||||
mSearchText.setText("Yahoo");
|
||||
break;
|
||||
case 5:
|
||||
mSearchText.setText("StartPage");
|
||||
break;
|
||||
case 6:
|
||||
mSearchText.setText("StartPage (Mobile)");
|
||||
break;
|
||||
case 7:
|
||||
mSearchText.setText("DuckDuckGo");
|
||||
break;
|
||||
case 8:
|
||||
mSearchText.setText("DuckDuckGo Lite");
|
||||
break;
|
||||
case 9:
|
||||
mSearchText.setText("Baidu");
|
||||
break;
|
||||
case 10:
|
||||
mSearchText.setText("Yandex");
|
||||
}
|
||||
|
||||
mAgentTextView = (TextView) findViewById(R.id.agentText);
|
||||
mHomepageText = (TextView) findViewById(R.id.homepageText);
|
||||
mDownloadTextView = (TextView) findViewById(R.id.downloadText);
|
||||
mAgentChoice = mPreferences.getUserAgentChoice();
|
||||
mHomepage = mPreferences.getHomepage();
|
||||
mDownloadLocation = mPreferences.getDownloadDirectory();
|
||||
|
||||
mDownloadTextView.setText(Constants.EXTERNAL_STORAGE + '/' + mDownloadLocation);
|
||||
|
||||
if (mHomepage.contains("about:home")) {
|
||||
mHomepageText.setText(getResources().getString(R.string.action_homepage));
|
||||
} else if (mHomepage.contains("about:blank")) {
|
||||
mHomepageText.setText(getResources().getString(R.string.action_blank));
|
||||
} else if (mHomepage.contains("about:bookmarks")) {
|
||||
mHomepageText.setText(getResources().getString(R.string.action_bookmarks));
|
||||
} else {
|
||||
mHomepageText.setText(mHomepage);
|
||||
}
|
||||
|
||||
switch (mAgentChoice) {
|
||||
case 1:
|
||||
mAgentTextView.setText(getResources().getString(R.string.agent_default));
|
||||
break;
|
||||
case 2:
|
||||
mAgentTextView.setText(getResources().getString(R.string.agent_desktop));
|
||||
break;
|
||||
case 3:
|
||||
mAgentTextView.setText(getResources().getString(R.string.agent_mobile));
|
||||
break;
|
||||
case 4:
|
||||
mAgentTextView.setText(getResources().getString(R.string.agent_custom));
|
||||
}
|
||||
|
||||
RelativeLayout rSearchSuggestions;
|
||||
rSearchSuggestions = (RelativeLayout) findViewById(R.id.rGoogleSuggestions);
|
||||
|
||||
cbSearchSuggestions = (CheckBox) findViewById(R.id.cbGoogleSuggestions);
|
||||
|
||||
cbSearchSuggestions.setChecked(mPreferences.getGoogleSearchSuggestionsEnabled());
|
||||
|
||||
RelativeLayout agent = (RelativeLayout) findViewById(R.id.layoutUserAgent);
|
||||
RelativeLayout download = (RelativeLayout) findViewById(R.id.layoutDownload);
|
||||
RelativeLayout homepage = (RelativeLayout) findViewById(R.id.layoutHomepage);
|
||||
|
||||
agent(agent);
|
||||
download(download);
|
||||
homepage(homepage);
|
||||
search();
|
||||
|
||||
rSearchSuggestions(rSearchSuggestions);
|
||||
cbSearchSuggestions(cbSearchSuggestions);
|
||||
}
|
||||
|
||||
public void search() {
|
||||
RelativeLayout search = (RelativeLayout) findViewById(R.id.layoutSearch);
|
||||
search.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
|
||||
picker.setTitle(getResources().getString(R.string.title_search_engine));
|
||||
CharSequence[] chars = { getResources().getString(R.string.custom_url), "Google",
|
||||
"Ask", "Bing", "Yahoo", "StartPage", "StartPage (Mobile)",
|
||||
"DuckDuckGo (Privacy)", "DuckDuckGo Lite (Privacy)", "Baidu (Chinese)",
|
||||
"Yandex (Russian)" };
|
||||
|
||||
int n = mPreferences.getSearchChoice();
|
||||
|
||||
picker.setSingleChoiceItems(chars, n, new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
mPreferences.setSearchChoice(which);
|
||||
switch (which) {
|
||||
case 0:
|
||||
searchUrlPicker();
|
||||
break;
|
||||
case 1:
|
||||
mSearchText.setText("Google");
|
||||
break;
|
||||
case 2:
|
||||
mSearchText.setText("Ask");
|
||||
break;
|
||||
case 3:
|
||||
mSearchText.setText("Bing");
|
||||
break;
|
||||
case 4:
|
||||
mSearchText.setText("Yahoo");
|
||||
break;
|
||||
case 5:
|
||||
mSearchText.setText("StartPage");
|
||||
break;
|
||||
case 6:
|
||||
mSearchText.setText("StartPage (Mobile)");
|
||||
break;
|
||||
case 7:
|
||||
mSearchText.setText("DuckDuckGo");
|
||||
break;
|
||||
case 8:
|
||||
mSearchText.setText("DuckDuckGo Lite");
|
||||
break;
|
||||
case 9:
|
||||
mSearchText.setText("Baidu");
|
||||
break;
|
||||
case 10:
|
||||
mSearchText.setText("Yandex");
|
||||
}
|
||||
}
|
||||
});
|
||||
picker.setNeutralButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
picker.show();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void searchUrlPicker() {
|
||||
final AlertDialog.Builder urlPicker = new AlertDialog.Builder(this);
|
||||
|
||||
urlPicker.setTitle(getResources().getString(R.string.custom_url));
|
||||
final EditText getSearchUrl = new EditText(this);
|
||||
|
||||
String mSearchUrl = mPreferences.getSearchUrl();
|
||||
getSearchUrl.setText(mSearchUrl);
|
||||
urlPicker.setView(getSearchUrl);
|
||||
urlPicker.setPositiveButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String text = getSearchUrl.getText().toString();
|
||||
mPreferences.setSearchUrl(text);
|
||||
mSearchText.setText(getResources().getString(R.string.custom_url) + ": "
|
||||
+ text);
|
||||
}
|
||||
});
|
||||
urlPicker.show();
|
||||
}
|
||||
|
||||
public void agent(RelativeLayout view) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AlertDialog.Builder agentPicker = new AlertDialog.Builder(mActivity);
|
||||
agentPicker.setTitle(getResources().getString(R.string.title_user_agent));
|
||||
mAgentChoice = mPreferences.getUserAgentChoice();
|
||||
agentPicker.setSingleChoiceItems(R.array.user_agent, mAgentChoice - 1,
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
mPreferences.setUserAgentChoice(which + 1);
|
||||
switch (which + 1) {
|
||||
case 1:
|
||||
mAgentTextView.setText(getResources().getString(
|
||||
R.string.agent_default));
|
||||
break;
|
||||
case 2:
|
||||
mAgentTextView.setText(getResources().getString(
|
||||
R.string.agent_desktop));
|
||||
break;
|
||||
case 3:
|
||||
mAgentTextView.setText(getResources().getString(
|
||||
R.string.agent_mobile));
|
||||
break;
|
||||
case 4:
|
||||
mAgentTextView.setText(getResources().getString(
|
||||
R.string.agent_custom));
|
||||
agentPicker();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
agentPicker.setNeutralButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
agentPicker.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
// TODO Auto-generated method stub
|
||||
Log.i("Cancelled", "");
|
||||
}
|
||||
});
|
||||
agentPicker.show();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void agentPicker() {
|
||||
final AlertDialog.Builder agentStringPicker = new AlertDialog.Builder(mActivity);
|
||||
|
||||
agentStringPicker.setTitle(getResources().getString(R.string.title_user_agent));
|
||||
final EditText getAgent = new EditText(this);
|
||||
agentStringPicker.setView(getAgent);
|
||||
agentStringPicker.setPositiveButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String text = getAgent.getText().toString();
|
||||
mPreferences.setUserAgentString(text);
|
||||
mAgentTextView.setText(getResources().getString(R.string.agent_custom));
|
||||
}
|
||||
});
|
||||
agentStringPicker.show();
|
||||
}
|
||||
|
||||
public void download(RelativeLayout view) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
|
||||
picker.setTitle(getResources().getString(R.string.title_download_location));
|
||||
mDownloadLocation = mPreferences.getDownloadDirectory();
|
||||
int n;
|
||||
if (mDownloadLocation.contains(Environment.DIRECTORY_DOWNLOADS)) {
|
||||
n = 1;
|
||||
} else {
|
||||
n = 2;
|
||||
}
|
||||
|
||||
picker.setSingleChoiceItems(R.array.download_folder, n - 1,
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
switch (which + 1) {
|
||||
case 1:
|
||||
mPreferences
|
||||
.setDownloadDirectory(Environment.DIRECTORY_DOWNLOADS);
|
||||
mDownloadTextView.setText(Constants.EXTERNAL_STORAGE + '/'
|
||||
+ Environment.DIRECTORY_DOWNLOADS);
|
||||
break;
|
||||
case 2:
|
||||
downPicker();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
picker.setNeutralButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
picker.show();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void homePicker() {
|
||||
final AlertDialog.Builder homePicker = new AlertDialog.Builder(mActivity);
|
||||
homePicker.setTitle(getResources().getString(R.string.title_custom_homepage));
|
||||
final EditText getHome = new EditText(this);
|
||||
mHomepage = mPreferences.getHomepage();
|
||||
if (!mHomepage.startsWith("about:")) {
|
||||
getHome.setText(mHomepage);
|
||||
} else {
|
||||
getHome.setText("http://www.google.com");
|
||||
}
|
||||
homePicker.setView(getHome);
|
||||
homePicker.setPositiveButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String text = getHome.getText().toString();
|
||||
mPreferences.setHomepage(text);
|
||||
mHomepageText.setText(text);
|
||||
}
|
||||
});
|
||||
homePicker.show();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void downPicker() {
|
||||
final AlertDialog.Builder downLocationPicker = new AlertDialog.Builder(mActivity);
|
||||
LinearLayout layout = new LinearLayout(this);
|
||||
downLocationPicker.setTitle(getResources().getString(R.string.title_download_location));
|
||||
final EditText getDownload = new EditText(this);
|
||||
getDownload.setBackgroundResource(0);
|
||||
mDownloadLocation = mPreferences.getDownloadDirectory();
|
||||
int padding = Utils.convertDpToPixels(10);
|
||||
|
||||
LinearLayout.LayoutParams lparams = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
|
||||
|
||||
getDownload.setLayoutParams(lparams);
|
||||
getDownload.setTextColor(Color.DKGRAY);
|
||||
getDownload.setText(mDownloadLocation);
|
||||
getDownload.setPadding(0, padding, padding, padding);
|
||||
|
||||
TextView v = new TextView(this);
|
||||
v.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
|
||||
v.setTextColor(Color.DKGRAY);
|
||||
v.setText(Constants.EXTERNAL_STORAGE + '/');
|
||||
v.setPadding(padding, padding, 0, padding);
|
||||
layout.addView(v);
|
||||
layout.addView(getDownload);
|
||||
if (API < 16) {
|
||||
layout.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.edit_text));
|
||||
} else {
|
||||
layout.setBackground(getResources().getDrawable(android.R.drawable.edit_text));
|
||||
}
|
||||
downLocationPicker.setView(layout);
|
||||
downLocationPicker.setPositiveButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String text = getDownload.getText().toString();
|
||||
mPreferences.setDownloadDirectory(text);
|
||||
mDownloadTextView.setText(Constants.EXTERNAL_STORAGE + '/' + text);
|
||||
}
|
||||
});
|
||||
downLocationPicker.show();
|
||||
}
|
||||
|
||||
public void homepage(RelativeLayout view) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
|
||||
picker.setTitle(getResources().getString(R.string.home));
|
||||
mHomepage = mPreferences.getHomepage();
|
||||
int n;
|
||||
if (mHomepage.contains("about:home")) {
|
||||
n = 1;
|
||||
} else if (mHomepage.contains("about:blank")) {
|
||||
n = 2;
|
||||
} else if (mHomepage.contains("about:bookmarks")) {
|
||||
n = 3;
|
||||
} else {
|
||||
n = 4;
|
||||
}
|
||||
|
||||
picker.setSingleChoiceItems(R.array.homepage, n - 1,
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
switch (which + 1) {
|
||||
case 1:
|
||||
mPreferences.setHomepage("about:home");
|
||||
mHomepageText.setText(getResources().getString(
|
||||
R.string.action_homepage));
|
||||
break;
|
||||
case 2:
|
||||
mPreferences.setHomepage("about:blank");
|
||||
mHomepageText.setText(getResources().getString(
|
||||
R.string.action_blank));
|
||||
break;
|
||||
case 3:
|
||||
mPreferences.setHomepage("about:bookmarks");
|
||||
mHomepageText.setText(getResources().getString(
|
||||
R.string.action_bookmarks));
|
||||
|
||||
break;
|
||||
case 4:
|
||||
homePicker();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
picker.setNeutralButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
picker.show();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void cbSearchSuggestions(CheckBox view) {
|
||||
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
mPreferences.setGoogleSearchSuggestionsEnabled(isChecked);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void rSearchSuggestions(RelativeLayout view) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
cbSearchSuggestions.setChecked(!cbSearchSuggestions.isChecked());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -1,449 +0,0 @@
|
||||
/*
|
||||
* Copyright 2014 A.C.R. Development
|
||||
*/
|
||||
package acr.browser.lightning.activity;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.Browser;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.webkit.*;
|
||||
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.database.HistoryDatabase;
|
||||
import acr.browser.lightning.preference.PreferenceManager;
|
||||
import acr.browser.lightning.R;
|
||||
import acr.browser.lightning.utils.Utils;
|
||||
|
||||
public class PrivacySettingsActivity extends ThemableSettingsActivity {
|
||||
|
||||
// mPreferences variables
|
||||
private static final int API = android.os.Build.VERSION.SDK_INT;
|
||||
private PreferenceManager mPreferences;
|
||||
private CheckBox cbLocation, cbSavePasswords, cbClearCacheExit, cbClearHistoryExit,
|
||||
cbClearCookiesExit, cbThirdParty;
|
||||
private Context mContext;
|
||||
private boolean mSystemBrowser;
|
||||
private Handler messageHandler;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.privacy_settings);
|
||||
|
||||
// set up ActionBar
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
mPreferences = PreferenceManager.getInstance();
|
||||
|
||||
mSystemBrowser = mPreferences.getSystemBrowserPresent();
|
||||
mContext = this;
|
||||
initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
|
||||
RelativeLayout rLocation, rSavePasswords, rClearCacheExit, rClearHistoryExit, rClearCookiesExit, rClearCache, rClearHistory, rClearCookies, rThirdParty;
|
||||
|
||||
rLocation = (RelativeLayout) findViewById(R.id.rLocation);
|
||||
rSavePasswords = (RelativeLayout) findViewById(R.id.rSavePasswords);
|
||||
rClearCacheExit = (RelativeLayout) findViewById(R.id.rClearCacheExit);
|
||||
rClearHistoryExit = (RelativeLayout) findViewById(R.id.rClearHistoryExit);
|
||||
rClearCookiesExit = (RelativeLayout) findViewById(R.id.rClearCookiesExit);
|
||||
rClearCache = (RelativeLayout) findViewById(R.id.rClearCache);
|
||||
rClearHistory = (RelativeLayout) findViewById(R.id.rClearHistory);
|
||||
rClearCookies = (RelativeLayout) findViewById(R.id.rClearCookies);
|
||||
rThirdParty = (RelativeLayout) findViewById(R.id.rThirdParty);
|
||||
|
||||
cbLocation = (CheckBox) findViewById(R.id.cbLocation);
|
||||
cbSavePasswords = (CheckBox) findViewById(R.id.cbSavePasswords);
|
||||
cbClearCacheExit = (CheckBox) findViewById(R.id.cbClearCacheExit);
|
||||
cbClearHistoryExit = (CheckBox) findViewById(R.id.cbClearHistoryExit);
|
||||
cbClearCookiesExit = (CheckBox) findViewById(R.id.cbClearCookiesExit);
|
||||
cbThirdParty = (CheckBox) findViewById(R.id.cbThirdParty);
|
||||
|
||||
cbLocation.setChecked(mPreferences.getLocationEnabled());
|
||||
cbSavePasswords.setChecked(mPreferences.getSavePasswordsEnabled());
|
||||
cbClearCacheExit.setChecked(mPreferences.getClearCacheExit());
|
||||
cbClearHistoryExit.setChecked(mPreferences.getClearHistoryExitEnabled());
|
||||
cbClearCookiesExit.setChecked(mPreferences.getClearCookiesExitEnabled());
|
||||
cbThirdParty.setChecked(mPreferences.getBlockThirdPartyCookiesEnabled());
|
||||
|
||||
cbThirdParty.setEnabled(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP);
|
||||
|
||||
rLocation(rLocation);
|
||||
rSavePasswords(rSavePasswords);
|
||||
rClearCacheExit(rClearCacheExit);
|
||||
rClearHistoryExit(rClearHistoryExit);
|
||||
rClearCookiesExit(rClearCookiesExit);
|
||||
rClearCache(rClearCache);
|
||||
rClearHistory(rClearHistory);
|
||||
rClearCookies(rClearCookies);
|
||||
rThirdParty(rThirdParty);
|
||||
cbLocation(cbLocation);
|
||||
cbSavePasswords(cbSavePasswords);
|
||||
cbClearCacheExit(cbClearCacheExit);
|
||||
cbClearHistoryExit(cbClearHistoryExit);
|
||||
cbClearCookiesExit(cbClearCookiesExit);
|
||||
cbThirdParty(cbThirdParty);
|
||||
|
||||
TextView syncHistory = (TextView) findViewById(R.id.isBrowserAvailable);
|
||||
|
||||
RelativeLayout layoutSyncHistory = (RelativeLayout) findViewById(R.id.rBrowserHistory);
|
||||
final CheckBox cbSyncHistory = (CheckBox) findViewById(R.id.cbBrowserHistory);
|
||||
layoutSyncHistory.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
cbSyncHistory.setChecked(!cbSyncHistory.isChecked());
|
||||
}
|
||||
|
||||
});
|
||||
cbSyncHistory.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
mPreferences.setSyncHistoryEnabled(isChecked);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (!mSystemBrowser) {
|
||||
cbSyncHistory.setChecked(false);
|
||||
cbSyncHistory.setEnabled(false);
|
||||
syncHistory.setText(getResources().getString(R.string.stock_browser_unavailable));
|
||||
} else {
|
||||
cbSyncHistory.setEnabled(true);
|
||||
cbSyncHistory.setChecked(mPreferences.getSyncHistoryEnabled());
|
||||
syncHistory.setText(getResources().getString(R.string.stock_browser_available));
|
||||
}
|
||||
|
||||
messageHandler = new MessageHandler(mContext);
|
||||
}
|
||||
|
||||
private static class MessageHandler extends Handler {
|
||||
|
||||
final Context mHandlerContext;
|
||||
|
||||
public MessageHandler(Context context) {
|
||||
this.mHandlerContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
switch (msg.what) {
|
||||
case 1:
|
||||
Utils.showToast(mHandlerContext,
|
||||
mHandlerContext.getResources()
|
||||
.getString(R.string.message_clear_history));
|
||||
break;
|
||||
case 2:
|
||||
Utils.showToast(
|
||||
mHandlerContext,
|
||||
mHandlerContext.getResources().getString(
|
||||
R.string.message_cookies_cleared));
|
||||
break;
|
||||
}
|
||||
super.handleMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
private void cbLocation(CheckBox view) {
|
||||
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
mPreferences.setLocationEnabled(isChecked);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void cbSavePasswords(CheckBox view) {
|
||||
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
mPreferences.setSavePasswordsEnabled(isChecked);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void cbClearCacheExit(CheckBox view) {
|
||||
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
mPreferences.setClearCacheExit(isChecked);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void cbClearHistoryExit(CheckBox view) {
|
||||
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
mPreferences.setClearHistoryExitEnabled(isChecked);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void cbThirdParty(CheckBox view) {
|
||||
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
mPreferences.setBlockThirdPartyCookiesEnabled(isChecked);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void cbClearCookiesExit(CheckBox view) {
|
||||
view.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
mPreferences.setClearCookiesExitEnabled(isChecked);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void rLocation(RelativeLayout view) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO Auto-generated method stub
|
||||
cbLocation.setChecked(!cbLocation.isChecked());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void rSavePasswords(RelativeLayout view) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO Auto-generated method stub
|
||||
cbSavePasswords.setChecked(!cbSavePasswords.isChecked());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void rClearCacheExit(RelativeLayout view) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO Auto-generated method stub
|
||||
cbClearCacheExit.setChecked(!cbClearCacheExit.isChecked());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void rThirdParty(RelativeLayout view) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO Auto-generated method stub
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
cbThirdParty.setChecked(!cbThirdParty.isChecked());
|
||||
} else {
|
||||
Utils.showToast(mContext, mContext.getString(R.string.available_lollipop));
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void rClearHistoryExit(RelativeLayout view) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO Auto-generated method stub
|
||||
cbClearHistoryExit.setChecked(!cbClearHistoryExit.isChecked());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void rClearCookiesExit(RelativeLayout view) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO Auto-generated method stub
|
||||
cbClearCookiesExit.setChecked(!cbClearCookiesExit.isChecked());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void rClearHistory(RelativeLayout view) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(PrivacySettingsActivity.this); // dialog
|
||||
builder.setTitle(getResources().getString(R.string.title_clear_history));
|
||||
builder.setMessage(getResources().getString(R.string.dialog_history))
|
||||
.setPositiveButton(getResources().getString(R.string.action_yes),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface arg0, int arg1) {
|
||||
Thread clear = new Thread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
clearHistory();
|
||||
}
|
||||
|
||||
});
|
||||
clear.start();
|
||||
}
|
||||
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.action_no),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface arg0, int arg1) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}).show();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void rClearCookies(RelativeLayout view) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(PrivacySettingsActivity.this); // dialog
|
||||
builder.setTitle(getResources().getString(R.string.title_clear_cookies));
|
||||
builder.setMessage(getResources().getString(R.string.dialog_cookies))
|
||||
.setPositiveButton(getResources().getString(R.string.action_yes),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface arg0, int arg1) {
|
||||
Thread clear = new Thread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
clearCookies();
|
||||
}
|
||||
|
||||
});
|
||||
clear.start();
|
||||
}
|
||||
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.action_no),
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface arg0, int arg1) {
|
||||
|
||||
}
|
||||
|
||||
}).show();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void rClearCache(RelativeLayout view) {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO Auto-generated method stub
|
||||
clearCache();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void clearCache() {
|
||||
WebView webView = new WebView(this);
|
||||
webView.clearCache(true);
|
||||
webView.destroy();
|
||||
Utils.showToast(mContext, getResources().getString(R.string.message_cache_cleared));
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void clearHistory() {
|
||||
deleteDatabase(HistoryDatabase.DATABASE_NAME);
|
||||
WebViewDatabase m = WebViewDatabase.getInstance(this);
|
||||
m.clearFormData();
|
||||
m.clearHttpAuthUsernamePassword();
|
||||
if (API < 18) {
|
||||
m.clearUsernamePassword();
|
||||
WebIconDatabase.getInstance().removeAllIcons();
|
||||
}
|
||||
if (mSystemBrowser) {
|
||||
try {
|
||||
Browser.clearHistory(getContentResolver());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
Utils.trimCache(this);
|
||||
messageHandler.sendEmptyMessage(1);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void clearCookies() {
|
||||
// TODO Break out web storage deletion into its own option/action
|
||||
// TODO clear web storage for all sites that are visited in Incognito mode
|
||||
WebStorage storage = WebStorage.getInstance();
|
||||
storage.deleteAllData();
|
||||
CookieManager c = CookieManager.getInstance();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
c.removeAllCookies(null);
|
||||
} else {
|
||||
CookieSyncManager.createInstance(this);
|
||||
c.removeAllCookie();
|
||||
}
|
||||
messageHandler.sendEmptyMessage(2);
|
||||
}
|
||||
}
|
@ -4,6 +4,8 @@
|
||||
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;
|
||||
@ -12,12 +14,20 @@ import android.preference.PreferenceFragment;
|
||||
import acr.browser.lightning.R;
|
||||
import acr.browser.lightning.preference.PreferenceManager;
|
||||
|
||||
public class AdvancedSettingsFragment extends PreferenceFragment {
|
||||
public class AdvancedSettingsFragment extends PreferenceFragment implements Preference.OnPreferenceClickListener, Preference.OnPreferenceChangeListener {
|
||||
|
||||
private static final String SETTINGS_NEWWINDOW = "allow_new_window";
|
||||
private static final String SETTINGS_ENABLECOOKIES = "allow_cookies";
|
||||
private static final String SETTINGS_COOKIESINKOGNITO = "incognito_cookies";
|
||||
private static final String SETTINGS_RESTORETABS = "restore_tabs";
|
||||
private static final String SETTINGS_RENDERINGMODE = "rendering_mode";
|
||||
private static final String SETTINGS_URLCONTENT = "url_contents";
|
||||
|
||||
private Activity mActivity;
|
||||
private PreferenceManager mPreferences;
|
||||
private CheckBoxPreference newwindow, enablecookies, cookieInkognito, restoreTabs;
|
||||
private CheckBoxPreference cbAllowPopups, cbenablecookies, cbcookiesInkognito, cbrestoreTabs;
|
||||
private Preference renderingmode, urlcontent;
|
||||
private CharSequence[] mUrlOptions;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@ -33,5 +43,147 @@ public class AdvancedSettingsFragment extends PreferenceFragment {
|
||||
private void initPrefs() {
|
||||
// mPreferences storage
|
||||
mPreferences = PreferenceManager.getInstance();
|
||||
|
||||
renderingmode = findPreference(SETTINGS_RENDERINGMODE);
|
||||
urlcontent = findPreference(SETTINGS_URLCONTENT);
|
||||
cbAllowPopups = (CheckBoxPreference) findPreference(SETTINGS_NEWWINDOW);
|
||||
cbenablecookies = (CheckBoxPreference) findPreference(SETTINGS_ENABLECOOKIES);
|
||||
cbcookiesInkognito = (CheckBoxPreference) findPreference(SETTINGS_COOKIESINKOGNITO);
|
||||
cbrestoreTabs = (CheckBoxPreference) findPreference(SETTINGS_RESTORETABS);
|
||||
|
||||
renderingmode.setOnPreferenceClickListener(this);
|
||||
urlcontent.setOnPreferenceClickListener(this);
|
||||
cbAllowPopups.setOnPreferenceChangeListener(this);
|
||||
cbenablecookies.setOnPreferenceChangeListener(this);
|
||||
cbcookiesInkognito.setOnPreferenceChangeListener(this);
|
||||
cbrestoreTabs.setOnPreferenceChangeListener(this);
|
||||
|
||||
switch (mPreferences.getRenderingMode()) {
|
||||
case 0:
|
||||
renderingmode.setSummary(getString(R.string.name_normal));
|
||||
break;
|
||||
case 1:
|
||||
renderingmode.setSummary(getString(R.string.name_inverted));
|
||||
break;
|
||||
case 2:
|
||||
renderingmode.setSummary(getString(R.string.name_grayscale));
|
||||
break;
|
||||
case 3:
|
||||
renderingmode.setSummary(getString(R.string.name_inverted_grayscale));
|
||||
break;
|
||||
}
|
||||
|
||||
mUrlOptions = getResources().getStringArray(R.array.url_content_array);
|
||||
int option = mPreferences.getUrlBoxContentChoice();
|
||||
urlcontent.setSummary(mUrlOptions[option]);
|
||||
|
||||
cbAllowPopups.setChecked(mPreferences.getPopupsEnabled());
|
||||
cbenablecookies.setChecked(mPreferences.getCookiesEnabled());
|
||||
cbcookiesInkognito.setChecked(mPreferences.getIncognitoCookiesEnabled());
|
||||
cbrestoreTabs.setChecked(mPreferences.getRestoreLostTabsEnabled());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
switch (preference.getKey()) {
|
||||
case SETTINGS_RENDERINGMODE:
|
||||
renderPicker();
|
||||
return true;
|
||||
case SETTINGS_URLCONTENT:
|
||||
urlBoxPicker();
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
// switch preferences
|
||||
switch (preference.getKey()) {
|
||||
case SETTINGS_NEWWINDOW:
|
||||
mPreferences.setPopupsEnabled((Boolean) newValue);
|
||||
cbAllowPopups.setChecked((Boolean) newValue);
|
||||
return true;
|
||||
case SETTINGS_ENABLECOOKIES:
|
||||
mPreferences.setCookiesEnabled((Boolean) newValue);
|
||||
cbenablecookies.setChecked((Boolean) newValue);
|
||||
return true;
|
||||
case SETTINGS_COOKIESINKOGNITO:
|
||||
mPreferences.setIncognitoCookiesEnabled((Boolean) newValue);
|
||||
cbcookiesInkognito.setChecked((Boolean) newValue);
|
||||
return true;
|
||||
case SETTINGS_RESTORETABS:
|
||||
mPreferences.setRestoreLostTabsEnabled((Boolean) newValue);
|
||||
cbrestoreTabs.setChecked((Boolean) newValue);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void renderPicker() {
|
||||
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
|
||||
picker.setTitle(getResources().getString(R.string.rendering_mode));
|
||||
CharSequence[] chars = {mActivity.getString(R.string.name_normal),
|
||||
mActivity.getString(R.string.name_inverted),
|
||||
mActivity.getString(R.string.name_grayscale),
|
||||
mActivity.getString(R.string.name_inverted_grayscale)};
|
||||
|
||||
int n = mPreferences.getRenderingMode();
|
||||
|
||||
picker.setSingleChoiceItems(chars, n, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
mPreferences.setRenderingMode(which);
|
||||
switch (which) {
|
||||
case 0:
|
||||
renderingmode.setSummary(getString(R.string.name_normal));
|
||||
break;
|
||||
case 1:
|
||||
renderingmode.setSummary(getString(R.string.name_inverted));
|
||||
break;
|
||||
case 2:
|
||||
renderingmode.setSummary(getString(R.string.name_grayscale));
|
||||
break;
|
||||
case 3:
|
||||
renderingmode.setSummary(getString(R.string.name_inverted_grayscale));
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
picker.setNeutralButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
picker.show();
|
||||
}
|
||||
|
||||
private void urlBoxPicker() {
|
||||
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
|
||||
picker.setTitle(getResources().getString(R.string.url_contents));
|
||||
|
||||
int n = mPreferences.getUrlBoxContentChoice();
|
||||
|
||||
picker.setSingleChoiceItems(mUrlOptions, n, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
mPreferences.setUrlBoxContentChoice(which);
|
||||
if (which < mUrlOptions.length) {
|
||||
urlcontent.setSummary(mUrlOptions[which]);
|
||||
}
|
||||
}
|
||||
});
|
||||
picker.setNeutralButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
picker.show();
|
||||
}
|
||||
}
|
||||
|
@ -6,12 +6,18 @@ package acr.browser.lightning.fragment;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceFragment;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import acr.browser.lightning.R;
|
||||
import acr.browser.lightning.constant.Constants;
|
||||
@ -27,13 +33,21 @@ public class GeneralSettingsFragment extends PreferenceFragment implements Prefe
|
||||
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_USERAGENT = "agent";
|
||||
private static final String SETTINGS_DOWNLOAD = "download";
|
||||
private static final String SETTINGS_HOME = "home";
|
||||
private static final String SETTINGS_SEARCHENGINE = "search";
|
||||
private static final String SETTINGS_GOOGLESUGGESTIONS = "google_suggestions";
|
||||
|
||||
private Activity mActivity;
|
||||
private static final int API = android.os.Build.VERSION.SDK_INT;
|
||||
private PreferenceManager mPreferences;
|
||||
private CharSequence[] mProxyChoices;
|
||||
private Preference proxy;
|
||||
private CheckBoxPreference cbFlash, cbAds, cbImages, cbJsScript, cbColorMode;
|
||||
private Preference proxy, useragent, downloadloc, home, searchengine;
|
||||
private String mDownloadLocation;
|
||||
private int mAgentChoice;
|
||||
private String mHomepage;
|
||||
private CheckBoxPreference cbFlash, cbAds, cbImages, cbJsScript, cbColorMode, cbgooglesuggest;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@ -51,20 +65,34 @@ public class GeneralSettingsFragment extends PreferenceFragment implements Prefe
|
||||
mPreferences = PreferenceManager.getInstance();
|
||||
|
||||
proxy = findPreference(SETTINGS_PROXY);
|
||||
useragent = findPreference(SETTINGS_USERAGENT);
|
||||
downloadloc = findPreference(SETTINGS_DOWNLOAD);
|
||||
home = findPreference(SETTINGS_HOME);
|
||||
searchengine = findPreference(SETTINGS_SEARCHENGINE);
|
||||
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);
|
||||
cbgooglesuggest = (CheckBoxPreference) findPreference(SETTINGS_GOOGLESUGGESTIONS);
|
||||
|
||||
proxy.setOnPreferenceClickListener(this);
|
||||
useragent.setOnPreferenceClickListener(this);
|
||||
downloadloc.setOnPreferenceClickListener(this);
|
||||
home.setOnPreferenceClickListener(this);
|
||||
searchengine.setOnPreferenceClickListener(this);
|
||||
cbFlash.setOnPreferenceChangeListener(this);
|
||||
cbAds.setOnPreferenceChangeListener(this);
|
||||
cbImages.setOnPreferenceChangeListener(this);
|
||||
cbJsScript.setOnPreferenceChangeListener(this);
|
||||
cbColorMode.setOnPreferenceChangeListener(this);
|
||||
cbgooglesuggest.setOnPreferenceChangeListener(this);
|
||||
|
||||
mAgentChoice = mPreferences.getUserAgentChoice();
|
||||
mHomepage = mPreferences.getHomepage();
|
||||
mDownloadLocation = mPreferences.getDownloadDirectory();
|
||||
mProxyChoices = getResources().getStringArray(R.array.proxy_choices_array);
|
||||
|
||||
int choice = mPreferences.getProxyChoice();
|
||||
if (choice == Constants.PROXY_MANUAL) {
|
||||
proxy.setSummary(mPreferences.getProxyHost() + ":" + mPreferences.getProxyPort());
|
||||
@ -76,6 +104,34 @@ public class GeneralSettingsFragment extends PreferenceFragment implements Prefe
|
||||
mPreferences.setFlashSupport(0);
|
||||
}
|
||||
|
||||
setSearchEngineSummary(mPreferences.getSearchChoice());
|
||||
|
||||
downloadloc.setSummary(Constants.EXTERNAL_STORAGE + '/' + mDownloadLocation);
|
||||
|
||||
if (mHomepage.contains("about:home")) {
|
||||
home.setSummary(getResources().getString(R.string.action_homepage));
|
||||
} else if (mHomepage.contains("about:blank")) {
|
||||
home.setSummary(getResources().getString(R.string.action_blank));
|
||||
} else if (mHomepage.contains("about:bookmarks")) {
|
||||
home.setSummary(getResources().getString(R.string.action_bookmarks));
|
||||
} else {
|
||||
home.setSummary(mHomepage);
|
||||
}
|
||||
|
||||
switch (mAgentChoice) {
|
||||
case 1:
|
||||
useragent.setSummary(getResources().getString(R.string.agent_default));
|
||||
break;
|
||||
case 2:
|
||||
useragent.setSummary(getResources().getString(R.string.agent_desktop));
|
||||
break;
|
||||
case 3:
|
||||
useragent.setSummary(getResources().getString(R.string.agent_mobile));
|
||||
break;
|
||||
case 4:
|
||||
useragent.setSummary(getResources().getString(R.string.agent_custom));
|
||||
}
|
||||
|
||||
int flashNum = mPreferences.getFlashSupport();
|
||||
boolean imagesBool = mPreferences.getBlockImagesEnabled();
|
||||
boolean enableJSBool = mPreferences.getJavaScriptEnabled();
|
||||
@ -89,6 +145,27 @@ public class GeneralSettingsFragment extends PreferenceFragment implements Prefe
|
||||
cbFlash.setChecked(flashNum > 0);
|
||||
cbAds.setChecked(Constants.FULL_VERSION && mPreferences.getAdBlockEnabled());
|
||||
cbColorMode.setChecked(mPreferences.getColorModeEnabled());
|
||||
cbgooglesuggest.setChecked(mPreferences.getGoogleSearchSuggestionsEnabled());
|
||||
}
|
||||
|
||||
public void searchUrlPicker() {
|
||||
final AlertDialog.Builder urlPicker = new AlertDialog.Builder(mActivity);
|
||||
urlPicker.setTitle(getResources().getString(R.string.custom_url));
|
||||
final EditText getSearchUrl = new EditText(mActivity);
|
||||
String mSearchUrl = mPreferences.getSearchUrl();
|
||||
getSearchUrl.setText(mSearchUrl);
|
||||
urlPicker.setView(getSearchUrl);
|
||||
urlPicker.setPositiveButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String text = getSearchUrl.getText().toString();
|
||||
mPreferences.setSearchUrl(text);
|
||||
searchengine.setSummary(getResources().getString(R.string.custom_url) + ": "
|
||||
+ text);
|
||||
}
|
||||
});
|
||||
urlPicker.show();
|
||||
}
|
||||
|
||||
private void getFlashChoice() {
|
||||
@ -184,12 +261,286 @@ public class GeneralSettingsFragment extends PreferenceFragment implements Prefe
|
||||
.show();
|
||||
}
|
||||
|
||||
public void searchDialog() {
|
||||
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
|
||||
picker.setTitle(getResources().getString(R.string.title_search_engine));
|
||||
CharSequence[] chars = {getResources().getString(R.string.custom_url), "Google",
|
||||
"Ask", "Bing", "Yahoo", "StartPage", "StartPage (Mobile)",
|
||||
"DuckDuckGo (Privacy)", "DuckDuckGo Lite (Privacy)", "Baidu (Chinese)",
|
||||
"Yandex (Russian)"};
|
||||
|
||||
int n = mPreferences.getSearchChoice();
|
||||
|
||||
picker.setSingleChoiceItems(chars, n, new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
mPreferences.setSearchChoice(which);
|
||||
setSearchEngineSummary(which);
|
||||
}
|
||||
});
|
||||
picker.setNeutralButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
}
|
||||
});
|
||||
picker.show();
|
||||
}
|
||||
|
||||
public void homepageDialog() {
|
||||
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
|
||||
picker.setTitle(getResources().getString(R.string.home));
|
||||
mHomepage = mPreferences.getHomepage();
|
||||
int n;
|
||||
if (mHomepage.contains("about:home")) {
|
||||
n = 1;
|
||||
} else if (mHomepage.contains("about:blank")) {
|
||||
n = 2;
|
||||
} else if (mHomepage.contains("about:bookmarks")) {
|
||||
n = 3;
|
||||
} else {
|
||||
n = 4;
|
||||
}
|
||||
|
||||
picker.setSingleChoiceItems(R.array.homepage, n - 1,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
switch (which + 1) {
|
||||
case 1:
|
||||
mPreferences.setHomepage("about:home");
|
||||
home.setSummary(getResources().getString(R.string.action_homepage));
|
||||
break;
|
||||
case 2:
|
||||
mPreferences.setHomepage("about:blank");
|
||||
home.setSummary(getResources().getString(R.string.action_blank));
|
||||
break;
|
||||
case 3:
|
||||
mPreferences.setHomepage("about:bookmarks");
|
||||
home.setSummary(getResources().getString(R.string.action_bookmarks));
|
||||
break;
|
||||
case 4:
|
||||
homePicker();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
picker.setNeutralButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
}
|
||||
});
|
||||
picker.show();
|
||||
}
|
||||
|
||||
public void homePicker() {
|
||||
final AlertDialog.Builder homePicker = new AlertDialog.Builder(mActivity);
|
||||
homePicker.setTitle(getResources().getString(R.string.title_custom_homepage));
|
||||
final EditText getHome = new EditText(mActivity);
|
||||
mHomepage = mPreferences.getHomepage();
|
||||
if (!mHomepage.startsWith("about:")) {
|
||||
getHome.setText(mHomepage);
|
||||
} else {
|
||||
getHome.setText("http://www.google.com");
|
||||
}
|
||||
homePicker.setView(getHome);
|
||||
homePicker.setPositiveButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String text = getHome.getText().toString();
|
||||
mPreferences.setHomepage(text);
|
||||
home.setSummary(text);
|
||||
}
|
||||
});
|
||||
homePicker.show();
|
||||
}
|
||||
|
||||
public void downloadLocDialog() {
|
||||
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
|
||||
picker.setTitle(getResources().getString(R.string.title_download_location));
|
||||
mDownloadLocation = mPreferences.getDownloadDirectory();
|
||||
int n;
|
||||
if (mDownloadLocation.contains(Environment.DIRECTORY_DOWNLOADS)) {
|
||||
n = 1;
|
||||
} else {
|
||||
n = 2;
|
||||
}
|
||||
|
||||
picker.setSingleChoiceItems(R.array.download_folder, n - 1,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
switch (which + 1) {
|
||||
case 1:
|
||||
mPreferences.setDownloadDirectory(Environment.DIRECTORY_DOWNLOADS);
|
||||
downloadloc.setSummary(Constants.EXTERNAL_STORAGE + '/'
|
||||
+ Environment.DIRECTORY_DOWNLOADS);
|
||||
break;
|
||||
case 2:
|
||||
downPicker();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
picker.setNeutralButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
}
|
||||
});
|
||||
picker.show();
|
||||
}
|
||||
|
||||
public void agentDialog() {
|
||||
AlertDialog.Builder agentPicker = new AlertDialog.Builder(mActivity);
|
||||
agentPicker.setTitle(getResources().getString(R.string.title_user_agent));
|
||||
mAgentChoice = mPreferences.getUserAgentChoice();
|
||||
agentPicker.setSingleChoiceItems(R.array.user_agent, mAgentChoice - 1,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
mPreferences.setUserAgentChoice(which + 1);
|
||||
switch (which + 1) {
|
||||
case 1:
|
||||
useragent.setSummary(getResources().getString(R.string.agent_default));
|
||||
break;
|
||||
case 2:
|
||||
useragent.setSummary(getResources().getString(R.string.agent_desktop));
|
||||
break;
|
||||
case 3:
|
||||
useragent.setSummary(getResources().getString(R.string.agent_mobile));
|
||||
break;
|
||||
case 4:
|
||||
useragent.setSummary(getResources().getString(R.string.agent_custom));
|
||||
agentPicker();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
agentPicker.setNeutralButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
}
|
||||
});
|
||||
agentPicker.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
Log.i("Cancelled", "");
|
||||
}
|
||||
});
|
||||
agentPicker.show();
|
||||
}
|
||||
|
||||
public void agentPicker() {
|
||||
final AlertDialog.Builder agentStringPicker = new AlertDialog.Builder(mActivity);
|
||||
agentStringPicker.setTitle(getResources().getString(R.string.title_user_agent));
|
||||
final EditText getAgent = new EditText(mActivity);
|
||||
agentStringPicker.setView(getAgent);
|
||||
agentStringPicker.setPositiveButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String text = getAgent.getText().toString();
|
||||
mPreferences.setUserAgentString(text);
|
||||
useragent.setSummary(getResources().getString(R.string.agent_custom));
|
||||
}
|
||||
});
|
||||
agentStringPicker.show();
|
||||
}
|
||||
|
||||
public void downPicker() {
|
||||
final AlertDialog.Builder downLocationPicker = new AlertDialog.Builder(mActivity);
|
||||
LinearLayout layout = new LinearLayout(mActivity);
|
||||
downLocationPicker.setTitle(getResources().getString(R.string.title_download_location));
|
||||
final EditText getDownload = new EditText(mActivity);
|
||||
getDownload.setText(mPreferences.getDownloadDirectory());
|
||||
|
||||
int padding = Utils.convertDpToPixels(10);
|
||||
|
||||
TextView v = new TextView(mActivity);
|
||||
v.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
|
||||
v.setTextColor(Color.DKGRAY);
|
||||
v.setText(Constants.EXTERNAL_STORAGE + '/');
|
||||
v.setPadding(padding, padding, 0, padding);
|
||||
layout.addView(v);
|
||||
layout.addView(getDownload);
|
||||
if (API < 16) {
|
||||
layout.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.edit_text));
|
||||
} else {
|
||||
layout.setBackground(getResources().getDrawable(android.R.drawable.edit_text));
|
||||
}
|
||||
downLocationPicker.setView(layout);
|
||||
downLocationPicker.setPositiveButton(getResources().getString(R.string.action_ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String text = getDownload.getText().toString();
|
||||
mPreferences.setDownloadDirectory(text);
|
||||
downloadloc.setSummary(Constants.EXTERNAL_STORAGE + '/' + text);
|
||||
}
|
||||
});
|
||||
downLocationPicker.show();
|
||||
}
|
||||
|
||||
private void setSearchEngineSummary(int which) {
|
||||
switch (which) {
|
||||
case 0:
|
||||
searchUrlPicker();
|
||||
break;
|
||||
case 1:
|
||||
searchengine.setSummary("Google");
|
||||
break;
|
||||
case 2:
|
||||
searchengine.setSummary("Ask");
|
||||
break;
|
||||
case 3:
|
||||
searchengine.setSummary("Bing");
|
||||
break;
|
||||
case 4:
|
||||
searchengine.setSummary("Yahoo");
|
||||
break;
|
||||
case 5:
|
||||
searchengine.setSummary("StartPage");
|
||||
break;
|
||||
case 6:
|
||||
searchengine.setSummary("StartPage (Mobile)");
|
||||
break;
|
||||
case 7:
|
||||
searchengine.setSummary("DuckDuckGo");
|
||||
break;
|
||||
case 8:
|
||||
searchengine.setSummary("DuckDuckGo Lite");
|
||||
break;
|
||||
case 9:
|
||||
searchengine.setSummary("Baidu");
|
||||
break;
|
||||
case 10:
|
||||
searchengine.setSummary("Yandex");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
switch (preference.getKey()) {
|
||||
case SETTINGS_PROXY:
|
||||
proxyChoicePicker();
|
||||
return true;
|
||||
case SETTINGS_USERAGENT:
|
||||
agentDialog();
|
||||
return true;
|
||||
case SETTINGS_DOWNLOAD:
|
||||
downloadLocDialog();
|
||||
return true;
|
||||
case SETTINGS_HOME:
|
||||
homepageDialog();
|
||||
return true;
|
||||
case SETTINGS_SEARCHENGINE:
|
||||
searchDialog();
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -206,7 +557,7 @@ public class GeneralSettingsFragment extends PreferenceFragment implements Prefe
|
||||
mPreferences.setFlashSupport(0);
|
||||
}
|
||||
|
||||
// TODO: fix toast on flash cb click
|
||||
// TODO: fix open info dialog on flash ceckbox click
|
||||
if (!Utils.isFlashInstalled(mActivity) && cbFlash.isChecked()) {
|
||||
Utils.createInformativeDialog(mActivity,
|
||||
mActivity.getResources().getString(R.string.title_warning),
|
||||
@ -236,6 +587,10 @@ public class GeneralSettingsFragment extends PreferenceFragment implements Prefe
|
||||
mPreferences.setColorModeEnabled((Boolean) newValue);
|
||||
cbColorMode.setChecked((Boolean) newValue);
|
||||
return true;
|
||||
case SETTINGS_GOOGLESUGGESTIONS:
|
||||
mPreferences.setGoogleSearchSuggestionsEnabled((Boolean) newValue);
|
||||
cbgooglesuggest.setChecked((Boolean) newValue);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -4,21 +4,50 @@
|
||||
package acr.browser.lightning.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceFragment;
|
||||
import android.provider.Browser;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.CookieSyncManager;
|
||||
import android.webkit.WebIconDatabase;
|
||||
import android.webkit.WebStorage;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewDatabase;
|
||||
|
||||
import acr.browser.lightning.R;
|
||||
import acr.browser.lightning.database.HistoryDatabase;
|
||||
import acr.browser.lightning.preference.PreferenceManager;
|
||||
import acr.browser.lightning.utils.Utils;
|
||||
|
||||
public class PrivacySettingsFragment extends PreferenceFragment {
|
||||
public class PrivacySettingsFragment extends PreferenceFragment implements Preference.OnPreferenceClickListener, Preference.OnPreferenceChangeListener {
|
||||
|
||||
private static final String SETTINGS_LOCATION = "location";
|
||||
private static final String SETTINGS_THIRDPCOOKIES = "third_party";
|
||||
private static final String SETTINGS_SAVEPASSWORD = "password";
|
||||
private static final String SETTINGS_CACHEEXIT = "clear_cache_exit";
|
||||
private static final String SETTINGS_HISTORYEXIT = "clear_history_exit";
|
||||
private static final String SETTINGS_COOKIEEXIT = "clear_cookies_exit";
|
||||
private static final String SETTINGS_SYNCHISTORY = "sync_history";
|
||||
private static final String SETTINGS_CLEARCACHE = "clear_cache";
|
||||
private static final String SETTINGS_CLEARHISTORY = "clear_history";
|
||||
private static final String SETTINGS_CLEARCOOKIES = "clear_cookies";
|
||||
|
||||
private static final int API = android.os.Build.VERSION.SDK_INT;
|
||||
private Activity mActivity;
|
||||
private PreferenceManager mPreferences;
|
||||
private CheckBoxPreference cblocation, cb3cookies, cbsavepasswords, cbcacheexit, cbhistoryexit,
|
||||
cbcookiesexit, synchistory;
|
||||
cbcookiesexit, cbsynchistory;
|
||||
private Preference clearcache, clearhistory, clearcookies;
|
||||
private boolean mSystemBrowser;
|
||||
private Handler messageHandler;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@ -34,5 +63,221 @@ public class PrivacySettingsFragment extends PreferenceFragment {
|
||||
private void initPrefs() {
|
||||
// mPreferences storage
|
||||
mPreferences = PreferenceManager.getInstance();
|
||||
mSystemBrowser = mPreferences.getSystemBrowserPresent();
|
||||
|
||||
clearcache = findPreference(SETTINGS_CLEARCACHE);
|
||||
clearhistory = findPreference(SETTINGS_CLEARHISTORY);
|
||||
clearcookies = findPreference(SETTINGS_CLEARCOOKIES);
|
||||
cblocation = (CheckBoxPreference) findPreference(SETTINGS_LOCATION);
|
||||
cb3cookies = (CheckBoxPreference) findPreference(SETTINGS_THIRDPCOOKIES);
|
||||
cbsavepasswords = (CheckBoxPreference) findPreference(SETTINGS_SAVEPASSWORD);
|
||||
cbcacheexit = (CheckBoxPreference) findPreference(SETTINGS_CACHEEXIT);
|
||||
cbhistoryexit = (CheckBoxPreference) findPreference(SETTINGS_HISTORYEXIT);
|
||||
cbcookiesexit = (CheckBoxPreference) findPreference(SETTINGS_COOKIEEXIT);
|
||||
cbsynchistory = (CheckBoxPreference) findPreference(SETTINGS_SYNCHISTORY);
|
||||
|
||||
clearcache.setOnPreferenceClickListener(this);
|
||||
clearhistory.setOnPreferenceClickListener(this);
|
||||
clearcookies.setOnPreferenceClickListener(this);
|
||||
cblocation.setOnPreferenceChangeListener(this);
|
||||
cb3cookies.setOnPreferenceChangeListener(this);
|
||||
cbsavepasswords.setOnPreferenceChangeListener(this);
|
||||
cbcacheexit.setOnPreferenceChangeListener(this);
|
||||
cbhistoryexit.setOnPreferenceChangeListener(this);
|
||||
cbcookiesexit.setOnPreferenceChangeListener(this);
|
||||
cbsynchistory.setOnPreferenceChangeListener(this);
|
||||
|
||||
cblocation.setChecked(mPreferences.getLocationEnabled());
|
||||
cbsavepasswords.setChecked(mPreferences.getSavePasswordsEnabled());
|
||||
cbcacheexit.setChecked(mPreferences.getClearCacheExit());
|
||||
cbhistoryexit.setChecked(mPreferences.getClearHistoryExitEnabled());
|
||||
cbcookiesexit.setChecked(mPreferences.getClearCookiesExitEnabled());
|
||||
cb3cookies.setChecked(mPreferences.getBlockThirdPartyCookiesEnabled());
|
||||
|
||||
cb3cookies.setEnabled(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP);
|
||||
|
||||
if (!mSystemBrowser) {
|
||||
cbsynchistory.setChecked(false);
|
||||
cbsynchistory.setEnabled(false);
|
||||
cbsynchistory.setSummary(getResources().getString(R.string.stock_browser_unavailable));
|
||||
} else {
|
||||
cbsynchistory.setEnabled(true);
|
||||
cbsynchistory.setChecked(mPreferences.getSyncHistoryEnabled());
|
||||
cbsynchistory.setSummary(getResources().getString(R.string.stock_browser_available));
|
||||
}
|
||||
|
||||
messageHandler = new MessageHandler(mActivity);
|
||||
}
|
||||
|
||||
private static class MessageHandler extends Handler {
|
||||
|
||||
final Context mHandlerContext;
|
||||
|
||||
public MessageHandler(Context context) {
|
||||
this.mHandlerContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
switch (msg.what) {
|
||||
case 1:
|
||||
Utils.showToast(mHandlerContext, mHandlerContext.getResources()
|
||||
.getString(R.string.message_clear_history));
|
||||
break;
|
||||
case 2:
|
||||
Utils.showToast(mHandlerContext, mHandlerContext.getResources().getString(
|
||||
R.string.message_cookies_cleared));
|
||||
break;
|
||||
}
|
||||
super.handleMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
switch (preference.getKey()) {
|
||||
case SETTINGS_CLEARCACHE:
|
||||
clearCache();
|
||||
return true;
|
||||
case SETTINGS_CLEARHISTORY:
|
||||
clearHistoryDialog();
|
||||
return true;
|
||||
case SETTINGS_CLEARCOOKIES:
|
||||
clearCookiesDialog();
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void clearHistoryDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
|
||||
builder.setTitle(getResources().getString(R.string.title_clear_history));
|
||||
builder.setMessage(getResources().getString(R.string.dialog_history))
|
||||
.setPositiveButton(getResources().getString(R.string.action_yes),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface arg0, int arg1) {
|
||||
Thread clear = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
clearHistory();
|
||||
}
|
||||
});
|
||||
clear.start();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.action_no),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface arg0, int arg1) {
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
|
||||
private void clearCookiesDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
|
||||
builder.setTitle(getResources().getString(R.string.title_clear_cookies));
|
||||
builder.setMessage(getResources().getString(R.string.dialog_cookies))
|
||||
.setPositiveButton(getResources().getString(R.string.action_yes),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface arg0, int arg1) {
|
||||
Thread clear = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
clearCookies();
|
||||
}
|
||||
});
|
||||
clear.start();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.action_no),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface arg0, int arg1) {
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
|
||||
private void clearCache() {
|
||||
WebView webView = new WebView(mActivity);
|
||||
webView.clearCache(true);
|
||||
webView.destroy();
|
||||
Utils.showToast(mActivity, getResources().getString(R.string.message_cache_cleared));
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void clearHistory() {
|
||||
mActivity.deleteDatabase(HistoryDatabase.DATABASE_NAME);
|
||||
WebViewDatabase m = WebViewDatabase.getInstance(mActivity);
|
||||
m.clearFormData();
|
||||
m.clearHttpAuthUsernamePassword();
|
||||
if (API < 18) {
|
||||
m.clearUsernamePassword();
|
||||
WebIconDatabase.getInstance().removeAllIcons();
|
||||
}
|
||||
if (mSystemBrowser) {
|
||||
try {
|
||||
Browser.clearHistory(mActivity.getContentResolver());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
Utils.trimCache(mActivity);
|
||||
messageHandler.sendEmptyMessage(1);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void clearCookies() {
|
||||
// TODO Break out web storage deletion into its own option/action
|
||||
// TODO clear web storage for all sites that are visited in Incognito mode
|
||||
WebStorage storage = WebStorage.getInstance();
|
||||
storage.deleteAllData();
|
||||
CookieManager c = CookieManager.getInstance();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
c.removeAllCookies(null);
|
||||
} else {
|
||||
CookieSyncManager.createInstance(mActivity);
|
||||
c.removeAllCookie();
|
||||
}
|
||||
messageHandler.sendEmptyMessage(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
// switch preferences
|
||||
switch (preference.getKey()) {
|
||||
case SETTINGS_LOCATION:
|
||||
mPreferences.setLocationEnabled((Boolean) newValue);
|
||||
cblocation.setChecked((Boolean) newValue);
|
||||
return true;
|
||||
case SETTINGS_THIRDPCOOKIES:
|
||||
mPreferences.setBlockThirdPartyCookiesEnabled((Boolean) newValue);
|
||||
cb3cookies.setChecked((Boolean) newValue);
|
||||
return true;
|
||||
case SETTINGS_SAVEPASSWORD:
|
||||
mPreferences.setSavePasswordsEnabled((Boolean) newValue);
|
||||
cbsavepasswords.setChecked((Boolean) newValue);
|
||||
return true;
|
||||
case SETTINGS_CACHEEXIT:
|
||||
mPreferences.setClearCacheExit((Boolean) newValue);
|
||||
cbcacheexit.setChecked((Boolean) newValue);
|
||||
return true;
|
||||
case SETTINGS_HISTORYEXIT:
|
||||
mPreferences.setClearHistoryExitEnabled((Boolean) newValue);
|
||||
cbhistoryexit.setChecked((Boolean) newValue);
|
||||
return true;
|
||||
case SETTINGS_COOKIEEXIT:
|
||||
mPreferences.setClearCookiesExitEnabled((Boolean) newValue);
|
||||
cbcookiesexit.setChecked((Boolean) newValue);
|
||||
return true;
|
||||
case SETTINGS_SYNCHISTORY:
|
||||
mPreferences.setSyncHistoryEnabled((Boolean) newValue);
|
||||
cbsynchistory.setChecked((Boolean) newValue);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,267 +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/rAllowPopups"
|
||||
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/window"
|
||||
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/cbAllowPopups"
|
||||
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/rAllowCookies"
|
||||
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/cookies"
|
||||
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/cbAllowCookies"
|
||||
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/rAllowIncognitoCookies"
|
||||
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:paddingLeft="16dp"
|
||||
android:paddingRight="30dp"
|
||||
android:text="@string/incognito_cookies"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
</LinearLayout>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbAllowIncognitoCookies"
|
||||
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/rRestoreTabs"
|
||||
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/restore"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbRestoreTabs"
|
||||
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/layoutRendering"
|
||||
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/rendering_mode"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/renderText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:text="Small Text"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/light" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rUrlBarContents"
|
||||
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/url_contents"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/urlText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:text="Small Text"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/light" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
@ -1,238 +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/layoutUserAgent"
|
||||
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/textView4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:text="@string/agent"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/agentText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:text="Small Text"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/light" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layoutDownload"
|
||||
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/textView5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:text="@string/download"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/downloadText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:text="Small Text"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/light" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layoutHomepage"
|
||||
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/textView6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:text="@string/home"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/homepageText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:text="Small Text"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/light" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layoutSearch"
|
||||
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:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:text="@string/search"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/searchText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:text="Small Text"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/light" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rGoogleSuggestions"
|
||||
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:paddingLeft="16dp"
|
||||
android:paddingRight="30dp"
|
||||
android:text="@string/google_suggestions"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="30dp"
|
||||
android:text="@string/powered_by_google"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/light" />
|
||||
</LinearLayout>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbGoogleSuggestions"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
@ -1,378 +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/rLocation"
|
||||
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="30dp"
|
||||
android:text="@string/location"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbLocation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rThirdParty"
|
||||
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/third_party"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbThirdParty"
|
||||
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/rSavePasswords"
|
||||
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/password"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
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/cbSavePasswords"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rClearCacheExit"
|
||||
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/textView4"
|
||||
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/cache"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbClearCacheExit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rClearHistoryExit"
|
||||
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/clear_history_exit"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbClearHistoryExit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rClearCookiesExit"
|
||||
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/clear_cookies_exit"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbClearCookiesExit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rBrowserHistory"
|
||||
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:paddingLeft="16dp"
|
||||
android:paddingRight="30dp"
|
||||
android:text="@string/sync_history"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/isBrowserAvailable"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:text="text"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/light" />
|
||||
</LinearLayout>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbBrowserHistory"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rClearCache"
|
||||
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/clear_cache"
|
||||
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/rClearHistory"
|
||||
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/history"
|
||||
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/rClearCookies"
|
||||
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/clear_cookies"
|
||||
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,20 +25,22 @@
|
||||
android:defaultValue="true"
|
||||
android:key="cb_colormode"
|
||||
android:title="@string/color_mode" />
|
||||
<Preference
|
||||
android:key="agent"
|
||||
android:title="@string/agent" />
|
||||
<Preference
|
||||
android:key="download"
|
||||
android:title="@string/download" />
|
||||
<Preference
|
||||
android:key="home"
|
||||
android:title="@string/home" />
|
||||
<Preference
|
||||
android:key="search"
|
||||
android:title="@string/search" />
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="google_suggestions"
|
||||
android:title="@string/google_suggestions"
|
||||
android:summary="@string/powered_by_google" />
|
||||
</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/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>
|
@ -3,11 +3,11 @@
|
||||
|
||||
<PreferenceCategory android:title="@string/settings_privacy">
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:defaultValue="true"
|
||||
android:key="location"
|
||||
android:title="@string/location" />
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:defaultValue="false"
|
||||
android:key="third_party"
|
||||
android:title="@string/third_party" />
|
||||
<CheckBoxPreference
|
||||
@ -16,7 +16,7 @@
|
||||
android:title="@string/password"
|
||||
android:summary="@string/recommended" />
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:defaultValue="false"
|
||||
android:key="clear_cache_exit"
|
||||
android:title="@string/cache" />
|
||||
<CheckBoxPreference
|
||||
|
Loading…
x
Reference in New Issue
Block a user