Android ListPopupWindow - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ListPopupWindow class.

This code example shows how to use the following methods:dismiss, isShowing, show
	/** 
	 * Dismiss the popup window. 
	 */ 
	public void dismiss() { 
		if (isShowing()) { 
			mWindow.dismiss();
		} 
	} 
 
	public Menu getMenu() {
		return mMenu;
	} 
 
	public MenuInflater getMenuInflater() {
		return new MenuInflater(mContext);
	} 
 
	public void inflate(final int menuRes) {
		new MenuInflater(mContext).inflate(menuRes, mMenu);
	} 

7
CodeRank
This code example shows how to use the following methods:dismiss, isShowing, show
        return true; 
    } 
 
    public void dismiss() { 
        if (isShowing()) { 
            mPopup.dismiss();
        } 
    } 
 
    public void onDismiss() { 
        mPopup = null;
        mMenu.close();
        if (mTreeObserver != null) {
            if (!mTreeObserver.isAlive()) mTreeObserver = mAnchorView.getViewTreeObserver();
            mTreeObserver.removeGlobalOnLayoutListener(this);
            mTreeObserver = null;
        } 
        mAnchorView.removeOnAttachStateChangeListener(this);
    } 
 

7
CodeRank
This code example shows how to use the following methods:setOnDismissListener, show
        final PhotoActionListener listener = getListener();
        if (listener != null) {
            if (getWritableEntityIndex() != -1) { 
                mPopup = PhotoActionPopup.createPopupMenu(
                        mContext, mPhotoView, listener, mPhotoMode);
                mPopup.setOnDismissListener(new OnDismissListener() {
                    @Override 
                    public void onDismiss() { 
                        listener.onPhotoSelectionDismissed();
                    } 
                }); 
                mPopup.show();
            } 
        } 
    } 
 
    /** 
     * Attempts to handle the given activity result.  Returns whether this handler was able to 
     * process the result successfully. 
     * @param requestCode The request code. 
6
CodeRank
This code example shows how to use the following methods:dismiss
        final ListPopupWindow listPopupWindow = new ListPopupWindow(context);
        final OnItemClickListener clickListener = new OnItemClickListener() {
            @Override 
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                final ChoiceListItem choice = choices.get(position);
                listPopupWindow.dismiss();
 
                switch (choice.getId()) {
                    case ChoiceListItem.ID_USE_AS_PRIMARY:
                        listener.onUseAsPrimaryChosen();
                        break; 
                    case ChoiceListItem.ID_REMOVE:
                        listener.onRemovePictureChosen();
                        break; 
                    case ChoiceListItem.ID_TAKE_PHOTO:
                        listener.onTakePhotoChosen();
                        break; 
                    case ChoiceListItem.ID_PICK_PHOTO:
                        listener.onPickFromGalleryChosen();
                        break; 
6
CodeRank
This code example shows how to use the following methods:dismiss, isShowing, show
	 * Dismiss the popup window. 
	 */ 
	@Override 
	public void dismiss() { 
		if (isPopupWindowShowing()) { 
			mWindow.dismiss();
		} 
	} 
 
	@Override 
	public Menu getMenu() {
		return mMenu;
	} 
 
	public MenuInflater getMenuInflater() {
		return new MenuInflater(mContext);
	} 
 
	@Override 
	public void inflate(int menuRes) {

6
CodeRank
This code example shows how to use the following methods:getListView, setAdapter, setAnchorView, setModal, setOnDismissListener
This code example shows how to use the following methods:getListView, setAdapter, setAnchorView, setModal, setOnDismissListener
This code example shows how to use the following methods:dismiss, getListView, isShowing
		Log.d("UseListPopupWindow", "onTouch() child className:"+className);
		 
		int motionAction = motionEvent.getAction();
		switch(motionAction){
		case MotionEvent.ACTION_DOWN:
			if(popup.isShowing()){
				popup.dismiss();
				popup.getListView().clearFocus();
			} 
			break; 
		case MotionEvent.ACTION_UP:
			break; 
		} 
		return false; 
	} 
	@Override 
	public void onFocusChange(View arg0, boolean hasFocus) {
		Log.d("UseListPopupWindow", " onFocusChange() autoTv:"+hasFocus);
		// TODO Auto-generated method stub 
		 
5
CodeRank
This code example shows how to use the following methods:dismiss, isShowing
     * 
     * @param popup The popup window to close. 
     * @return {@code true} if the popup was showing. {@code false} otherwise. 
     */ 
    public static boolean closeQuietly(ListPopupWindow popup) {
        if (popup != null && popup.isShowing()) {
            popup.dismiss();
            return true; 
        } 
        return false; 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:dismiss, isShowing
     * 
     * @param popup The popup window to close. 
     * @return {@code true} if the popup was showing. {@code false} otherwise. 
     */ 
    public static boolean closeQuietly(ListPopupWindow popup) {
        if (popup != null && popup.isShowing()) {
            popup.dismiss();
            return true; 
        } 
        return false; 
    } 
} 
5
CodeRank

Related Android ListPopupWindow Questions & Answers:

See Code Examples for Android ListPopupWindow Methods: