Added an AMOLED Black theme, changed from tabs to spaces for some files

This commit is contained in:
Anthony Restaino 2015-05-13 10:35:32 -04:00
parent b400ef0647
commit 9f8dff8c5d
15 changed files with 394 additions and 216 deletions

View File

@ -162,7 +162,8 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
ActionBar actionBar = getSupportActionBar(); ActionBar actionBar = getSupportActionBar();
mPreferences = PreferenceManager.getInstance(); mPreferences = PreferenceManager.getInstance();
mDarkTheme = mPreferences.getUseDarkTheme() || isIncognito(); //TODO make sure dark theme flag gets set correctly
mDarkTheme = mPreferences.getUseTheme() != 0 || isIncognito();
mActivity = this; mActivity = this;
mWebViews.clear(); mWebViews.clear();

View File

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

View File

@ -9,33 +9,35 @@ import acr.browser.lightning.preference.PreferenceManager;
public abstract class ThemableActivity extends AppCompatActivity { public abstract class ThemableActivity extends AppCompatActivity {
private boolean mDark; private int mTheme;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
mDark = PreferenceManager.getInstance().getUseDarkTheme(); mTheme = PreferenceManager.getInstance().getUseTheme();
// set the theme // set the theme
if (mDark) { if (mTheme == 1) {
setTheme(R.style.Theme_DarkTheme); setTheme(R.style.Theme_DarkTheme);
} } else if (mTheme == 2) {
super.onCreate(savedInstanceState); setTheme(R.style.Theme_BlackTheme);
} }
super.onCreate(savedInstanceState);
}
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
if (PreferenceManager.getInstance().getUseDarkTheme() != mDark) { if (PreferenceManager.getInstance().getUseTheme() != mTheme) {
restart(); restart();
} }
} }
protected void restart() { protected void restart() {
final Bundle outState = new Bundle(); final Bundle outState = new Bundle();
onSaveInstanceState(outState); onSaveInstanceState(outState);
final Intent intent = new Intent(this, getClass()); final Intent intent = new Intent(this, getClass());
finish(); finish();
overridePendingTransition(0, 0); overridePendingTransition(0, 0);
startActivity(intent); startActivity(intent);
} }
} }

View File

@ -1,6 +1,7 @@
package acr.browser.lightning.activity; package acr.browser.lightning.activity;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
@ -9,33 +10,36 @@ import acr.browser.lightning.preference.PreferenceManager;
public abstract class ThemableSettingsActivity extends AppCompatActivity { public abstract class ThemableSettingsActivity extends AppCompatActivity {
private boolean mDark; private int mTheme;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
mDark = PreferenceManager.getInstance().getUseDarkTheme(); mTheme = PreferenceManager.getInstance().getUseTheme();
// set the theme // set the theme
if (mDark) { if (mTheme == 1) {
setTheme(R.style.Theme_SettingsTheme_Dark); setTheme(R.style.Theme_SettingsTheme_Dark);
} } else if (mTheme == 2) {
super.onCreate(savedInstanceState); setTheme(R.style.Theme_SettingsTheme_Black);
} this.getWindow().setBackgroundDrawable(new ColorDrawable(this.getResources().getColor(R.color.black)));
}
super.onCreate(savedInstanceState);
}
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
if (PreferenceManager.getInstance().getUseDarkTheme() != mDark) { if (PreferenceManager.getInstance().getUseTheme() != mTheme) {
restart(); restart();
} }
} }
protected void restart() { protected void restart() {
final Bundle outState = new Bundle(); final Bundle outState = new Bundle();
onSaveInstanceState(outState); onSaveInstanceState(outState);
final Intent intent = new Intent(this, getClass()); final Intent intent = new Intent(this, getClass());
finish(); finish();
overridePendingTransition(0, 0); overridePendingTransition(0, 0);
startActivity(intent); startActivity(intent);
} }
} }

View File

