本文整理匯總了Java中android.support.v4.widget.DrawerLayout.LOCK_MODE_LOCKED_CLOSED屬性的典型用法代碼示例。如果您正苦於以下問題:Java DrawerLayout.LOCK_MODE_LOCKED_CLOSED屬性的具體用法?Java DrawerLayout.LOCK_MODE_LOCKED_CLOSED怎麽用?Java DrawerLayout.LOCK_MODE_LOCKED_CLOSED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.support.v4.widget.DrawerLayout
的用法示例。
在下文中一共展示了DrawerLayout.LOCK_MODE_LOCKED_CLOSED屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setPrimaryItem
@Override
public void setPrimaryItem(ViewGroup container, int position, Object object)
{
if(service != null)
{
int id = service.getTabByPosition(position).id;
service.setFrontTab(id);
View nickList = (View)mainScreen.findViewById(R.id.nick_list);
DrawerLayout drawerLayout = (DrawerLayout)mainScreen.findViewById(R.id.drawerLayout);
if (service.getFrontTab().nickList == null)
drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, nickList);
else if (drawerLayout.getDrawerLockMode(nickList) == DrawerLayout.LOCK_MODE_LOCKED_CLOSED)
drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, nickList);
mainScreen.getNickListAdapter().notifyDataSetChanged();
}
curTab = (TabFragment)object;
}
示例2: onOptionsItemSelected
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
switch (id) {
case android.R.id.home:
if (DrawerLayout.LOCK_MODE_LOCKED_CLOSED != mDrawerLayout.getDrawerLockMode(Gravity.LEFT)) {
mDrawerLayout.openDrawer(GravityCompat.START);
}
return true;
case R.id.action_add_test:
Intent intent = new Intent(this, AddRestActivity.class);
startActivityForResult(intent, 300, null);
return true;
}
return super.onOptionsItemSelected(item);
}
示例3: onTabNickListChanged
public void onTabNickListChanged(int tabId)
{
if(getService().getFrontTab().id == tabId)
{
View nickList = (View)findViewById(R.id.nick_list);
DrawerLayout drawerLayout = (DrawerLayout)findViewById(R.id.drawerLayout);
if (getService().getFrontTab().nickList == null)
{
drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, nickList);
}
else if (drawerLayout.getDrawerLockMode(nickList) == DrawerLayout.LOCK_MODE_LOCKED_CLOSED)
drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, nickList);
notifyDataSetChanged();
}
}
示例4: getDrawerLockMode
@Override
public int getDrawerLockMode(int edgeGravity) {
if (adaptee.isMenuLocked() && adaptee.isMenuClosed()) {
return DrawerLayout.LOCK_MODE_LOCKED_CLOSED;
} else if (adaptee.isMenuLocked() && !adaptee.isMenuClosed()) {
return DrawerLayout.LOCK_MODE_LOCKED_OPEN;
} else {
return DrawerLayout.LOCK_MODE_UNLOCKED;
}
}
示例5: toggle
void toggle() {
int drawerLockMode = mDrawerLayout.getDrawerLockMode(GravityCompat.START);
if (mDrawerLayout.isDrawerVisible(GravityCompat.START)
&& (drawerLockMode != DrawerLayout.LOCK_MODE_LOCKED_OPEN)) {
mDrawerLayout.closeDrawer(GravityCompat.START);
} else if (drawerLockMode != DrawerLayout.LOCK_MODE_LOCKED_CLOSED) {
mDrawerLayout.openDrawer(GravityCompat.START);
}
}