Added styling to the Attribution AlertDialog

This commit is contained in:
tobrun
2015-09-06 15:51:11 +02:00
committed by Justin R. Miller
parent 2a898ae853
commit 4bdb0e2cc9
5 changed files with 24 additions and 3 deletions

View File

@@ -2053,9 +2053,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();
}

View File

@@ -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" />

View File

@@ -2,4 +2,5 @@
<resources>
<color name="white">#FFFFFF</color>
<color name="black">#000000</color>
<color name="mapbox_blue">#1E8CAB</color>
</resources>

View File

@@ -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>