com.actionbarsherlock.internal.view.menu.MenuItemImpl Java Examples
The following examples show how to use
com.actionbarsherlock.internal.view.menu.MenuItemImpl.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ActionBarView.java From Libraries-for-Android-Developers with MIT License | 6 votes |
@Override public boolean expandItemActionView(MenuBuilder menu, MenuItemImpl item) { mExpandedActionView = item.getActionView(); mExpandedHomeLayout.setIcon(mIcon.getConstantState().newDrawable(/* TODO getResources() */)); mCurrentExpandedItem = item; if (mExpandedActionView.getParent() != ActionBarView.this) { addView(mExpandedActionView); } if (mExpandedHomeLayout.getParent() != ActionBarView.this) { addView(mExpandedHomeLayout); } mHomeLayout.setVisibility(GONE); if (mTitleLayout != null) mTitleLayout.setVisibility(GONE); if (mTabScrollView != null) mTabScrollView.setVisibility(GONE); if (mSpinner != null) mSpinner.setVisibility(GONE); if (mCustomNavView != null) mCustomNavView.setVisibility(GONE); requestLayout(); item.setActionViewExpanded(true); if (mExpandedActionView instanceof CollapsibleActionView) { ((CollapsibleActionView) mExpandedActionView).onActionViewExpanded(); } return true; }
Example #2
Source File: ActionBarView.java From zen4android with MIT License | 6 votes |
@Override public boolean expandItemActionView(MenuBuilder menu, MenuItemImpl item) { mExpandedActionView = item.getActionView(); mExpandedHomeLayout.setIcon(mIcon.getConstantState().newDrawable(/* TODO getResources() */)); mCurrentExpandedItem = item; if (mExpandedActionView.getParent() != ActionBarView.this) { addView(mExpandedActionView); } if (mExpandedHomeLayout.getParent() != ActionBarView.this) { addView(mExpandedHomeLayout); } mHomeLayout.setVisibility(GONE); if (mTitleLayout != null) mTitleLayout.setVisibility(GONE); if (mTabScrollView != null) mTabScrollView.setVisibility(GONE); if (mSpinner != null) mSpinner.setVisibility(GONE); if (mCustomNavView != null) mCustomNavView.setVisibility(GONE); requestLayout(); item.setActionViewExpanded(true); if (mExpandedActionView instanceof CollapsibleActionView) { ((CollapsibleActionView) mExpandedActionView).onActionViewExpanded(); } return true; }
Example #3
Source File: ActionBarView.java From CSipSimple with GNU General Public License v3.0 | 6 votes |
@Override public boolean expandItemActionView(MenuBuilder menu, MenuItemImpl item) { mExpandedActionView = item.getActionView(); mExpandedHomeLayout.setIcon(mIcon.getConstantState().newDrawable(/* TODO getResources() */)); mCurrentExpandedItem = item; if (mExpandedActionView.getParent() != ActionBarView.this) { addView(mExpandedActionView); } if (mExpandedHomeLayout.getParent() != ActionBarView.this) { addView(mExpandedHomeLayout); } mHomeLayout.setVisibility(GONE); if (mTitleLayout != null) mTitleLayout.setVisibility(GONE); if (mTabScrollView != null) mTabScrollView.setVisibility(GONE); if (mSpinner != null) mSpinner.setVisibility(GONE); if (mCustomNavView != null) mCustomNavView.setVisibility(GONE); requestLayout(); item.setActionViewExpanded(true); if (mExpandedActionView instanceof CollapsibleActionView) { ((CollapsibleActionView) mExpandedActionView).onActionViewExpanded(); } return true; }
Example #4
Source File: ActionBarView.java From android-apps with MIT License | 6 votes |
@Override public boolean expandItemActionView(MenuBuilder menu, MenuItemImpl item) { mExpandedActionView = item.getActionView(); mExpandedHomeLayout.setIcon(mIcon.getConstantState().newDrawable(/* TODO getResources() */)); mCurrentExpandedItem = item; if (mExpandedActionView.getParent() != ActionBarView.this) { addView(mExpandedActionView); } if (mExpandedHomeLayout.getParent() != ActionBarView.this) { addView(mExpandedHomeLayout); } mHomeLayout.setVisibility(GONE); if (mTitleLayout != null) mTitleLayout.setVisibility(GONE); if (mTabScrollView != null) mTabScrollView.setVisibility(GONE); if (mSpinner != null) mSpinner.setVisibility(GONE); if (mCustomNavView != null) mCustomNavView.setVisibility(GONE); requestLayout(); item.setActionViewExpanded(true); if (mExpandedActionView instanceof CollapsibleActionView) { ((CollapsibleActionView) mExpandedActionView).onActionViewExpanded(); } return true; }
Example #5
Source File: ActionBarView.java From zhangshangwuda with Apache License 2.0 | 6 votes |
@Override public boolean expandItemActionView(MenuBuilder menu, MenuItemImpl item) { mExpandedActionView = item.getActionView(); mExpandedHomeLayout.setIcon(mIcon.getConstantState().newDrawable(/* TODO getResources() */)); mCurrentExpandedItem = item; if (mExpandedActionView.getParent() != ActionBarView.this) { addView(mExpandedActionView); } if (mExpandedHomeLayout.getParent() != ActionBarView.this) { addView(mExpandedHomeLayout); } mHomeLayout.setVisibility(GONE); if (mTitleLayout != null) mTitleLayout.setVisibility(GONE); if (mTabScrollView != null) mTabScrollView.setVisibility(GONE); if (mSpinner != null) mSpinner.setVisibility(GONE); if (mCustomNavView != null) mCustomNavView.setVisibility(GONE); requestLayout(); item.setActionViewExpanded(true); if (mExpandedActionView instanceof CollapsibleActionView) { ((CollapsibleActionView) mExpandedActionView).onActionViewExpanded(); } return true; }
Example #6
Source File: ActionBarView.java From zen4android with MIT License | 5 votes |
public void collapseActionView() { final MenuItemImpl item = mExpandedMenuPresenter == null ? null : mExpandedMenuPresenter.mCurrentExpandedItem; if (item != null) { item.collapseActionView(); } }
Example #7
Source File: ActionBarView.java From zen4android with MIT License | 5 votes |
@Override public void onClick(View v) { final MenuItemImpl item = mExpandedMenuPresenter.mCurrentExpandedItem; if (item != null) { item.collapseActionView(); } }
Example #8
Source File: ActionBarView.java From zen4android with MIT License | 5 votes |
@Override public boolean collapseItemActionView(MenuBuilder menu, MenuItemImpl item) { // Do this before detaching the actionview from the hierarchy, in case // it needs to dismiss the soft keyboard, etc. if (mExpandedActionView instanceof CollapsibleActionView) { ((CollapsibleActionView) mExpandedActionView).onActionViewCollapsed(); } removeView(mExpandedActionView); removeView(mExpandedHomeLayout); mExpandedActionView = null; if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_HOME) != 0) { mHomeLayout.setVisibility(VISIBLE); } if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0) { if (mTitleLayout == null) { initTitle(); } else { mTitleLayout.setVisibility(VISIBLE); } } if (mTabScrollView != null && mNavigationMode == ActionBar.NAVIGATION_MODE_TABS) { mTabScrollView.setVisibility(VISIBLE); } if (mSpinner != null && mNavigationMode == ActionBar.NAVIGATION_MODE_LIST) { mSpinner.setVisibility(VISIBLE); } if (mCustomNavView != null && (mDisplayOptions & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) { mCustomNavView.setVisibility(VISIBLE); } mExpandedHomeLayout.setIcon(null); mCurrentExpandedItem = null; requestLayout(); item.setActionViewExpanded(false); return true; }
Example #9
Source File: ActionBarSherlockCompat.java From zhangshangwuda with Apache License 2.0 | 5 votes |
@Override public boolean dispatchPrepareOptionsMenu(android.view.Menu menu) { if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] android.view.Menu: " + menu); if (mActionMode != null) { return false; } mMenuIsPrepared = false; if (!preparePanel()) { return false; } if (isReservingOverflow()) { return false; } if (mNativeItemMap == null) { mNativeItemMap = new HashMap<android.view.MenuItem, MenuItemImpl>(); } else { mNativeItemMap.clear(); } if (mMenu == null) { return false; } boolean result = mMenu.bindNativeOverflow(menu, this, mNativeItemMap); if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] returning " + result); return result; }
Example #10
Source File: ActionBarSherlockCompat.java From zhangshangwuda with Apache License 2.0 | 5 votes |
@Override public boolean onMenuItemClick(android.view.MenuItem item) { if (ActionBarSherlock.DEBUG) Log.d(TAG, "[mNativeItemListener.onMenuItemClick] item: " + item); final MenuItemImpl sherlockItem = mNativeItemMap.get(item); if (sherlockItem != null) { sherlockItem.invoke(); } else { Log.e(TAG, "Options item \"" + item + "\" not found in mapping"); } return true; //Do not allow continuation of native handling }
Example #11
Source File: ActionBarView.java From zhangshangwuda with Apache License 2.0 | 5 votes |
@Override public void onClick(View v) { final MenuItemImpl item = mExpandedMenuPresenter.mCurrentExpandedItem; if (item != null) { item.collapseActionView(); } }
Example #12
Source File: ActionBarView.java From zhangshangwuda with Apache License 2.0 | 5 votes |
public void collapseActionView() { final MenuItemImpl item = mExpandedMenuPresenter == null ? null : mExpandedMenuPresenter.mCurrentExpandedItem; if (item != null) { item.collapseActionView(); } }
Example #13
Source File: ActionBarView.java From zhangshangwuda with Apache License 2.0 | 5 votes |
@Override public boolean collapseItemActionView(MenuBuilder menu, MenuItemImpl item) { // Do this before detaching the actionview from the hierarchy, in case // it needs to dismiss the soft keyboard, etc. if (mExpandedActionView instanceof CollapsibleActionView) { ((CollapsibleActionView) mExpandedActionView).onActionViewCollapsed(); } removeView(mExpandedActionView); removeView(mExpandedHomeLayout); mExpandedActionView = null; if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_HOME) != 0) { mHomeLayout.setVisibility(VISIBLE); } if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0) { if (mTitleLayout == null) { initTitle(); } else { mTitleLayout.setVisibility(VISIBLE); } } if (mTabScrollView != null && mNavigationMode == ActionBar.NAVIGATION_MODE_TABS) { mTabScrollView.setVisibility(VISIBLE); } if (mSpinner != null && mNavigationMode == ActionBar.NAVIGATION_MODE_LIST) { mSpinner.setVisibility(VISIBLE); } if (mCustomNavView != null && (mDisplayOptions & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) { mCustomNavView.setVisibility(VISIBLE); } mExpandedHomeLayout.setIcon(null); mCurrentExpandedItem = null; requestLayout(); item.setActionViewExpanded(false); return true; }
Example #14
Source File: ActionBarSherlockCompat.java From Libraries-for-Android-Developers with MIT License | 5 votes |
@Override public boolean dispatchPrepareOptionsMenu(android.view.Menu menu) { if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] android.view.Menu: " + menu); if (mActionMode != null) { return false; } mMenuIsPrepared = false; if (!preparePanel()) { return false; } if (isReservingOverflow()) { return false; } if (mNativeItemMap == null) { mNativeItemMap = new HashMap<android.view.MenuItem, MenuItemImpl>(); } else { mNativeItemMap.clear(); } if (mMenu == null) { return false; } boolean result = mMenu.bindNativeOverflow(menu, this, mNativeItemMap); if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] returning " + result); return result; }
Example #15
Source File: ActionBarSherlockCompat.java From Libraries-for-Android-Developers with MIT License | 5 votes |
@Override public boolean onMenuItemClick(android.view.MenuItem item) { if (ActionBarSherlock.DEBUG) Log.d(TAG, "[mNativeItemListener.onMenuItemClick] item: " + item); final MenuItemImpl sherlockItem = mNativeItemMap.get(item); if (sherlockItem != null) { sherlockItem.invoke(); } else { Log.e(TAG, "Options item \"" + item + "\" not found in mapping"); } return true; //Do not allow continuation of native handling }
Example #16
Source File: ActionBarView.java From Libraries-for-Android-Developers with MIT License | 5 votes |
@Override public void onClick(View v) { final MenuItemImpl item = mExpandedMenuPresenter.mCurrentExpandedItem; if (item != null) { item.collapseActionView(); } }
Example #17
Source File: ActionBarView.java From Libraries-for-Android-Developers with MIT License | 5 votes |
public void collapseActionView() { final MenuItemImpl item = mExpandedMenuPresenter == null ? null : mExpandedMenuPresenter.mCurrentExpandedItem; if (item != null) { item.collapseActionView(); } }
Example #18
Source File: ActionBarView.java From Libraries-for-Android-Developers with MIT License | 5 votes |
@Override public boolean collapseItemActionView(MenuBuilder menu, MenuItemImpl item) { // Do this before detaching the actionview from the hierarchy, in case // it needs to dismiss the soft keyboard, etc. if (mExpandedActionView instanceof CollapsibleActionView) { ((CollapsibleActionView) mExpandedActionView).onActionViewCollapsed(); } removeView(mExpandedActionView); removeView(mExpandedHomeLayout); mExpandedActionView = null; if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_HOME) != 0) { mHomeLayout.setVisibility(VISIBLE); } if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0) { if (mTitleLayout == null) { initTitle(); } else { mTitleLayout.setVisibility(VISIBLE); } } if (mTabScrollView != null && mNavigationMode == ActionBar.NAVIGATION_MODE_TABS) { mTabScrollView.setVisibility(VISIBLE); } if (mSpinner != null && mNavigationMode == ActionBar.NAVIGATION_MODE_LIST) { mSpinner.setVisibility(VISIBLE); } if (mCustomNavView != null && (mDisplayOptions & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) { mCustomNavView.setVisibility(VISIBLE); } mExpandedHomeLayout.setIcon(null); mCurrentExpandedItem = null; requestLayout(); item.setActionViewExpanded(false); return true; }
Example #19
Source File: ActionBarSherlockCompat.java From zen4android with MIT License | 5 votes |
@Override public boolean onMenuItemClick(android.view.MenuItem item) { if (ActionBarSherlock.DEBUG) Log.d(TAG, "[mNativeItemListener.onMenuItemClick] item: " + item); final MenuItemImpl sherlockItem = mNativeItemMap.get(item); if (sherlockItem != null) { sherlockItem.invoke(); } else { Log.e(TAG, "Options item \"" + item + "\" not found in mapping"); } return true; //Do not allow continuation of native handling }
Example #20
Source File: ActionBarSherlockCompat.java From CSipSimple with GNU General Public License v3.0 | 5 votes |
@Override public boolean dispatchPrepareOptionsMenu(android.view.Menu menu) { if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] android.view.Menu: " + menu); if (mActionMode != null) { return false; } mMenuIsPrepared = false; if (!preparePanel()) { return false; } if (isReservingOverflow()) { return false; } if (mNativeItemMap == null) { mNativeItemMap = new HashMap<android.view.MenuItem, MenuItemImpl>(); } else { mNativeItemMap.clear(); } if (mMenu == null) { return false; } boolean result = mMenu.bindNativeOverflow(menu, this, mNativeItemMap); if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] returning " + result); return result; }
Example #21
Source File: ActionBarSherlockCompat.java From CSipSimple with GNU General Public License v3.0 | 5 votes |
@Override public boolean onMenuItemClick(android.view.MenuItem item) { if (ActionBarSherlock.DEBUG) Log.d(TAG, "[mNativeItemListener.onMenuItemClick] item: " + item); final MenuItemImpl sherlockItem = mNativeItemMap.get(item); if (sherlockItem != null) { sherlockItem.invoke(); } else { Log.e(TAG, "Options item \"" + item + "\" not found in mapping"); } return true; //Do not allow continuation of native handling }
Example #22
Source File: ActionBarView.java From CSipSimple with GNU General Public License v3.0 | 5 votes |
@Override public void onClick(View v) { final MenuItemImpl item = mExpandedMenuPresenter.mCurrentExpandedItem; if (item != null) { item.collapseActionView(); } }
Example #23
Source File: ActionBarView.java From CSipSimple with GNU General Public License v3.0 | 5 votes |
public void collapseActionView() { final MenuItemImpl item = mExpandedMenuPresenter == null ? null : mExpandedMenuPresenter.mCurrentExpandedItem; if (item != null) { item.collapseActionView(); } }
Example #24
Source File: ActionBarView.java From CSipSimple with GNU General Public License v3.0 | 5 votes |
@Override public boolean collapseItemActionView(MenuBuilder menu, MenuItemImpl item) { // Do this before detaching the actionview from the hierarchy, in case // it needs to dismiss the soft keyboard, etc. if (mExpandedActionView instanceof CollapsibleActionView) { ((CollapsibleActionView) mExpandedActionView).onActionViewCollapsed(); } removeView(mExpandedActionView); removeView(mExpandedHomeLayout); mExpandedActionView = null; if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_HOME) != 0) { mHomeLayout.setVisibility(VISIBLE); } if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0) { if (mTitleLayout == null) { initTitle(); } else { mTitleLayout.setVisibility(VISIBLE); } } if (mTabScrollView != null && mNavigationMode == ActionBar.NAVIGATION_MODE_TABS) { mTabScrollView.setVisibility(VISIBLE); } if (mSpinner != null && mNavigationMode == ActionBar.NAVIGATION_MODE_LIST) { mSpinner.setVisibility(VISIBLE); } if (mCustomNavView != null && (mDisplayOptions & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) { mCustomNavView.setVisibility(VISIBLE); } mExpandedHomeLayout.setIcon(null); mCurrentExpandedItem = null; requestLayout(); item.setActionViewExpanded(false); return true; }
Example #25
Source File: ActionBarSherlockCompat.java From android-apps with MIT License | 5 votes |
@Override public boolean dispatchPrepareOptionsMenu(android.view.Menu menu) { if (DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] android.view.Menu: " + menu); if (mActionMode != null) { return false; } mMenuIsPrepared = false; if (!preparePanel()) { return false; } if (isReservingOverflow()) { return false; } if (mNativeItemMap == null) { mNativeItemMap = new HashMap<android.view.MenuItem, MenuItemImpl>(); } else { mNativeItemMap.clear(); } if (mMenu == null) { return false; } boolean result = mMenu.bindNativeOverflow(menu, this, mNativeItemMap); if (DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] returning " + result); return result; }
Example #26
Source File: ActionBarSherlockCompat.java From android-apps with MIT License | 5 votes |
@Override public boolean onMenuItemClick(android.view.MenuItem item) { if (DEBUG) Log.d(TAG, "[mNativeItemListener.onMenuItemClick] item: " + item); final MenuItemImpl sherlockItem = mNativeItemMap.get(item); if (sherlockItem != null) { sherlockItem.invoke(); } else { Log.e(TAG, "Options item \"" + item + "\" not found in mapping"); } return true; //Do not allow continuation of native handling }
Example #27
Source File: ActionBarView.java From android-apps with MIT License | 5 votes |
@Override public void onClick(View v) { final MenuItemImpl item = mExpandedMenuPresenter.mCurrentExpandedItem; if (item != null) { item.collapseActionView(); } }
Example #28
Source File: ActionBarView.java From android-apps with MIT License | 5 votes |
public void collapseActionView() { final MenuItemImpl item = mExpandedMenuPresenter == null ? null : mExpandedMenuPresenter.mCurrentExpandedItem; if (item != null) { item.collapseActionView(); } }
Example #29
Source File: ActionBarView.java From android-apps with MIT License | 5 votes |
@Override public boolean collapseItemActionView(MenuBuilder menu, MenuItemImpl item) { // Do this before detaching the actionview from the hierarchy, in case // it needs to dismiss the soft keyboard, etc. if (mExpandedActionView instanceof CollapsibleActionView) { ((CollapsibleActionView) mExpandedActionView).onActionViewCollapsed(); } removeView(mExpandedActionView); removeView(mExpandedHomeLayout); mExpandedActionView = null; if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_HOME) != 0) { mHomeLayout.setVisibility(VISIBLE); } if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0) { if (mTitleLayout == null) { initTitle(); } else { mTitleLayout.setVisibility(VISIBLE); } } if (mTabScrollView != null && mNavigationMode == ActionBar.NAVIGATION_MODE_TABS) { mTabScrollView.setVisibility(VISIBLE); } if (mSpinner != null && mNavigationMode == ActionBar.NAVIGATION_MODE_LIST) { mSpinner.setVisibility(VISIBLE); } if (mCustomNavView != null && (mDisplayOptions & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) { mCustomNavView.setVisibility(VISIBLE); } mExpandedHomeLayout.setIcon(null); mCurrentExpandedItem = null; requestLayout(); item.setActionViewExpanded(false); return true; }
Example #30
Source File: ActionBarSherlockCompat.java From zen4android with MIT License | 5 votes |
@Override public boolean dispatchPrepareOptionsMenu(android.view.Menu menu) { if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] android.view.Menu: " + menu); if (mActionMode != null) { return false; } mMenuIsPrepared = false; if (!preparePanel()) { return false; } if (isReservingOverflow()) { return false; } if (mNativeItemMap == null) { mNativeItemMap = new HashMap<android.view.MenuItem, MenuItemImpl>(); } else { mNativeItemMap.clear(); } if (mMenu == null) { return false; } boolean result = mMenu.bindNativeOverflow(menu, this, mNativeItemMap); if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] returning " + result); return result; }