DF1E
9 years ago
11 changed files with 779 additions and 2130 deletions
@ -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); |
|
||||||
} |
|
||||||
} |
|
@ -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> |
|
Loading…
Reference in new issue