summaryrefslogtreecommitdiff
path: root/android/java
diff options
context:
space:
mode:
authortobrun <tobrun.van.nuland@gmail.com>2015-09-06 15:51:11 +0200
committerJustin R. Miller <incanus@codesorcery.net>2015-09-09 10:24:46 -0700
commit9a6924435baa3f303311de305ba280a354364bfe (patch)
treeb98fa49d88123de7da69c7179e72263451445657 /android/java
parentf8b8ca72735237e91a2d215366a662fe0def6d89 (diff)
downloadqtlocation-mapboxgl-9a6924435baa3f303311de305ba280a354364bfe.tar.gz
Added styling to the Attribution AlertDialog
Diffstat (limited to 'android/java')
-rw-r--r--android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java4
-rw-r--r--android/java/MapboxGLAndroidSDK/src/main/res/layout/attribution_list_item.xml11
-rw-r--r--android/java/MapboxGLAndroidSDK/src/main/res/values/colors.xml1
-rw-r--r--android/java/MapboxGLAndroidSDK/src/main/res/values/styles.xml9
-rw-r--r--android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml2
5 files changed, 24 insertions, 3 deletions
diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java
index dda11c8f57..5a07365c49 100644
--- a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java
+++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java
@@ -2045,9 +2045,9 @@ public class MapView extends FrameLayout implements LocationListener {
public void onClick(View v) {
Context context = v.getContext();
String[] items = context.getResources().getStringArray(R.array.attribution_names);
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.AttributionAlertDialogStyle);
builder.setTitle(R.string.attributionsDialogTitle);
- builder.setAdapter(new ArrayAdapter<>(context, android.R.layout.simple_list_item_1, items), this);
+ builder.setAdapter(new ArrayAdapter<>(context, R.layout.attribution_list_item, items), this);
builder.show();
}
diff --git a/android/java/MapboxGLAndroidSDK/src/main/res/layout/attribution_list_item.xml b/android/java/MapboxGLAndroidSDK/src/main/res/layout/attribution_list_item.xml
new file mode 100644
index 0000000000..f0a9121584
--- /dev/null
+++ b/android/java/MapboxGLAndroidSDK/src/main/res/layout/attribution_list_item.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@android:id/text1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceListItemSmall"
+ android:textColor="@android:color/white"
+ android:gravity="center_vertical"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:minHeight="?android:attr/listPreferredItemHeightSmall" />
diff --git a/android/java/MapboxGLAndroidSDK/src/main/res/values/colors.xml b/android/java/MapboxGLAndroidSDK/src/main/res/values/colors.xml
index bf3f484313..bb1c326a89 100644
--- a/android/java/MapboxGLAndroidSDK/src/main/res/values/colors.xml
+++ b/android/java/MapboxGLAndroidSDK/src/main/res/values/colors.xml
@@ -2,4 +2,5 @@
<resources>
<color name="white">#FFFFFF</color>
<color name="black">#000000</color>
+ <color name="mapbox_blue">#1E8CAB</color>
</resources>
diff --git a/android/java/MapboxGLAndroidSDK/src/main/res/values/styles.xml b/android/java/MapboxGLAndroidSDK/src/main/res/values/styles.xml
new file mode 100644
index 0000000000..a0859a998c
--- /dev/null
+++ b/android/java/MapboxGLAndroidSDK/src/main/res/values/styles.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <style name="AttributionAlertDialogStyle" parent="Theme.AppCompat.Dialog.Alert">
+ <item name="android:textColorPrimary">@android:color/white</item>
+ <item name="android:background">@color/mapbox_blue</item>
+ </style>
+
+</resources> \ No newline at end of file
diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml
index ac3b4fc30d..af798515fe 100644
--- a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml
+++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <color name="primary">#1E8CAB</color>
+ <color name="primary">@color/mapbox_blue</color>
<color name="primaryDark">#166B83</color>
<color name="accent">#E55E5E</color>
<color name="white">#FFFFFF</color>