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,6 +14,7 @@ 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;
@ -22,8 +23,10 @@ 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) {
@ -35,6 +38,7 @@ public class DisplaySettingsActivity extends ThemableSettingsActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mPreferences = PreferenceManager.getInstance(); mPreferences = PreferenceManager.getInstance();
mThemeOptions = this.getResources().getStringArray(R.array.themes);
initialize(); initialize();
} }
@ -56,7 +60,7 @@ public class DisplaySettingsActivity extends ThemableSettingsActivity {
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);
@ -66,26 +70,28 @@ public class DisplaySettingsActivity extends ThemableSettingsActivity {
rTextSize.setOnClickListener(clickListener); rTextSize.setOnClickListener(clickListener);
rDarkTheme.setOnClickListener(clickListener); rDarkTheme.setOnClickListener(clickListener);
mThemeText = (TextView) findViewById(R.id.textViewTheme);
mCurrentTheme = mPreferences.getUseTheme();
mThemeText.setText(mThemeOptions[mPreferences.getUseTheme()]);
cbHideStatusBar = (CheckBox) findViewById(R.id.cbHideStatusBar); cbHideStatusBar = (CheckBox) findViewById(R.id.cbHideStatusBar);
cbFullScreen = (CheckBox) findViewById(R.id.cbFullScreen); cbFullScreen = (CheckBox) findViewById(R.id.cbFullScreen);
cbWideViewPort = (CheckBox) findViewById(R.id.cbWideViewPort); cbWideViewPort = (CheckBox) findViewById(R.id.cbWideViewPort);
cbOverView = (CheckBox) findViewById(R.id.cbOverView); cbOverView = (CheckBox) findViewById(R.id.cbOverView);
cbTextReflow = (CheckBox) findViewById(R.id.cbTextReflow); cbTextReflow = (CheckBox) findViewById(R.id.cbTextReflow);
cbDarkTheme = (CheckBox) findViewById(R.id.cbDarkTheme);
cbHideStatusBar.setChecked(mPreferences.getHideStatusBarEnabled()); cbHideStatusBar.setChecked(mPreferences.getHideStatusBarEnabled());
cbFullScreen.setChecked(mPreferences.getFullScreenEnabled()); cbFullScreen.setChecked(mPreferences.getFullScreenEnabled());
cbWideViewPort.setChecked(mPreferences.getUseWideViewportEnabled()); cbWideViewPort.setChecked(mPreferences.getUseWideViewportEnabled());
cbOverView.setChecked(mPreferences.getOverviewModeEnabled()); cbOverView.setChecked(mPreferences.getOverviewModeEnabled());
cbTextReflow.setChecked(mPreferences.getTextReflowEnabled()); cbTextReflow.setChecked(mPreferences.getTextReflowEnabled());
cbDarkTheme.setChecked(mPreferences.getUseDarkTheme());
cbHideStatusBar.setOnCheckedChangeListener(toggleListener); cbHideStatusBar.setOnCheckedChangeListener(toggleListener);
cbFullScreen.setOnCheckedChangeListener(toggleListener); cbFullScreen.setOnCheckedChangeListener(toggleListener);
cbWideViewPort.setOnCheckedChangeListener(toggleListener); cbWideViewPort.setOnCheckedChangeListener(toggleListener);
cbOverView.setOnCheckedChangeListener(toggleListener); cbOverView.setOnCheckedChangeListener(toggleListener);
cbTextReflow.setOnCheckedChangeListener(toggleListener); cbTextReflow.setOnCheckedChangeListener(toggleListener);
cbDarkTheme.setOnCheckedChangeListener(toggleListener);
} }
private class LayoutClickListener implements OnClickListener { private class LayoutClickListener implements OnClickListener {
@ -111,8 +117,8 @@ public class DisplaySettingsActivity extends ThemableSettingsActivity {
case R.id.rTextSize: case R.id.rTextSize:
textSizePicker(); textSizePicker();
break; break;
case R.id.rDarkTheme: case R.id.rTheme:
cbDarkTheme.setChecked(!cbDarkTheme.isChecked()); themePicker();
break; break;
} }
} }
@ -139,10 +145,6 @@ public class DisplaySettingsActivity extends ThemableSettingsActivity {
case R.id.cbTextReflow: case R.id.cbTextReflow:
mPreferences.setTextReflowEnabled(isChecked); mPreferences.setTextReflowEnabled(isChecked);
break; break;
case R.id.cbDarkTheme:
mPreferences.setUseDarkTheme(isChecked);
restart();
break;
} }
} }
@ -172,4 +174,41 @@ public class DisplaySettingsActivity extends ThemableSettingsActivity {
}); });
picker.show(); 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,15 +9,17 @@ 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) {
setTheme(R.style.Theme_BlackTheme);
} }
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
@ -25,7 +27,7 @@ public abstract class ThemableActivity extends AppCompatActivity {
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
if (PreferenceManager.getInstance().getUseDarkTheme() != mDark) { if (PreferenceManager.getInstance().getUseTheme() != mTheme) {
restart(); restart();
} }
} }

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,15 +10,18 @@ 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) {
setTheme(R.style.Theme_SettingsTheme_Black);
this.getWindow().setBackgroundDrawable(new ColorDrawable(this.getResources().getColor(R.color.black)));
} }
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
@ -25,7 +29,7 @@ public abstract class ThemableSettingsActivity extends AppCompatActivity {
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
if (PreferenceManager.getInstance().getUseDarkTheme() != mDark) { if (PreferenceManager.getInstance().getUseTheme() != mTheme) {
restart(); restart();
} }
} }

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,14 +87,21 @@
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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -103,15 +110,20 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:paddingRight="30dp" android:paddingRight="30dp"
android:text="@string/dark_theme" android:text="@string/theme"
android:textAppearance="?android:attr/textAppearanceMedium" /> android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox <TextView
android:id="@+id/cbDarkTheme" android:id="@+id/textViewTheme"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:paddingLeft="16dp"
android:layout_centerVertical="true" /> android:paddingRight="30dp"
android:text="CURRENT THEME"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/light" />
</LinearLayout>
</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>