Skip to content

Commit 9e4dea7

Browse files
authored
Dark and Indigo map themes, #1229 (#1230)
1 parent e982b94 commit 9e4dea7

9 files changed

Lines changed: 3824 additions & 3 deletions

File tree

docs/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Next version
44

55
- `ThemeCallback.getText` method [#1225](https://github.com/mapsforge/vtm/pull/1225)
6+
- Dark and Indigo map themes [#1229](https://github.com/mapsforge/vtm/issues/1229)
67
- Motorider map theme improvements [#1183](https://github.com/mapsforge/vtm/issues/1183)
78
- Biker map theme improvements [#1192](https://github.com/mapsforge/vtm/issues/1192)
89
- Minor improvements and bug fixes

vtm-android-example/res/menu/theme_menu.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
<item
1212
android:id="@+id/theme_biker"
1313
android:title="@string/theme_biker" />
14+
<item
15+
android:id="@+id/theme_dark"
16+
android:title="@string/theme_dark" />
17+
<item
18+
android:id="@+id/theme_indigo"
19+
android:title="@string/theme_indigo" />
1420
<item
1521
android:id="@+id/theme_default"
1622
android:title="@string/theme_default" />

vtm-android-example/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<string name="app_name">VTM Samples</string>
44
<string name="theme_motorider">Motorider</string>
55
<string name="theme_biker">Biker</string>
6+
<string name="theme_dark">Dark</string>
7+
<string name="theme_indigo">Indigo</string>
68
<string name="theme_default">Default</string>
79
<string name="theme_osmarender">Osmarender</string>
810
<string name="theme_external">External theme (Android 5)</string>

vtm-android-example/src/org/oscim/android/test/BaseMapActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ public boolean onOptionsItemSelected(MenuItem item) {
8484
mMap.setTheme(VtmThemes.BIKER);
8585
item.setChecked(true);
8686
return true;
87+
} else if (itemId == R.id.theme_dark) {
88+
mMap.setTheme(VtmThemes.DARK);
89+
item.setChecked(true);
90+
return true;
91+
} else if (itemId == R.id.theme_indigo) {
92+
mMap.setTheme(VtmThemes.INDIGO);
93+
item.setChecked(true);
94+
return true;
8795
} else if (itemId == R.id.theme_default) {
8896
mMap.setTheme(VtmThemes.DEFAULT);
8997
item.setChecked(true);

vtm-android-example/src/org/oscim/android/test/MapsforgeActivity.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@ public boolean onOptionsItemSelected(MenuItem item) {
120120
mTheme = mMap.setTheme(VtmThemes.BIKER);
121121
item.setChecked(true);
122122
return true;
123+
} else if (itemId == R.id.theme_dark) {
124+
if (mTheme != null)
125+
mTheme.dispose();
126+
mTheme = mMap.setTheme(VtmThemes.DARK);
127+
item.setChecked(true);
128+
return true;
129+
} else if (itemId == R.id.theme_indigo) {
130+
if (mTheme != null)
131+
mTheme.dispose();
132+
mTheme = mMap.setTheme(VtmThemes.INDIGO);
133+
item.setChecked(true);
134+
return true;
123135
} else if (itemId == R.id.theme_default) {
124136
if (mTheme != null)
125137
mTheme.dispose();

vtm-gdx/src/org/oscim/gdx/InputHandler.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,31 @@ public boolean keyDown(int keycode) {
126126
break;
127127

128128
case Input.Keys.NUM_3:
129-
mMap.setTheme(VtmThemes.DEFAULT);
129+
mMap.setTheme(VtmThemes.DARK);
130130
mMap.updateMap(false);
131131
break;
132132

133133
case Input.Keys.NUM_4:
134-
mMap.setTheme(VtmThemes.OSMARENDER);
134+
mMap.setTheme(VtmThemes.INDIGO);
135135
mMap.updateMap(false);
136136
break;
137137

138138
case Input.Keys.NUM_5:
139-
mMap.setTheme(VtmThemes.TRONRENDER);
139+
mMap.setTheme(VtmThemes.DEFAULT);
140140
mMap.updateMap(false);
141141
break;
142142

143143
case Input.Keys.NUM_6:
144+
mMap.setTheme(VtmThemes.OSMARENDER);
145+
mMap.updateMap(false);
146+
break;
147+
148+
case Input.Keys.NUM_7:
149+
mMap.setTheme(VtmThemes.TRONRENDER);
150+
mMap.updateMap(false);
151+
break;
152+
153+
case Input.Keys.NUM_8:
144154
mMap.setTheme(VtmThemes.NEWTRON);
145155
mMap.updateMap(false);
146156
break;

0 commit comments

Comments
 (0)