本文整理汇总了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);
}
}