com.actionbarsherlock.view.Menu Java Examples

The following examples show how to use com.actionbarsherlock.view.Menu. 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: NewsContentActivity.java    From zhangshangwuda with Apache License 2.0 6 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
	menu.add(Menu.NONE, MENU_REFRESH, 1,
			getResources().getString(R.string.refresh))
			.setIcon(R.drawable.ic_menu_refresh)
			.setShowAsAction(
					MenuItem.SHOW_AS_ACTION_IF_ROOM
							| MenuItem.SHOW_AS_ACTION_WITH_TEXT);
	// menu.add(Menu.NONE, MENU_SNS, 2,
	// getResources().getString(R.string.share))
	// .setIcon(R.drawable.ic_menu_share)
	// .setShowAsAction(
	// MenuItem.SHOW_AS_ACTION_IF_ROOM
	// | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
	;
	return true;
}
 
Example #2
Source File: ProfileEdit.java    From Favorite-Android-Client with Apache License 2.0 6 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
	super.onCreateOptionsMenu(menu);
	MenuItem item;

	SubMenu subMenu1 = menu.addSubMenu(getString(R.string.permission));
	subMenu1.add(0, 1001, 0, getString(R.string.privacy_content));
	subMenu1.add(0, 1002, 0, getString(R.string.write_permission));

	MenuItem subMenu1Item = subMenu1.getItem();
	subMenu1Item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
	
if(!Global.getSetting("user_srl", "0").matches(member_srl))	menu.add(0, 1, 0, getString(R.string.delete))
	.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);

	// item = menu.add(0, 1, 0, R.string.Main_MenuAddBookmark);
	// item.setIcon(R.drawable.ic_menu_add_bookmark);

	return true;
}
 
Example #3
Source File: SherlockExpandableListActivity.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
@Override
public final boolean onMenuOpened(int featureId, android.view.Menu menu) {
    if (getSherlock().dispatchMenuOpened(featureId, menu)) {
        return true;
    }
    return super.onMenuOpened(featureId, menu);
}
 
Example #4
Source File: SherlockActivity.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
@Override
public boolean onPreparePanel(int featureId, View view, Menu menu) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        return onPrepareOptionsMenu(menu);
    }
    return false;
}
 
Example #5
Source File: SherlockExpandableListActivity.java    From zen4android with MIT License 5 votes vote down vote up
@Override
public boolean onCreatePanelMenu(int featureId, Menu menu) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        return onCreateOptionsMenu(menu);
    }
    return false;
}
 
Example #6
Source File: ZenMainActivity.java    From zen4android with MIT License 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
	if (mHasNewNotification) {
		getSupportMenuInflater().inflate(R.menu.zen_threads_red, menu);
	} else {
		getSupportMenuInflater().inflate(R.menu.zen_threads, menu);
	}
	return true;
}
 
Example #7
Source File: ActionBarSherlockCompat.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void dispatchPanelClosed(int featureId, android.view.Menu menu){
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPanelClosed] featureId: " + featureId + ", menu: " + menu);

    if (featureId == Window.FEATURE_ACTION_BAR || featureId == Window.FEATURE_OPTIONS_PANEL) {
        if (aActionBar != null) {
            aActionBar.dispatchMenuVisibilityChanged(false);
        }
    }
}
 
Example #8
Source File: SherlockPreferenceActivity.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
@Override
public final boolean onMenuOpened(int featureId, android.view.Menu menu) {
    if (getSherlock().dispatchMenuOpened(featureId, menu)) {
        return true;
    }
    return super.onMenuOpened(featureId, menu);
}
 
Example #9
Source File: CallLogListFragment.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);

    int actionRoom = getResources().getBoolean(R.bool.menu_in_bar) ? MenuItem.SHOW_AS_ACTION_IF_ROOM : MenuItem.SHOW_AS_ACTION_NEVER;
    MenuItem delMenu = menu.add(R.string.callLog_delete_all);
    delMenu.setIcon(R.drawable.ic_ab_trash_dark).setShowAsAction(actionRoom);
    delMenu.setOnMenuItemClickListener(new OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(MenuItem item) {
            deleteAllCalls();
            return true;
        }
    });
}
 
Example #10
Source File: ProfileInfo.java    From Favorite-Android-Client with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
	super.onCreateOptionsMenu(menu);
	// this.optionsMenu = menu;
	MenuItem item;

	menu.add(0, 1, 0, getString(R.string.unfavorite)).setShowAsAction(
			MenuItem.SHOW_AS_ACTION_NEVER);

	menu.findItem(1).setVisible(me_status == 3);
	// item = menu.add(0, 1, 0, R.string.Main_MenuAddBookmark);
	// item.setIcon(R.drawable.ic_menu_add_bookmark);

	return true;
}
 
