fix #91: Material Design

- use 'com.android.support:appcompat-v7:22.0.0' instead of version 20.0.0
- ActionBar color: "F-Droid Blue" (also option for "F-Droid Green")
- fix invisible swap button with Material Design
- remove "Light + dark action bar" theme (as of Action Bar is always blue/green)
This commit is contained in:
Nico Alt 2015-04-21 21:55:07 +02:00
parent 94096cdc95
commit 315265fbb4
6 changed files with 26 additions and 35 deletions

View File

@ -17,7 +17,7 @@ if ( !hasProperty( 'sourceDeps' ) ) {
dependencies { dependencies {
compile 'com.android.support:support-v4:20.0.0', compile 'com.android.support:support-v4:20.0.0',
'com.android.support:appcompat-v7:20.0.0', 'com.android.support:appcompat-v7:22.0.0',
'com.android.support:support-annotations:20.0.0', 'com.android.support:support-annotations:20.0.0',
'org.thoughtcrime.ssl.pinning:AndroidPinning:1.0.0', 'org.thoughtcrime.ssl.pinning:AndroidPinning:1.0.0',

View File

@ -1,15 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="SwapTheme.StartSwap.StartButton">
<style name="AppBaseThemeDark" parent="Theme.AppCompat"> <item name="android:textColor">#fff</item>
<!-- API 11 theme customizations go here -->
</style> </style>
</resources>
<style name="AppBaseThemeLight" parent="Theme.AppCompat.Light">
<!-- API 11 theme customizations go here -->
</style>
<style name="AppBaseThemeLightWithDarkActionBar" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- API 11 theme customizations go here -->
</style>
</resources>

View File

@ -13,6 +13,5 @@
<string-array name="themeNames"> <string-array name="themeNames">
<item>Dark</item> <item>Dark</item>
<item>Light</item> <item>Light</item>
<item>Light (with dark action bar)</item>
</string-array> </string-array>
</resources> </resources>

View File

@ -27,7 +27,6 @@
<string-array name="themeValues"> <string-array name="themeValues">
<item>dark</item> <item>dark</item>
<item>light</item> <item>light</item>
<item>lightWithDarkActionBar</item>
</string-array> </string-array>
<string-array name="languageValues"> <string-array name="languageValues">

View File

@ -2,14 +2,24 @@
<style name="AppBaseThemeDark" parent="Theme.AppCompat"> <style name="AppBaseThemeDark" parent="Theme.AppCompat">
<!-- backward-compatibility theme options go here --> <!-- backward-compatibility theme options go here -->
<!-- ActionBar Color -->
<!-- "F-Droid Green" -/->
<item name="colorPrimary">#FFAAD024</item>-->
<!-- "F-Droid Blue -->
<item name="colorPrimary">#FF6097C5</item>
</style> </style>
<style name="AppBaseThemeLight" parent="Theme.AppCompat.Light"> <style name="AppBaseThemeLight" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- backward-compatibility theme options go here --> <!-- backward-compatibility theme options go here -->
</style>
<style name="AppBaseThemeLightWithDarkActionBar" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- ActionBar Color -->
<!-- backward-compatibility theme options go here --> <!-- "F-Droid Green" -/->
<item name="colorPrimary">#FFAAD024</item>-->
<!-- "F-Droid Blue -->
<item name="colorPrimary">#FF6097C5</item>
</style> </style>
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
@ -29,24 +39,20 @@
<!-- customizations that are not API-level specific go here. --> <!-- customizations that are not API-level specific go here. -->
</style> </style>
<style name="AppThemeLightWithDarkActionBar" parent="AppBaseThemeLightWithDarkActionBar">
<!-- customizations that are not API-level specific go here. -->
</style>
<style name="SwapTheme.Wizard" parent="AppThemeDark"> <style name="SwapTheme.Wizard" parent="AppThemeDark">
<item name="android:windowBackground">@drawable/swap_window_background</item> <item name="android:windowBackground">@drawable/swap_window_background</item>
<item name="android:actionBarStyle">@style/Widget.AppCompat.ActionBar.Solid</item> <item name="android:actionBarStyle">@style/Widget.AppCompat.ActionBar.Solid</item>
<item name="android:actionButtonStyle">@style/SwapTheme.Wizard.ActionButton</item> <item name="android:actionButtonStyle">@style/SwapTheme.Wizard.ActionButton</item>
</style> </style>
<style name="SwapTheme.StartSwap" parent="AppThemeLightWithDarkActionBar"> <style name="SwapTheme.StartSwap" parent="AppThemeLight">
<item name="android:background">@color/white</item> <item name="android:background">@color/white</item>
</style> </style>
<style name="SwapTheme.AppList" parent="AppThemeLightWithDarkActionBar"> <style name="SwapTheme.AppList" parent="AppThemeLight">
</style> </style>
<style name="SwapTheme.AppList.ListItem" parent="AppThemeLightWithDarkActionBar"> <style name="SwapTheme.AppList.ListItem" parent="AppThemeLight">
</style> </style>
<style name="SwapTheme.StartSwap.StartButton"> <style name="SwapTheme.StartSwap.StartButton">
@ -57,7 +63,6 @@
<item name="android:textSize">18.5sp</item> <!-- 33px * 96dpi / 160dpi --> <item name="android:textSize">18.5sp</item> <!-- 33px * 96dpi / 160dpi -->
<item name="android:background">@drawable/swap_start_button_skin</item> <item name="android:background">@drawable/swap_start_button_skin</item>
<item name="android:textColor">#fff</item>
<item name="android:drawableLeft">@drawable/ic_swap</item> <item name="android:drawableLeft">@drawable/ic_swap</item>
<item name="android:paddingLeft">10dp</item> <item name="android:paddingLeft">10dp</item>
@ -179,4 +184,4 @@
<item name="android:textStyle">italic</item> <item name="android:textStyle">italic</item>
</style> </style>
</resources> </resources>

View File

@ -90,12 +90,12 @@ public class FDroidApp extends Application {
dark, light, lightWithDarkActionBar dark, light, lightWithDarkActionBar
} }
private static Theme curTheme = Theme.dark; private static Theme curTheme = Theme.light;
public void reloadTheme() { public void reloadTheme() {
curTheme = Theme.valueOf(PreferenceManager curTheme = Theme.valueOf(PreferenceManager
.getDefaultSharedPreferences(getBaseContext()) .getDefaultSharedPreferences(getBaseContext())
.getString(Preferences.PREF_THEME, "dark")); .getString(Preferences.PREF_THEME, Preferences.DEFAULT_THEME));
} }
public void applyTheme(Activity activity) { public void applyTheme(Activity activity) {
@ -103,12 +103,9 @@ public class FDroidApp extends Application {
case dark: case dark:
activity.setTheme(R.style.AppThemeDark); activity.setTheme(R.style.AppThemeDark);
break; break;
case light: default:
activity.setTheme(R.style.AppThemeLight); activity.setTheme(R.style.AppThemeLight);
break; break;
case lightWithDarkActionBar:
activity.setTheme(R.style.AppThemeLightWithDarkActionBar);
break;
} }
} }