This patch adds Material Design theme for SDK 21+ devices.
Colours in styles.xml are taken from the launcher icon.
---
.../main/java/org/fedorahosted/freeotp/MainActivity.java | 5 +++++
app/src/main/res/values-v21/styles.xml | 14 ++++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 app/src/main/res/values-v21/styles.xml
diff --git a/app/src/main/java/org/fedorahosted/freeotp/MainActivity.java
b/app/src/main/java/org/fedorahosted/freeotp/MainActivity.java
index f1cc81b..69a0c08 100644
--- a/app/src/main/java/org/fedorahosted/freeotp/MainActivity.java
+++ b/app/src/main/java/org/fedorahosted/freeotp/MainActivity.java
@@ -44,10 +44,12 @@ import android.content.Intent;
import android.database.DataSetObserver;
import android.net.Uri;
import android.os.Bundle;
+import android.os.Build;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import android.view.View;
+import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.widget.GridView;
@@ -78,6 +80,9 @@ public class MainActivity extends Activity implements
OnMenuItemClickListener {
}
};
mTokenAdapter.registerDataSetObserver(mDataSetObserver);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { // Lollipop
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+ }
}
@Override
diff --git a/app/src/main/res/values-v21/styles.xml
b/app/src/main/res/values-v21/styles.xml
new file mode 100644
index 0000000..22960a6
--- /dev/null
+++ b/app/src/main/res/values-v21/styles.xml
@@ -0,0 +1,14 @@
+<resources>
+
+ <!--
+ Base application theme for API 21+. This theme completely replaces
+ AppBaseTheme from BOTH res/values/styles.xml and
+ res/values-v14/styles.xml on API 21+ devices.
+ -->
+ <style name="AppBaseTheme"
parent="android:Theme.Material.Light.DarkActionBar">
+ <item name="android:colorPrimary">#1788f5</item>
+ <item name="android:colorPrimaryDark">#1852ef</item>
+ <item name="android:colorAccent">#1852ef</item>
+ </style>
+
+</resources>
--
1.9.1
Show replies by date