Redo styling

This commit is contained in:
topjohnwu 2017-02-14 16:35:03 +08:00
parent c4afa069df
commit df7a5bf149
8 changed files with 29 additions and 103 deletions

View File

@ -48,7 +48,7 @@ public class AboutActivity extends Activity {
String theme = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("theme", "");
Logger.dev("AboutActivity: Theme is " + theme);
if (getTopApplication().isDarkTheme) {
setTheme(R.style.AppTheme_dh);
setTheme(R.style.AppTheme_Dark);
}
setContentView(R.layout.activity_about);
ButterKnife.bind(this);

View File

@ -7,7 +7,6 @@ import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.app.ActivityCompat;
@ -42,10 +41,10 @@ public class MainActivity extends Activity
@Override
protected void onCreate(final Bundle savedInstanceState) {
prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
prefs = getTopApplication().prefs;
if (getTopApplication().isDarkTheme) {
setTheme(R.style.AppTheme_dh);
setTheme(R.style.AppTheme_Dark);
}
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
@ -81,14 +80,15 @@ public class MainActivity extends Activity
navigationView.setNavigationItemSelectedListener(this);
getTopApplication().reloadMainActivity.register(this);
if (getTopApplication().updateCheckDone.isTriggered)
onTrigger(getTopApplication().updateCheckDone);
}
@Override
protected void onResume() {
super.onResume();
getTopApplication().updateCheckDone.register(this);
// if (getTopApplication().updateCheckDone.isTriggered)
// onTrigger(getTopApplication().updateCheckDone);
checkHideSection();
}

View File

@ -31,7 +31,7 @@ public class SettingsActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getTopApplication().isDarkTheme) {
setTheme(R.style.AppTheme_dh);
setTheme(R.style.AppTheme_Dark);
}
setContentView(R.layout.activity_container);

View File

@ -51,9 +51,8 @@
fab:menu_shadowRadius="4dp"
fab:menu_shadowXOffset="1dp"
fab:menu_shadowYOffset="3dp"
fab:menu_colorNormal="#cddc39"
fab:menu_colorPressed="#9e9d24"
fab:menu_colorRipple="#99FFFFFF"
fab:menu_colorNormal="?android:colorAccent"
fab:menu_colorPressed="?attr/colorAccentFallback"
fab:menu_animationDelayPerItem="50"
fab:menu_icon="@drawable/ic_add"
fab:menu_buttonSpacing="0dp"
@ -64,6 +63,8 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/ic_archive"
fab:fab_colorNormal="?android:colorAccent"
fab:fab_colorPressed="?attr/colorAccentFallback"
fab:fab_size="mini"
fab:fab_label="@string/fab_flash_zip" />

View File

@ -6,7 +6,7 @@
android:gravity="center_vertical"
android:paddingStart="16dp"
android:textAllCaps="true"
android:textColor="@color/accent"
android:textColor="?android:colorAccent"
android:background="@android:color/transparent"
android:textSize="16sp"
android:id="@+id/section_text"

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 dvdandroid
~ Copyright 2017 topjohnwu
~ Copyright 2017 dvdandroid
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@ -28,4 +29,6 @@
<attr name="ColorNeutral" format="reference"/>
</declare-styleable>
<attr name="colorAccentFallback" format="reference" />
</resources>

View File

@ -4,6 +4,7 @@
<color name="primary">#009688</color>
<color name="primary_dark">#00796B</color>
<color name="accent">#FFC107</color>
<color name="accentFallback">#FBC02D</color>
<color name="icon_grey">#757575</color>
<color name="red500">#F44336</color>
@ -12,13 +13,10 @@
<color name="blue500">#2196F3</color>
<color name="yellow500">#FFC107</color>
<color name="dh_primary">#3F51B5</color>
<color name="dh_primary_dark">#303F9F</color>
<color name="dh_accent">#448AFF</color>
<color name="dark_primary">#1a237e</color>
<color name="dark_primary_dark">#000000</color>
<color name="dh_primary_text">#dedede</color>
<color name="dh_icons">#dedede</color>
<color name="dh_divider">#313131</color>
<color name="dark_secondary_text">#dedede</color>
<color name="su_request_background">#e0e0e0</color>

View File