@ -116,6 +116,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable {
if (!mUseGoogle && mSuggestions != null) { if (!mUseGoogle && mSuggestions != null) {
mSuggestions.clear(); mSuggestions.clear();
} }
mDatabaseHandler = HistoryDatabase.getInstance(mContext.getApplicationContext());
} }
public void refreshBookmarks() { public void refreshBookmarks() {

View File

@ -45,7 +45,7 @@ public class PreferenceManager {
public static final String URL_BOX_CONTENTS = "urlContent"; public static final String URL_BOX_CONTENTS = "urlContent";
public static final String INVERT_COLORS = "invertColors"; public static final String INVERT_COLORS = "invertColors";
public static final String READING_TEXT_SIZE = "readingTextSize"; public static final String READING_TEXT_SIZE = "readingTextSize";
public static final String DARK_THEME = "darkTheme"; public static final String THEME = "Theme";
public static final String DEFAULT_BOOKMARKS = "defaultBookmarks"; public static final String DEFAULT_BOOKMARKS = "defaultBookmarks";
public static final String USE_PROXY = "useProxy"; public static final String USE_PROXY = "useProxy";
@ -218,8 +218,8 @@ public class PreferenceManager {
return mPrefs.getInt(Name.URL_BOX_CONTENTS, 0); return mPrefs.getInt(Name.URL_BOX_CONTENTS, 0);
} }
public boolean getUseDarkTheme() { public int getUseTheme() {
return mPrefs.getBoolean(Name.DARK_THEME, false); return mPrefs.getInt(Name.THEME, 0);
} }
public boolean getUseProxy() { public boolean getUseProxy() {
@ -390,8 +390,8 @@ public class PreferenceManager {
putInt(Name.URL_BOX_CONTENTS, choice); putInt(Name.URL_BOX_CONTENTS, choice);
} }
public void setUseDarkTheme(boolean use) { public void setUseTheme(int theme) {
putBoolean(Name.DARK_THEME, use); putInt(Name.THEME, theme);
} }
public void setUseProxy(boolean enable) { public void setUseProxy(boolean enable) {

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape
android:shape="rectangle" >
<solid android:color="@color/black" />
</shape>
</item>
<item android:bottom="1dp">
<shape
android:shape="rectangle" >
<solid android:color="@color/black" />
</shape>
</item>
</layer-list>

View File

@ -2,19 +2,19 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" > android:orientation="vertical">
<include layout="@layout/toolbar_settings" /> <include layout="@layout/toolbar_settings" />
<ScrollView <ScrollView
android:id="@+id/scrollView1" android:id="@+id/scrollView1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" > android:layout_height="match_parent">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" > android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:id="@+id/rHideStatusBar" android:id="@+id/rHideStatusBar"
@ -24,7 +24,7 @@
android:minHeight="60dp" android:minHeight="60dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:paddingRight="10dp" android:paddingRight="10dp"
android:paddingTop="10dp" > android:paddingTop="10dp">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -59,7 +59,7 @@
android:minHeight="60dp" android:minHeight="60dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:paddingRight="10dp" android:paddingRight="10dp"
android:paddingTop="10dp" > android:paddingTop="10dp">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -87,31 +87,43 @@
android:background="?attr/dividerColor" /> android:background="?attr/dividerColor" />
<RelativeLayout <RelativeLayout
android:id="@+id/rDarkTheme" android:id="@+id/rTheme"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/listChoiceBackgroundIndicator" android:background="?attr/listChoiceBackgroundIndicator"
android:minHeight="60dp" android:minHeight="60dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:paddingRight="10dp" android:paddingRight="10dp"
android:paddingTop="10dp" > android:paddingTop="10dp">
<TextView <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:paddingLeft="16dp" android:orientation="vertical">
android:paddingRight="30dp"
android:text="@string/dark_theme" <TextView
android:textAppearance="?android:attr/textAppearanceMedium" /> android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="16dp"
android:paddingRight="30dp"
android:text="@string/theme"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textViewTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="30dp"
android:text="CURRENT THEME"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
<CheckBox
android:id="@+id/cbDarkTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
@ -129,14 +141,14 @@
android:minHeight="60dp" android:minHeight="60dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:paddingRight="10dp" android:paddingRight="10dp"
android:paddingTop="10dp" > android:paddingTop="10dp">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:orientation="vertical" > android:orientation="vertical">
<TextView <TextView
android:id="@+id/textView1" android:id="@+id/textView1"
@ -180,14 +192,14 @@
android:minHeight="60dp" android:minHeight="60dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:paddingRight="10dp" android:paddingRight="10dp"
android:paddingTop="10dp" > android:paddingTop="10dp">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:orientation="vertical" > android:orientation="vertical">
<TextView <TextView
android:id="@+id/textView2" android:id="@+id/textView2"
@ -231,7 +243,7 @@
android:minHeight="60dp" android:minHeight="60dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:paddingRight="10dp" android:paddingRight="10dp"
android:paddingTop="10dp" > android:paddingTop="10dp">
<TextView <TextView
android:id="@+id/textView3" android:id="@+id/textView3"
@ -265,7 +277,7 @@
android:background="?attr/listChoiceBackgroundIndicator" android:background="?attr/listChoiceBackgroundIndicator"
android:minHeight="60dp" android:minHeight="60dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:paddingTop="10dp" > android:paddingTop="10dp">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -211,7 +211,7 @@
<item >Cím</item> <item >Cím</item>
</string-array> </string-array>
<string name="invert_color">Negatív szín</string> <string name="invert_color">Negatív szín</string>
<string name="dark_theme">Sötét téma használata</string> <string name="dark_theme">Sötét téma </string>
<string name="change_after_restart">A téma megváltoztatásának érvénybelépéséhez indítsa újra a böngészőt.</string> <string name="change_after_restart">A téma megváltoztatásának érvénybelépéséhez indítsa újra a böngészőt.</string>
<string name="tabs">Lapok</string> <string name="tabs">Lapok</string>
</resources> </resources>

View File

@ -211,7 +211,7 @@
<item >Título</item> <item >Título</item>
</string-array> </string-array>
<string name="invert_color">Inverter cores</string> <string name="invert_color">Inverter cores</string>
<string name="dark_theme">Utilizar tema escuro</string> <string name="dark_theme">Tema escuro</string>
<string name="change_after_restart">Esta opção será aplicada depois de reiniciar a aplicação.</string> <string name="change_after_restart">Esta opção será aplicada depois de reiniciar a aplicação.</string>
<string name="tabs">Separadores</string> <string name="tabs">Separadores</string>
</resources> </resources>

View File

@ -208,7 +208,7 @@
<item >Наслов</item> <item >Наслов</item>
</string-array> </string-array>
<string name="invert_color">Обрнута боја</string> <string name="invert_color">Обрнута боја</string>
<string name="dark_theme">Тамна тема</string>
<string name="change_after_restart">Промена теме ће бити извршена по поновном покретању прегледача.</string> <string name="change_after_restart">Промена теме ће бити извршена по поновном покретању прегледача.</string>
<string name="tabs">Језичци</string> <string name="tabs">Језичци</string>
<string name="dark_theme">Тамна тема</string>
</resources> </resources>

View File

@ -33,6 +33,22 @@
<item name="dividerColor">@color/divider_dark</item> <item name="dividerColor">@color/divider_dark</item>
</style> </style>
<style name="Theme.SettingsTheme.Black" parent="Theme.AppCompat">
<!-- customize the color palette -->
<item name="toolbarSettingsBackground">@color/black</item>
<item name="listBackground">?attr/listChoiceBackgroundIndicator</item>
<item name="colorPrimary">@color/black</item>
<item name="colorPrimaryDark">@color/black</item>
<item name="colorAccent">@color/accent_color</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowContentOverlay">@null</item>
<item name="invertColorDrawable">@drawable/ic_action_invert_dark</item>
<item name="textSizeDrawable">@drawable/ic_action_text_size_dark</item>
<item name="dividerColor">@color/divider_dark</item>
</style>
<style name="Theme.LightTheme" parent="Theme.AppCompat.Light"> <style name="Theme.LightTheme" parent="Theme.AppCompat.Light">
<!-- customize the color palette --> <!-- customize the color palette -->
@ -101,4 +117,35 @@
<item name="android:windowTranslucentStatus">false</item> <item name="android:windowTranslucentStatus">false</item>
</style> </style>
<style name="Theme.BlackTheme" parent="Theme.AppCompat">
<!-- customize the color palette -->
<item name="searchBackground">@drawable/card_bg_elevate</item>
<item name="colorPrimary">@color/black</item>
<item name="colorPrimaryDark">@color/black</item>
<item name="colorAccent">@color/accent_color</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="progressBackgroundColor">#00000000</item>
<item name="listBackground">?attr/listChoiceBackgroundIndicator</item>
<item name="android:windowContentOverlay">@null</item>
<item name="progressColor">@color/gray_medium</item>
<item name="numberColor">@color/gray_dark</item>
<item name="autoCompleteTitleColor">@color/black</item>
<item name="autoCompleteUrlColor">@color/gray_medium</item>
<item name="arrowBackDrawable">@drawable/ic_action_back_dark</item>
<item name="arrowForwardDrawable">@drawable/ic_action_forward_dark</item>
<item name="actionOverflowButtonStyle">@style/overFlowButtonStyle</item>
<item name="drawerBackground">@color/black</item>
<item name="plusDrawable">@drawable/ic_action_plus_dark</item>
<item name="deleteDrawable">@drawable/ic_action_delete_dark</item>
<item name="starDrawable">@drawable/ic_action_star_dark</item>
<item name="tabDrawable">@drawable/ic_action_tabs_dark</item>
<item name="dividerColor">@color/black</item>
<item name="selectedBackground">@drawable/list_bg_dark</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@color/black</item>
<item name="android:windowTranslucentStatus">false</item>
</style>
</resources> </resources>

View File

@ -26,4 +26,10 @@
<item>@string/size_small</item> <item>@string/size_small</item>
<item>@string/size_smallest</item> <item>@string/size_smallest</item>
</string-array> </string-array>
<string-array name="themes">
<item>@string/light_theme</item>
<item>@string/dark_theme</item>
<item>@string/black_theme</item>
</string-array>
</resources> </resources>

View File

@ -211,7 +211,10 @@
<item >Title</item> <item >Title</item>
</string-array> </string-array>
<string name="invert_color">Invert color</string> <string name="invert_color">Invert color</string>
<string name="dark_theme">Use Dark Theme</string> <string name="dark_theme">Dark Theme</string>
<string name="change_after_restart">The theme change will take effect after you restart the browser.</string> <string name="change_after_restart">The theme change will take effect after you restart the browser.</string>
<string name="tabs">Tabs</string> <string name="tabs">Tabs</string>
<string name="theme">App Theme</string>
<string name="light_theme">Light Theme</string>
<string name="black_theme">Black Theme (AMOLED)</string>
</resources> </resources>

View File

@ -33,6 +33,22 @@
<item name="dividerColor">@color/divider_dark</item> <item name="dividerColor">@color/divider_dark</item>
</style> </style>
<style name="Theme.SettingsTheme.Black" parent="Theme.AppCompat">
<!-- customize the color palette -->
<item name="toolbarSettingsBackground">@drawable/toolbar_elevate_black</item>
<item name="listBackground">@drawable/list_bg</item>
<item name="colorPrimary">@color/black</item>
<item name="colorPrimaryDark">@color/black</item>
<item name="colorAccent">@color/accent_color</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowContentOverlay">@null</item>
<item name="invertColorDrawable">@drawable/ic_action_invert_dark</item>
<item name="textSizeDrawable">@drawable/ic_action_text_size_dark</item>
<item name="dividerColor">@color/divider_dark</item>
</style>
<style name="Theme.LightTheme" parent="Theme.AppCompat.Light"> <style name="Theme.LightTheme" parent="Theme.AppCompat.Light">
<!-- customize the color palette --> <!-- customize the color palette -->
@ -89,6 +105,34 @@
<item name="selectedBackground">@drawable/list_bg_dark</item> <item name="selectedBackground">@drawable/list_bg_dark</item>
</style> </style>
<style name="Theme.BlackTheme" parent="Theme.AppCompat">
<!-- customize the color palette -->
<item name="searchBackground">@drawable/card_bg_elevate</item>
<item name="colorPrimary">@color/black</item>
<item name="colorPrimaryDark">@color/black</item>
<item name="colorAccent">@color/accent_color</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="progressBackgroundColor">@color/black</item>
<item name="listBackground">@drawable/list_bg</item>
<item name="android:windowContentOverlay">@null</item>
<item name="progressColor">@color/gray_medium</item>
<item name="numberColor">@color/gray_dark</item>
<item name="autoCompleteTitleColor">@color/black</item>
<item name="autoCompleteUrlColor">@color/gray_medium</item>
<item name="arrowBackDrawable">@drawable/ic_action_back_dark</item>
<item name="arrowForwardDrawable">@drawable/ic_action_forward_dark</item>
<item name="actionOverflowButtonStyle">@style/overFlowButtonStyle</item>
<item name="drawerBackground">@color/black</item>
<item name="plusDrawable">@drawable/ic_action_plus_dark</item>
<item name="deleteDrawable">@drawable/ic_action_delete_dark</item>
<item name="starDrawable">@drawable/ic_action_star_dark</item>
<item name="tabDrawable">@drawable/ic_action_tabs_dark</item>
<item name="dividerColor">@color/black</item>
<item name="selectedBackground">@drawable/list_bg_dark</item>
</style>
<style name="overFlowButtonStyle" parent="@style/Widget.AppCompat.ActionButton.Overflow"> <style name="overFlowButtonStyle" parent="@style/Widget.AppCompat.ActionButton.Overflow">
<item name="android:minWidth">48dp</item> <item name="android:minWidth">48dp</item>
<item name="android:padding">0dp</item> <item name="android:padding">0dp</item>