summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormvglasow <michael -at- vonglasow.com>2015-11-09 20:52:40 +0100
committermvglasow <michael -at- vonglasow.com>2016-02-02 09:58:31 +0100
commitb5ae2a33d79db5e21f2b7007da03776a1084f2d5 (patch)
treeba274fc2c7cdafe0cbda21622cd21017c0fbbba3
parent402a55ba4041087017611bc03e4ee21cb5e78ff7 (diff)
downloadnavit-b5ae2a33d79db5e21f2b7007da03776a1084f2d5.tar.gz
Add:port_android:Apply color theme
Signed-off-by: mvglasow <michael -at- vonglasow.com>
-rw-r--r--ci/build_android.sh2
-rw-r--r--ci/build_android_x86.sh2
-rw-r--r--navit/android/AndroidManifest.xml.cmake3
-rw-r--r--navit/android/AndroidManifest.xml.in3
-rw-r--r--navit/android/res/values-v21/styles.xml21
-rw-r--r--navit/android/res/values/styles.xml41
-rw-r--r--navit/android/src/org/navitproject/navit/Navit.java6
7 files changed, 73 insertions, 5 deletions
diff --git a/ci/build_android.sh b/ci/build_android.sh
index 6525541ba..a063bf2fa 100644
--- a/ci/build_android.sh
+++ b/ci/build_android.sh
@@ -46,7 +46,7 @@ android list targets
mkdir $CIRCLE_ARTIFACTS/android/
cp ~/navit/navit/android/CMakeLists.txt $CIRCLE_ARTIFACTS/android/
-cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_FILE -DCACHE_SIZE='(20*1024*1024)' -DAVOID_FLOAT=1 -DSAMPLE_MAP=n -DBUILD_MAPTOOL=n -DANDROID_API_VERSION=19 $SOURCE_PATH
+cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_FILE -DCACHE_SIZE='(20*1024*1024)' -DAVOID_FLOAT=1 -DSAMPLE_MAP=n -DBUILD_MAPTOOL=n -DANDROID_API_VERSION=21 -DANDROID_NDK_API_VERSION=19 $SOURCE_PATH
make || exit 1
if [[ "${CIRCLE_BRANCH}" == "master" ]]; then
make apkg-release && mv navit/android/bin/Navit-release-unsigned.apk $CIRCLE_ARTIFACTS/navit-$CIRCLE_SHA1-release-unsigned.apk || exit 1
diff --git a/ci/build_android_x86.sh b/ci/build_android_x86.sh
index 695556e07..6755ad347 100644
--- a/ci/build_android_x86.sh
+++ b/ci/build_android_x86.sh
@@ -11,7 +11,7 @@ mkdir android-x86 && cd android-x86
android list targets
-cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_FILE -DAVOID_FLOAT=1 -DSAMPLE_MAP=n -DBUILD_MAPTOOL=n -DANDROID_API_VERSION=19 -DDISABLE_CXX=1 -DDISABLE_QT=1 ../ || exit -1
+cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_FILE -DAVOID_FLOAT=1 -DSAMPLE_MAP=n -DBUILD_MAPTOOL=n -DANDROID_API_VERSION=21 -DANDROID_NDK_API_VERSION=19 -DDISABLE_CXX=1 -DDISABLE_QT=1 ../ || exit -1
make || exit -1
if [[ "${CIRCLE_BRANCH}" == "master" ]]; then
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";