@ -5,6 +5,7 @@
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
<item name="colorAccentFallback">@color/accentFallback</item>
<item name="windowActionModeOverlay">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="cardStyle">@style/CardViewStyle.Light</item>
@ -13,101 +14,24 @@
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="AppTheme.dh" parent="ThemeOverlay.AppCompat.Dark">
<item name="colorPrimary">@color/dh_primary</item>
<item name="colorPrimaryDark">@color/dh_primary_dark</item>
<item name="colorAccent">@color/dh_accent</item>
<style name="AppTheme.Dark" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/dark_primary</item>
<item name="colorPrimaryDark">@color/dark_primary_dark</item>
<item name="colorAccent">@color/accent</item>
<item name="colorAccentFallback">@color/accentFallback</item>
<item name="windowActionModeOverlay">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="cardBackgroundColor">@color/dh_accent</item>
<item name="cardStyle">@style/CardViewStyle.Dark</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="cardStyle">@style/CardViewStyle.Dark</item>
<item name="android:textColorPrimary">@color/dh_primary_text</item>
<item name="android:textColorSecondary">@color/dh_primary_text</item>
<item name="android:alertDialogTheme">@style/AlertDialog.dh</item>
<item name="android:dialogTheme">@style/AlertDialog.dh</item>
<item name="android:actionOverflowButtonStyle">@style/OverFlow</item>
<item name="colorControlNormal">@color/dh_primary_text</item>
<item name="colorControlActivated">@color/dh_accent</item>
<item name="colorControlHighlight">@color/dh_icons</item>
</style>
<style name="OverFlow" parent="@android:style/Widget.ActionBar">
<item name="android:backgroundTint">@color/dh_icons</item>
</style>
<style name="AppTheme.Toolbar.dh" parent="ThemeOverlay.AppCompat.Dark">
<item name="colorPrimary">@color/dh_primary</item>
<item name="android:elevation">4dp</item>
<item name="android:textColorPrimary">@color/dh_primary_text</item>
<item name="android:textColorSecondary">@color/dh_primary_text</item> <!-- force -->
<item name="actionMenuTextColor">@color/dh_icons</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:textColorSecondary">@color/dark_secondary_text</item>
</style>
<style name="CardViewStyle.Dark" parent="CardView">
<item name="cardBackgroundColor">@android:color/background_dark</item>
</style>
<style name="AlertDialog.dh" parent="ThemeOverlay.AppCompat.Dark">
<item name="android:textColor">@color/dh_primary_text</item>
<item name="android:textColorSecondary">@color/dh_primary_text</item>
<item name="colorAccent">@color/dh_accent</item>
<item name="android:textColorPrimary">@color/dh_primary_text</item>
<item name="android:background">@color/dh_divider</item>
<item name="android:textColorAlertDialogListItem">@color/dh_primary_text</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<item name="android:windowTitleStyle">@style/MyTitleTextStyle</item>
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
<item name="android:alertDialogStyle">@style/ListPrefAlertDialogStyle</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:textAppearanceMedium">@style/MyAlertTextAppearance</item>
</style>
<style name="MyAlertTextAppearance">
<!-- Set text size and color of title and message here -->
<item name="android:textColor">@color/dh_primary_text</item>
</style>
<style name="ListPrefAlertDialogStyle">
<item name="android:fullDark" >@android:color/transparent</item>
<item name="android:topDark" >@android:color/transparent</item>
<item name="android:centerDark" >@android:color/transparent</item>
<item name="android:bottomDark" >@android:color/transparent</item>
<item name="android:fullBright" >@android:color/transparent</item>
<item name="android:topBright" >@android:color/transparent</item>
<item name="android:centerBright">@android:color/transparent</item>
<item name="android:bottomBright">@android:color/transparent</item>
<item name="android:bottomMedium">@android:color/transparent</item>
<item name="android:centerMedium">@android:color/transparent</item>
</style>
<style name="ListViewStyle.dh" parent="android:Widget.Material.PopupMenu">
<item name="android:divider">@color/dh_divider</item>
<item name="android:dividerHeight">1dp</item>
<item name="android:listSelector">@android:color/background_dark</item>
<item name="android:drawSelectorOnTop">true</item>
<item name="android:cacheColorHint">@color/dh_divider</item>
<item name="android:foregroundTint">@color/dh_primary_text</item>
</style>
<style name="TransparentListView" parent="@android:style/Widget.ListView">
<item name="android:cacheColorHint">@android:color/transparent</item>
<item name="android:background">#FFFF00</item>
<item name="android:listSelector">@android:color/transparent</item>
<item name="android:divider">#F78181</item>
<item name="android:dividerHeight">3dp</item>
</style>
<style name="MyTitleTextStyle">
<item name="android:textColor">@color/dh_primary_text</item>
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Title</item>
</style>
<style name="CardViewStyle.Light" parent="CardView">
<item name="cardBackgroundColor">@android:color/background_light</item>
</style>