Material theme: side nav width, toolbar height
This commit is contained in:
@@ -18,6 +18,7 @@ import android.support.v4.widget.DrawerLayout;
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
import android.support.v7.app.ActionBarDrawerToggle;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
@@ -98,6 +99,15 @@ public class EmailListActivity extends ActionBarActivity implements
|
||||
mNetworkStatusIcon = (ImageView) findViewById(R.id.network_status_icon);
|
||||
mNetworkStatusText = (TextView) findViewById(R.id.network_status_text);
|
||||
|
||||
// Set the drawer width per Material design spec
|
||||
// http://www.google.com/design/spec/layout/structure.html#structure-side-nav-1
|
||||
// Mobile: side nav width = screen width - app bar height
|
||||
// Desktop: Max width for left nav is 400 dp. Not handled yet.
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||
DrawerLayout.LayoutParams lp = (DrawerLayout.LayoutParams) mDrawerOuter.getLayoutParams();
|
||||
lp.width = dm.widthPixels - toolbar.getLayoutParams().height;
|
||||
|
||||
// Set the list of folders
|
||||
// TODO: This is slow, needs a loader
|
||||
mFolderAdapter.setData(I2PBote.getInstance().getEmailFolders());
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/main_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
|
||||
Reference in New Issue
Block a user