本文整理匯總了Java中com.actionbarsherlock.view.Menu.hasVisibleItems方法的典型用法代碼示例。如果您正苦於以下問題:Java Menu.hasVisibleItems方法的具體用法?Java Menu.hasVisibleItems怎麽用?Java Menu.hasVisibleItems使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.actionbarsherlock.view.Menu
的用法示例。
在下文中一共展示了Menu.hasVisibleItems方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onPreparePanel
import com.actionbarsherlock.view.Menu; //導入方法依賴的package包/類
@Override
public boolean onPreparePanel(int featureId, View view, Menu menu) {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + " menu: " + menu);
if (featureId == Window.FEATURE_OPTIONS_PANEL) {
boolean result = onPrepareOptionsMenu(menu);
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] activity prepare result: " + result);
boolean show = false;
if (mFragments.mAdded != null) {
for (int i = 0; i < mFragments.mAdded.size(); i++) {
Fragment f = mFragments.mAdded.get(i);
if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnPrepareOptionsMenuListener) {
show = true;
((OnPrepareOptionsMenuListener)f).onPrepareOptionsMenu(menu);
}
}
}
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] fragments prepare result: " + show);
result |= show;
result &= menu.hasVisibleItems();
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result);
return result;
}
return false;
}
示例2: onPreparePanel
import com.actionbarsherlock.view.Menu; //導入方法依賴的package包/類
public boolean onPreparePanel(int featureId, View view, Menu menu) {
if (BuildConfig.DEBUG)
Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + " menu: " + menu);
if (featureId == Window.FEATURE_OPTIONS_PANEL) {
boolean result = onPrepareOptionsMenu(menu);
if (BuildConfig.DEBUG) Log.d(TAG, "[onPreparePanel] activity prepare result: " + result);
boolean show = false;
if (mFragments.mAdded != null) {
for (int i = 0; i < mFragments.mAdded.size(); i++) {
Fragment f = mFragments.mAdded.get(i);
if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnPrepareOptionsMenuListener) {
show = true;
((OnPrepareOptionsMenuListener) f).onPrepareOptionsMenu(menu);
}
}
}
if (BuildConfig.DEBUG) Log.d(TAG, "[onPreparePanel] fragments prepare result: " + show);
result |= show;
result &= menu.hasVisibleItems();
if (BuildConfig.DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result);
return result;
}
return false;
}