Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
#1856 - Initial conversion to Material Design components
Browse files Browse the repository at this point in the history
  • Loading branch information
bleege committed Aug 7, 2015
1 parent 2f4b627 commit 34d1c02
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .mason
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";

Expand All @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand All @@ -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));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,59 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout

<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:fitsSystemWindows="true">

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_main"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary">

<Spinner
android:id="@+id/spinner_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<Spinner
android:id="@+id/spinner_class"
android:visibility="invisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</android.support.v7.widget.Toolbar>

<FrameLayout
android:id="@+id/layout_map"

<android.support.design.widget.CoordinatorLayout
android:id="@+id/main_content"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
android:layout_height="match_parent">

<!--
<fragment
android:name="com.mapbox.mapboxgl.testapp.MapFragment"
android:id="@+id/fragment_map"
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${packageName}.${activityClass}"
tools:layout="@layout/fragment_main" />
-->
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

<com.mapbox.mapboxgl.views.MapView
android:id="@+id/mainMapView"
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>


</android.support.design.widget.AppBarLayout>

<FrameLayout
android:id="@+id/layout_map"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
>

<TextView
android:id="@+id/view_fps"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/label_fps"
android:layout_margin="10dp" />
<!--
<fragment
android:name="com.mapbox.mapboxgl.testapp.MapFragment"
android:id="@+id/fragment_map"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${packageName}.${activityClass}"
tools:layout="@layout/fragment_main" />
-->

<com.mapbox.mapboxgl.views.MapView
android:id="@+id/mainMapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>

<TextView
android:id="@+id/view_fps"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="@string/label_fps"
android:textAppearance="?android:attr/textAppearanceLarge"/>

</FrameLayout>


<!--
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin"
/>
-->

</android.support.design.widget.CoordinatorLayout>


<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
tools:headerLayout="@layout/nav_header"
tools:menu="@menu/drawer_view"/>

</FrameLayout>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">#1E8CAB</color>
<color name="primaryDark">#166B83</color>
<color name="accent">#E55E5E</color>
<color name="white">#FFFFFF</color>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="fab_margin">16dp</dimen>
</resources>
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light.NoActionBar" />

<style name="AppTheme" parent="AppBaseTheme" />

<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primaryDark</item>
<item name="colorAccent">@color/accent</item>
<item name="android:windowBackground">@color/white</item>
</style>

</resources>
2 changes: 1 addition & 1 deletion src/mbgl/util/geojsonvt

0 comments on commit 34d1c02

Please sign in to comment.