Merge "Update DrawerLayout demo code to use title API" into klp-ub-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f75b531f71
@@ -160,7 +160,13 @@
|
|||||||
|
|
||||||
<string name="drawer_layout_summary">This activity illustrates the use of sliding drawers. The drawer may be pulled out from the starting edge, which is left on left-to-right locales, with an edge swipe. If this demo is running on Ice Cream Sandwich or newer you may tap the icon at the starting side of the action bar to open the drawer as well.</string>
|
<string name="drawer_layout_summary">This activity illustrates the use of sliding drawers. The drawer may be pulled out from the starting edge, which is left on left-to-right locales, with an edge swipe. If this demo is running on Ice Cream Sandwich or newer you may tap the icon at the starting side of the action bar to open the drawer as well.</string>
|
||||||
|
|
||||||
|
<!-- Title of the navigation drawer, used by accessibility to announce state changes. -->
|
||||||
|
<string name="drawer_title">Navigation</string>
|
||||||
|
|
||||||
|
<!-- Description of the icon that opens the navigation drawer, used by accessibility. -->
|
||||||
<string name="drawer_open">Open navigation drawer</string>
|
<string name="drawer_open">Open navigation drawer</string>
|
||||||
|
|
||||||
|
<!-- Description of the icon that closes the navigation drawer, used by accessibility. -->
|
||||||
<string name="drawer_close">Close navigation drawer</string>
|
<string name="drawer_close">Close navigation drawer</string>
|
||||||
|
|
||||||
<string name="sliding_pane_layout_support">Widget/Sliding pane layout</string>
|
<string name="sliding_pane_layout_support">Widget/Sliding pane layout</string>
|
||||||
|
|||||||
@@ -89,6 +89,11 @@ public class DrawerLayoutActivity extends Activity {
|
|||||||
mDrawerLayout.setDrawerListener(new DemoDrawerListener());
|
mDrawerLayout.setDrawerListener(new DemoDrawerListener());
|
||||||
mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
|
mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
|
||||||
|
|
||||||
|
// The drawer title must be set in order to announce state changes when
|
||||||
|
// accessibility is turned on. This is typically a simple description,
|
||||||
|
// e.g. "Navigation".
|
||||||
|
mDrawerLayout.setDrawerTitle(GravityCompat.START, getString(R.string.drawer_title));
|
||||||
|
|
||||||
mDrawer.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
|
mDrawer.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
|
||||||
Shakespeare.TITLES));
|
Shakespeare.TITLES));
|
||||||
mDrawer.setOnItemClickListener(new DrawerItemClickListener());
|
mDrawer.setOnItemClickListener(new DrawerItemClickListener());
|
||||||
|
|||||||
Reference in New Issue
Block a user