commit | 3cd44d4399571220c03673b3a546bdb04f3b47a5 | [log] [tgz] |
---|---|---|
author | Yuichi Araki <yaraki@google.com> | Tue Jun 02 16:42:06 2015 +0900 |
committer | Yuichi Araki <yaraki@google.com> | Tue Jun 02 16:42:06 2015 +0900 |
tree | 9e0e34066f0c807b815fbc9db77219092061229a | |
parent | 8e207d0c8e1529d96fe10c09f6e94e0470a526f9 [diff] |
NavigationViewUsage saves its state on rotation Also changes it to use app:menu instead of inflating the menu in Java. Change-Id: I140fb042c8ea77b5a7c889abf50a1a7926e2dc8b
diff --git a/samples/SupportDesignDemos/res/layout/design_navigation.xml b/samples/SupportDesignDemos/res/layout/design_navigation.xml index 22e900a..1ed87ae 100644 --- a/samples/SupportDesignDemos/res/layout/design_navigation.xml +++ b/samples/SupportDesignDemos/res/layout/design_navigation.xml
@@ -40,6 +40,7 @@ android:id="@+id/message" android:layout_width="match_parent" android:layout_height="match_parent" + android:freezesText="true" android:gravity="center" android:text="@string/navigation_1" android:textAppearance="?android:attr/textAppearanceLarge"/> @@ -50,6 +51,7 @@ android:id="@+id/navigation" android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_gravity="start"/> + android:layout_gravity="start" + app:menu="@menu/navigation"/> </android.support.v4.widget.DrawerLayout>
diff --git a/samples/SupportDesignDemos/src/com/example/android/support/design/widget/NavigationViewUsage.java b/samples/SupportDesignDemos/src/com/example/android/support/design/widget/NavigationViewUsage.java index 46a57b5..b82a684 100644 --- a/samples/SupportDesignDemos/src/com/example/android/support/design/widget/NavigationViewUsage.java +++ b/samples/SupportDesignDemos/src/com/example/android/support/design/widget/NavigationViewUsage.java
@@ -67,7 +67,6 @@ // Menu NavigationView navigation = (NavigationView) findViewById(R.id.navigation); - getMenuInflater().inflate(R.menu.navigation, navigation.getMenu()); navigation.setNavigationItemSelectedListener(mNavigationItemSelectedListener); navigation.inflateHeaderView(R.layout.design_navigation_header); }