本文整理匯總了Java中android.support.v4.widget.DrawerLayout.LOCK_MODE_UNLOCKED屬性的典型用法代碼示例。如果您正苦於以下問題:Java DrawerLayout.LOCK_MODE_UNLOCKED屬性的具體用法?Java DrawerLayout.LOCK_MODE_UNLOCKED怎麽用?Java DrawerLayout.LOCK_MODE_UNLOCKED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.support.v4.widget.DrawerLayout
的用法示例。
在下文中一共展示了DrawerLayout.LOCK_MODE_UNLOCKED屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateLockState
private void updateLockState() {
if (isCurrentlyLocked()) {
if (getDrawerLockMode(Gravity.START) == DrawerLayout.LOCK_MODE_LOCKED_OPEN)
return;
openDrawer(Gravity.START, false);
setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_OPEN);
setScrimColor(Color.TRANSPARENT);
} else {
if (getDrawerLockMode(Gravity.START) == DrawerLayout.LOCK_MODE_UNLOCKED)
return;
closeDrawer(Gravity.START, false);
setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
setScrimColor(0x99000000);
}
requestLayout();
Iterator<WeakReference<LockableStateListener>> iterator = mLockableListener.iterator();
while (iterator.hasNext()) {
LockableStateListener listener = iterator.next().get();
if (listener != null)
listener.onLockableStateChanged(isCurrentlyLocked());
else
iterator.remove();
}
}
示例2: 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;
}
}