Skip to content
Permalink
Browse files

Change layout so that drawer covers toolbar

  • Loading branch information...
petermajor committed Feb 25, 2016
1 parent 95f7545 commit 2fd1039897dd082334bd6ffbd1777ad4e4d1a813
@@ -74,6 +74,7 @@
<AndroidResource Include="Resources\layout\MySettingsView.xml" />
<AndroidResource Include="Resources\values\Styles.xml" />
<AndroidResource Include="Resources\values\Colors.xml" />
<AndroidResource Include="Resources\layout\Toolbar.axml" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\drawable\" />
@@ -2,6 +2,7 @@
using Android.OS;
using Android.Support.V4.Widget;
using Android.Support.V7.App;
using Android.Support.V7.Widget;
using Android.Views;
using Android.Widget;
using Fragment = Android.Support.V4.App.Fragment;
@@ -27,6 +28,9 @@ protected override void OnCreate (Bundle savedInstanceState)

SetContentView (Resource.Layout.Main);

var toolbar = FindViewById<Toolbar> (Resource.Id.toolbar);
SetSupportActionBar (toolbar);

SupportActionBar.SetDisplayHomeAsUpEnabled (true);

_drawerListView = FindViewById<ListView> (Resource.Id.drawerListView);

Some generated files are not rendered by default. Learn more.

@@ -4,10 +4,17 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- content must go before menu because of z-order -->
<FrameLayout
android:id="@+id/frameLayout"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:orientation="vertical">
<include
layout="@layout/toolbar" />
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<!-- menu -->
<ListView
android:id="@+id/drawerListView"
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
@@ -2,9 +2,11 @@
<resources>
<style name="MyTheme" parent="MyTheme.Base">
</style>
<style name="MyTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="MyTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
<item name="windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
</style>
</resources>

0 comments on commit 2fd1039

Please sign in to comment.
You can’t perform that action at this time.