]> www.infradead.org Git - users/mchehab/andors-trail.git/commitdiff
Styled worldmap. Default generated worldmap tilesize changed from 12 to 8 pixels.
authorOskar Wiksten <oskar.wiksten@gmail.com>
Mon, 23 Jul 2012 20:32:22 +0000 (22:32 +0200)
committerOskar Wiksten <oskar.wiksten@gmail.com>
Sun, 7 Oct 2012 14:41:17 +0000 (16:41 +0200)
AndorsTrail/res/layout/displayworldmap.xml
AndorsTrail/res/values/strings.xml
AndorsTrail/res/values/ui_colors.xml
AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/DisplayWorldMapActivity.java
AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/WorldMapController.java

index f7960091ac996c3de3fffdb68a84879ce1865743..ea42a92038ad9ff701710965b9cfbb0ad5161ab8 100644 (file)
@@ -1,9 +1,44 @@
 <?xml version="1.0" encoding="utf-8"?>
 
-<WebView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+       android:layout_width="match_parent"
     android:layout_height="match_parent" 
-    android:id="@+id/displayworldmap_webview"
-    >
+       android:orientation="vertical" 
+       >
+       
+    <LinearLayout 
+           android:layout_width="match_parent"
+           android:layout_height="wrap_content" 
+               android:orientation="horizontal"
+               android:background="@drawable/ui_gradientshape"
+               android:padding="@dimen/boxshape_margin"
+               >
+           
+        <TextView 
+            android:layout_width="0dip"
+                   android:layout_height="wrap_content"
+                   android:layout_weight="1"
+                   android:text="@string/menu_button_worldmap"
+                   style="@style/textWithIcon"
+                   android:textSize="@dimen/titletext"
+                       android:drawableLeft="@android:drawable/ic_dialog_map"
+                       
+                       />
 
-</WebView>
+        <Button 
+            android:id="@+id/displayworldmap_close"
+            android:layout_width="wrap_content"
+                   android:layout_height="wrap_content" 
+                       style="?android:attr/buttonStyleSmall"
+                       android:text="@string/dialog_close"
+                       />
+        
+    </LinearLayout>
+       
+       <WebView 
+               android:layout_width="match_parent"
+               android:layout_height="match_parent" 
+               android:id="@+id/displayworldmap_webview"
+               />
+       
+</LinearLayout>
index b64ec9494e12038ae59550cd1c74f528fd1bdae6..407bfbac133f0e0f5bc7b10f8d18c59f54016ef0 100644 (file)
     <string name="menu_button_worldmap">Map</string>
     <string name="menu_button_worldmap_failed">Map cannot be displayed.</string>
     <string name="display_worldmap_not_available">The map cannot be displayed from this location.</string>
+    <string name="display_worldmap_title">Map</string>
     
 </resources>
index 5df4b03a2d24589152553a4732fcbb50854804a2..7caaee8cfc91335a5058c9ef214517054293e7d5 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
    <color name="translucent_black">#80000000</color>
+   <color name="displayworldmap_background">#423921</color>
 </resources>
index 2eae1157e287298537e471bf6e0007e22154fa00..cfe9efae5cd24182323f02f76118e5f77ef35535 100644 (file)
@@ -5,7 +5,10 @@ import java.io.File;
 import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
 import android.webkit.WebView;
+import android.widget.Button;
 import android.widget.Toast;
 
 import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
@@ -35,10 +38,18 @@ public class DisplayWorldMapActivity extends Activity {
         setContentView(R.layout.displayworldmap);
         
         displayworldmap_webview = (WebView) findViewById(R.id.displayworldmap_webview);
-        displayworldmap_webview.setBackgroundColor(getResources().getColor(android.R.color.black));
+        displayworldmap_webview.setBackgroundColor(getResources().getColor(R.color.displayworldmap_background));
         displayworldmap_webview.getSettings().setBuiltInZoomControls(true);
         enableJavascript();
         
+        Button b = (Button) findViewById(R.id.displayworldmap_close);
+        b.setOnClickListener(new OnClickListener() {
+                       @Override
+                       public void onClick(View v) {
+                               DisplayWorldMapActivity.this.finish();
+                       }
+               });
+        
         worldMapSegmentName = getIntent().getStringExtra("worldMapSegmentName");
     }
     
index 3f466d8cdf054ec955af9772f51e322242d36745..8db9463bca8be4293133d90e4e9bcb93f2c4f568 100644 (file)
@@ -31,7 +31,7 @@ import com.gpl.rpg.AndorsTrail.util.L;
 
 public final class WorldMapController {
 
-       public static int WORLDMAP_SCREENSHOT_TILESIZE = 12;
+       public static int WORLDMAP_SCREENSHOT_TILESIZE = 8;
     public static int WORLDMAP_DISPLAY_TILESIZE = WORLDMAP_SCREENSHOT_TILESIZE;
     
        public static void updateWorldMap(final WorldContext world, final PredefinedMap map, final LayeredTileMap mapTiles, final TileCollection cachedTiles, final Resources res) {