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