徽标旁边的小图标(指示器或 3 行)不会变小。
--> 此图像没有动画,当我单击应用程序的徽标时,抽屉已打开,但图像未动画成更小的图像,这表明抽屉当前已打开。
gABar.get().setDisplayHomeAsUpEnabled(true);
mDrawerToggle = new ActionBarDrawerToggle(
getActivity(), /* host Activity */
mDrawerLayout.get(), /* DrawerLayout object */
R.drawable.ic_drawer2, /* nav drawer image to replace 'Up' caret */
R.string.drawer_open, /* "open drawer" description for accessibility */
R.string.drawer_close /* "close drawer" description for accessibility */
) {
@Override
public void onDrawerClosed(View view) {
getActivity().getActionBar().setTitle(mTitle);
getActivity().invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
Log.d("onDrawerClosed", "inside");
}
@Override
public void onDrawerOpened(View drawerView) {
getActivity().getActionBar().setTitle(mDrawerTitle);
getActivity().invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
}
};
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
int id = item.getItemId();
Log.d("item ID : ", "onOptionsItemSelected Item ID" + id);
if (id == android.R.id.home) {
return true;
} else {
return super.onOptionsItemSelected(item);
}
}