Example #11
Source File: SherlockPreferenceActivity.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
@Override
public final boolean onMenuOpened(int featureId, android.view.Menu menu) {
    if (getSherlock().dispatchMenuOpened(featureId, menu)) {
        return true;
    }
    return super.onMenuOpened(featureId, menu);
}
 
Example #12
Source File: SherlockListActivity.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onCreatePanelMenu(int featureId, Menu menu) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        return onCreateOptionsMenu(menu);
    }
    return false;
}
 
Example #13
Source File: ActionBarSherlockCompat.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
void checkCloseActionMenu(Menu menu) {
    if (mClosingActionMenu) {
        return;
    }

    mClosingActionMenu = true;
    wActionBar.dismissPopupMenus();
    //Callback cb = getCallback();
    //if (cb != null && !isDestroyed()) {
    //    cb.onPanelClosed(FEATURE_ACTION_BAR, menu);
    //}
    mClosingActionMenu = false;
}
 
Example #14
Source File: SherlockActivity.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
@Override
public final boolean onMenuOpened(int featureId, android.view.Menu menu) {
    if (getSherlock().dispatchMenuOpened(featureId, menu)) {
        return true;
    }
    return super.onMenuOpened(featureId, menu);
}
 
Example #15
Source File: SherlockListActivity.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
@Override
public final boolean onMenuOpened(int featureId, android.view.Menu menu) {
    if (getSherlock().dispatchMenuOpened(featureId, menu)) {
        return true;
    }
    return super.onMenuOpened(featureId, menu);
}
 
Example #16
Source File: AlreadyRegisteredActivity.java    From product-emm with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
	if (Constants.DEBUG_MODE_ENABLED) {
		getSupportMenuInflater().inflate(R.menu.sherlock_menu_debug, menu);
	} else {
		getSupportMenuInflater().inflate(R.menu.sherlock_menu, menu);
	}
	return true;
}
 
Example #17
Source File: SherlockListActivity.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
@Override
public boolean onPreparePanel(int featureId, View view, Menu menu) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        return onPrepareOptionsMenu(menu);
    }
    return false;
}
 
Example #18
Source File: SherlockListActivity.java    From zen4android with MIT License 5 votes vote down vote up
@Override
public final boolean onMenuOpened(int featureId, android.view.Menu menu) {
    if (getSherlock().dispatchMenuOpened(featureId, menu)) {
        return true;
    }
    return super.onMenuOpened(featureId, menu);
}
 
Example #19
Source File: DefaultStyleActivity.java    From android-opensource-library-56 with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    //通常のActivityでの呼び出し方
    //MenuInflater inflator = getMenuInflater();

    MenuInflater inflator = getSupportMenuInflater();

    inflator.inflate(R.menu.default_style, menu);
    return true;
}
 
Example #20
Source File: StandaloneActionMode.java    From CSipSimple with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Menu getMenu() {
    return mMenu;
}
 
Example #21
Source File: SherlockListActivity.java    From zhangshangwuda with Apache License 2.0 4 votes vote down vote up
public boolean onPrepareOptionsMenu(Menu menu) {
    return true;
}
 
Example #22
Source File: not_covered_not_covered_s.java    From coming with MIT License 4 votes vote down vote up
public android.view.Menu unwrap() {
    return mNativeMenu;
}
 
Example #23
Source File: SherlockDialogFragment.java    From android-apps with MIT License 4 votes vote down vote up
@Override
public void onPrepareOptionsMenu(Menu menu) {
    //Nothing to see here.
}
 
Example #24
Source File: MainPrefs.java    From CSipSimple with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getSupportMenuInflater();
    inflater.inflate(R.menu.main_prefs, menu);
    return super.onCreateOptionsMenu(menu);
}
 
Example #25
Source File: SherlockFragmentActivity.java    From zhangshangwuda with Apache License 2.0 4 votes vote down vote up
@Override
public final boolean onPrepareOptionsMenu(android.view.Menu menu) {
    return true;
}
 
Example #26
Source File: SherlockListActivity.java    From android-apps with MIT License 4 votes vote down vote up
@Override
public final boolean onCreateOptionsMenu(android.view.Menu menu) {
    return getSherlock().dispatchCreateOptionsMenu(menu);
}
 
Example #27
Source File: SnapSampleActivity.java    From QuickReturnHeader with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getSupportMenuInflater().inflate(R.menu.main, menu);
    return true;
}
 
Example #28
Source File: AuthenticationActivity.java    From product-emm with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
	getSupportMenuInflater().inflate(R.menu.auth_sherlock_menu, menu);
	return true;
}
 
Example #29
Source File: SherlockExpandableListActivity.java    From Libraries-for-Android-Developers with MIT License 4 votes vote down vote up
public boolean onCreateOptionsMenu(Menu menu) {
    return true;
}
 
Example #30
Source File: ArrayAdapterActivity.java    From MultiChoiceAdapter with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getSupportMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}