当前位置: 首页>>代码示例>>Java>>正文


Java DrawerLayout.LOCK_MODE_LOCKED_CLOSED属性代码示例

本文整理汇总了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;
}
 
开发者ID:mniip,项目名称:bananapeel,代码行数:18,代码来源:TabAdapter.java

示例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);
}
 
开发者ID:Sayi,项目名称:RestClient,代码行数:16,代码来源:HomeActivity.java

示例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();
	}
}
 
开发者ID:mniip,项目名称:bananapeel,代码行数:15,代码来源:MainScreen.java

示例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;
    }
}
 
开发者ID:yarolegovich,项目名称:SlidingRootNav,代码行数:10,代码来源:ActionBarToggleAdapter.java

示例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);
  }
}
 
开发者ID:commonsguy,项目名称:cwac-crossport,代码行数:9,代码来源:ActionBarDrawerToggle.java


注:本文中的android.support.v4.widget.DrawerLayout.LOCK_MODE_LOCKED_CLOSED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。