diff options
author | mvglasow <michael -at- vonglasow.com> | 2015-11-09 20:52:40 +0100 |
---|---|---|
committer | mvglasow <michael -at- vonglasow.com> | 2016-02-02 09:58:31 +0100 |
commit | b5ae2a33d79db5e21f2b7007da03776a1084f2d5 (patch) | |
tree | ba274fc2c7cdafe0cbda21622cd21017c0fbbba3 /navit/android | |
parent | 402a55ba4041087017611bc03e4ee21cb5e78ff7 (diff) | |
download | navit-b5ae2a33d79db5e21f2b7007da03776a1084f2d5.tar.gz |
Add:port_android:Apply color theme
Signed-off-by: mvglasow <michael -at- vonglasow.com>
Diffstat (limited to 'navit/android')
-rw-r--r-- | navit/android/AndroidManifest.xml.cmake | 3 | ||||
-rw-r--r-- | navit/android/AndroidManifest.xml.in | 3 | ||||
-rw-r--r-- | navit/android/res/values-v21/styles.xml | 21 | ||||
-rw-r--r-- | navit/android/res/values/styles.xml | 41 | ||||
-rw-r--r-- | navit/android/src/org/navitproject/navit/Navit.java | 6 |
5 files changed, 71 insertions, 3 deletions
diff --git a/navit/android/AndroidManifest.xml.cmake b/navit/android/AndroidManifest.xml.cmake index 9267f65a3..1734101f8 100644 --- a/navit/android/AndroidManifest.xml.cmake +++ b/navit/android/AndroidManifest.xml.cmake @@ -17,7 +17,8 @@ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <application android:label="@string/app_name" android:icon="@drawable/icon" - android:name=".NavitAppConfig"> + android:name=".NavitAppConfig" + android:theme="@style/NavitTheme"> <activity android:name="Navit" android:label="@string/app_name" android:configChanges="locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|fontScale|screenSize"> diff --git a/navit/android/AndroidManifest.xml.in b/navit/android/AndroidManifest.xml.in index 5a43ee277..085276623 100644 --- a/navit/android/AndroidManifest.xml.in +++ b/navit/android/AndroidManifest.xml.in @@ -7,7 +7,8 @@ android:installLocation="auto"> <application android:label="@string/app_name" android:icon="@drawable/icon" - android:name=".NavitAppConfig"> + android:name=".NavitAppConfig" + android:theme="@style/NavitTheme"> <activity android:name="Navit" android:label="@string/app_name" android:configChanges="locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|fontScale|screenSize"> diff --git a/navit/android/res/values-v21/styles.xml b/navit/android/res/values-v21/styles.xml new file mode 100644 index 000000000..960f99faf --- /dev/null +++ b/navit/android/res/values-v21/styles.xml @@ -0,0 +1,21 @@ +<resources> + + <!-- + Base application theme for API 21+. This theme completely replaces + AppBaseTheme from BOTH res/values/styles.xml and + res/values-v.../styles.xml on API 21+ devices. + --> + <style name="NavitBaseTheme" parent="android:Theme.Material"> + + <!-- API 21 theme customizations can go here. --> + + <!-- Main theme colors --> + <!-- your app branding color for the app bar --> + <item name="android:colorPrimary">@color/navitYellow500</item> + <!-- darker variant for the status bar and contextual app bars --> + <item name="android:colorPrimaryDark">@color/navitYellow700</item> + <!-- theme UI controls like checkboxes and text fields --> + <item name="android:colorAccent">@color/navitBlue500</item> + </style> + +</resources>
\ No newline at end of file diff --git a/navit/android/res/values/styles.xml b/navit/android/res/values/styles.xml new file mode 100644 index 000000000..191fe509d --- /dev/null +++ b/navit/android/res/values/styles.xml @@ -0,0 +1,41 @@ +<resources> + + <!-- + Base application theme, dependent on API level. This theme is replaced + by AppBaseTheme from res/values-vXX/styles.xml on newer devices. + --> + <style name="NavitBaseTheme" parent="android:Theme.Holo"> + <!-- + Theme customizations available in newer API levels can go in + res/values-vXX/styles.xml, while customizations related to + backward-compatibility can go here. + --> + </style> + + <!-- Application theme. --> + <style name="NavitTheme" parent="NavitBaseTheme"> + <!-- All customizations that are NOT specific to a particular API-level can go here. --> + </style> + + <!-- TODO complete list of shades for both colors --> + <!-- + Primary color is derived average of icon colors (500 in Android parlance): + 213 164 19 #d5a411 hsl 45 92 84 + + Primary color is normally the 600 color (i.e. slightly darker than 500) + 209 155 19 #d19b13 hsl 43 91 82 + --> + + <!-- Yellow from Navit icon background (300 and 700 are the extremes of the gradient, 500 is the average, 900 is the line color) --> + <color name="navitYellow300">#e9cb14</color> + <color name="navitYellow500">#d5a411</color> + <!-- <color name="navitYellow600">#d19b13</color> --> + <color name="navitYellow700">#c17d11</color> + <color name="navitYellow900">#43350f</color> + + <!-- Blue from arrow in Navit icon (500 is the midpoint of the gradient, 300 is the end, 900 is the line color) --> + <color name="navitBlue300">#329eff</color> + <color name="navitBlue500">#1a6cb6</color> + <color name="navitBlue900">#1f3157</color> + +</resources>
\ No newline at end of file diff --git a/navit/android/src/org/navitproject/navit/Navit.java b/navit/android/src/org/navitproject/navit/Navit.java index 19637c97b..f08de4e56 100644 --- a/navit/android/src/org/navitproject/navit/Navit.java +++ b/navit/android/src/org/navitproject/navit/Navit.java @@ -32,6 +32,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern;
import android.app.Activity;
+import android.app.ActivityManager.TaskDescription;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.Notification;
@@ -45,6 +46,9 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Color;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Bundle;
@@ -382,7 +386,7 @@ public class Navit extends Activity public void onResume()
{
super.onResume();
- Log.e("Navit", "OnResume");
+ Log.d("Navit", "OnResume");
//InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
// DEBUG
// intent_data = "google.navigation:q=Wien Burggasse 27";
|