當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。