From 34d1c023de43a3c07d7531a156b438e625bc23d6 Mon Sep 17 00:00:00 2001 From: Brad Leege Date: Fri, 7 Aug 2015 13:45:56 -0500 Subject: [PATCH] #1856 - Initial conversion to Material Design components --- .mason | 2 +- .../mapbox/mapboxgl/testapp/MainActivity.java | 21 ++- .../src/main/res/layout/activity_main.xml | 122 +++++++++++------- .../src/main/res/values/colors.xml | 7 + .../src/main/res/values/dimens.xml | 4 + .../src/main/res/values/styles.xml | 10 +- src/mbgl/util/geojsonvt | 2 +- 7 files changed, 118 insertions(+), 50 deletions(-) create mode 100644 android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml create mode 100644 android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/dimens.xml diff --git a/.mason b/.mason index d8597d94453..abdc131273c 160000 --- a/.mason +++ b/.mason @@ -1 +1 @@ -Subproject commit d8597d944533dbb5e28d08dfdba22a82c93171b7 +Subproject commit abdc131273c3e50e42f245b1166c27de4c34c582 diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxgl/testapp/MainActivity.java b/android/java/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxgl/testapp/MainActivity.java index df524f99059..a637ee3f2bd 100644 --- a/android/java/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxgl/testapp/MainActivity.java +++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxgl/testapp/MainActivity.java @@ -3,7 +3,9 @@ import android.graphics.Color; import android.graphics.PointF; import android.os.Bundle; -import android.support.v7.app.ActionBarActivity; +import android.support.v4.widget.DrawerLayout; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.GestureDetector; @@ -33,7 +35,7 @@ import java.io.InputStreamReader; import java.util.ArrayList; -public class MainActivity extends ActionBarActivity { +public class MainActivity extends AppCompatActivity { private static final String TAG = "MainActivity"; @@ -49,6 +51,7 @@ public class MainActivity extends ActionBarActivity { // // Used for the UI + private DrawerLayout mDrawerLayout; private MapView mapView; private TextView mFpsTextView; private FrameLayout mMapFrameLayout; @@ -79,6 +82,17 @@ protected void onCreate(Bundle savedInstanceState) { // Load the layout setContentView(R.layout.activity_main); + + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + + final ActionBar ab = getSupportActionBar(); + ab.setHomeAsUpIndicator(R.drawable.ic_menu); + ab.setDisplayHomeAsUpEnabled(true); + + mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); + + mapView = (MapView) findViewById(R.id.mainMapView); // Load the access token try { @@ -120,6 +134,8 @@ public boolean onTouch(View v, MotionEvent event) { mFpsTextView.setText(""); mMapFrameLayout = (FrameLayout) findViewById(R.id.layout_map); + +/* // Add a toolbar as the action bar Toolbar mainToolbar = (Toolbar) findViewById(R.id.toolbar_main); setSupportActionBar(mainToolbar); @@ -136,6 +152,7 @@ public boolean onTouch(View v, MotionEvent event) { mClassSpinner = (Spinner) findViewById(R.id.spinner_class); mOutdoorsClassAdapter = ArrayAdapter.createFromResource(getSupportActionBar().getThemedContext(), R.array.outdoors_class_list, android.R.layout.simple_spinner_dropdown_item); +*/ if (savedInstanceState != null) { mapView.setMyLocationEnabled(savedInstanceState.getBoolean(STATE_IS_GPS_ON, false)); diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_main.xml b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_main.xml index 0cf914a0668..6cae3922954 100644 --- a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_main.xml +++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_main.xml @@ -1,59 +1,91 @@ - + android:fitsSystemWindows="true"> - - - - - - - - + android:layout_height="match_parent"> - + android:layout_height="wrap_content" + android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> - + + + + + + > - + + + + + + + + + + + + + + + - - + diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml new file mode 100644 index 00000000000..ac3b4fc30d6 --- /dev/null +++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml @@ -0,0 +1,7 @@ + + + #1E8CAB + #166B83 + #E55E5E + #FFFFFF + diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/dimens.xml b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/dimens.xml new file mode 100644 index 00000000000..f76eef07c3b --- /dev/null +++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/dimens.xml @@ -0,0 +1,4 @@ + + + 16dp + diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/styles.xml b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/styles.xml index 2399c78beef..200665796e9 100644 --- a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/styles.xml +++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/styles.xml @@ -1,5 +1,13 @@ - + diff --git a/src/mbgl/util/geojsonvt b/src/mbgl/util/geojsonvt index 995ffc72c55..ed99a6290fa 160000 --- a/src/mbgl/util/geojsonvt +++ b/src/mbgl/util/geojsonvt @@ -1 +1 @@ -Subproject commit 995ffc72c556da4b4880a6036fbcf7159fc5ecce +Subproject commit ed99a6290fa42107a982e7f3675aae49d29026b1