当前位置: 首页>>代码示例>>Java>>正文


Java ListPopupWindow.setHeight方法代码示例

本文整理汇总了Java中android.widget.ListPopupWindow.setHeight方法的典型用法代码示例。如果您正苦于以下问题:Java ListPopupWindow.setHeight方法的具体用法?Java ListPopupWindow.setHeight怎么用?Java ListPopupWindow.setHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.ListPopupWindow的用法示例。


在下文中一共展示了ListPopupWindow.setHeight方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initPopup

import android.widget.ListPopupWindow; //导入方法依赖的package包/类
private void initPopup() {
	View menuItemView = getActivity().findViewById(R.id.pick_category);
	listPopupWindow = new ListPopupWindow(getActivity());
	listPopupWindow.setAnchorView(menuItemView);
	listPopupWindow.setModal(true);
	listPopupWindow.setWidth(categoryListWidth);
	listPopupWindow.setHeight(ListPopupWindow.WRAP_CONTENT);
	listPopupWindow
			.setOnDismissListener(new PopupWindow.OnDismissListener() {
				@Override
				public void onDismiss() {
					if (ourListAdapter != null)
						ourListAdapter.notifyDataSetChanged();
				}
			});
}
 
开发者ID:simonjrp,项目名称:ESCAPE,代码行数:17,代码来源:TaskListFragment.java

示例2: initPopup

import android.widget.ListPopupWindow; //导入方法依赖的package包/类
private void initPopup() {
	View menuItemView = getActivity().findViewById(R.id.pick_category);
	listPopupWindow = new ListPopupWindow(getActivity());
	listPopupWindow.setAnchorView(menuItemView);
	listPopupWindow.setModal(true);
	listPopupWindow.setWidth(categoryListWidth);
	listPopupWindow.setHeight(ListPopupWindow.WRAP_CONTENT);
	listPopupWindow
			.setOnDismissListener(new PopupWindow.OnDismissListener() {
				@Override
				public void onDismiss() {
					if (listAdapter != null)
						listAdapter.notifyDataSetChanged();
				}
			});
}
 
开发者ID:simonjrp,项目名称:ESCAPE,代码行数:17,代码来源:ExpandableEventListFragment.java

示例3: createPopWindow

import android.widget.ListPopupWindow; //导入方法依赖的package包/类
private void createPopWindow(){
    popupWindow = new ListPopupWindow(getContext());
    popupAdapter = new SelectorAdapter();
    popupWindow.setAnchorView(parent.getChildAt(0));
    popupWindow.setAdapter(popupAdapter);
    popupWindow.setWidth(WindowManager.LayoutParams.MATCH_PARENT);
    popupWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
    //获取焦点
    popupWindow.setModal(true);

    popupWindow.setOnItemClickListener(this);
    popupWindow.setOnDismissListener(this);
}
 
开发者ID:newbiechen1024,项目名称:NovelReader,代码行数:14,代码来源:SelectorView.java

示例4: createPopupFolderList

import android.widget.ListPopupWindow; //导入方法依赖的package包/类
/** 创建弹出的ListView */
private void createPopupFolderList(int width, int height) {
    mFolderPopupWindow = new ListPopupWindow(this);
    mFolderPopupWindow.setBackgroundDrawable(null);
    mFolderPopupWindow.setAdapter(mImageFolderAdapter);
    mFolderPopupWindow.setContentWidth(width);
    mFolderPopupWindow.setWidth(width);  //如果不设置,就是 AnchorView 的宽度
    mFolderPopupWindow.setHeight(height * 5 / 8);
    mFolderPopupWindow.setAnchorView(mFooterBar);  //ListPopupWindow总会相对于这个View
    mFolderPopupWindow.setModal(false);  //是否为模态,影响返回键的处理
    mFolderPopupWindow.setAnimationStyle(R.style.popupwindow_anim_style);
    mFolderPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
        @Override
        public void onDismiss() {
            backgroundAlpha(1.0f);
        }
    });
    mFolderPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
            mImageFolderAdapter.setSelectIndex(position);
            imagePicker.setCurrentImageFolderPosition(position);
            mFolderPopupWindow.dismiss();
            ImageFolder imageFolder = (ImageFolder) adapterView.getAdapter().getItem(position);
            if (null != imageFolder) {
                mImageGridAdapter.refreshData(imageFolder.images);
                mBtnDir.setText(imageFolder.name);
            }
            gv_photo_list.smoothScrollToPosition(0);//滑动到顶部
        }
    });
}
 
开发者ID:dyzs,项目名称:YinjiImageEditor,代码行数:33,代码来源:PhotoMutiSelectActivity.java

示例5: initPopupWindow

import android.widget.ListPopupWindow; //导入方法依赖的package包/类
private void initPopupWindow() {
    popupWindow = new ListPopupWindow(mContext) {

        @Override
        public void show() {
            super.show();
            mRightImageTopView.setClickable(true);
            mRightIv.startAnimation(mAnimation);
        }

        @Override
        public void dismiss() {
            super.dismiss();
        }

    };
    popupWindow.setOnItemClickListener(this);
    popupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
    popupWindow.setPromptPosition(ListPopupWindow.POSITION_PROMPT_BELOW);
    popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
    popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
    popupWindow.setAnchorView(editText);
    popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
        @Override
        public void onDismiss() {
            popupWindowHideTime = System.currentTimeMillis();
            mRightIv.startAnimation(mResetAnimation);
        }
    });
}
 
开发者ID:WrBug,项目名称:EditSpinner,代码行数:31,代码来源:EditSpinner.java

示例6: createPopupFolderList

import android.widget.ListPopupWindow; //导入方法依赖的package包/类
private void createPopupFolderList() {
    mFolderPopupWindow = new ListPopupWindow(this);
    mFolderPopupWindow.setAdapter(mFolderAdapter);
    mFolderPopupWindow.setContentWidth(ListPopupWindow.MATCH_PARENT);
    mFolderPopupWindow.setWidth(ListPopupWindow.MATCH_PARENT);
    mFolderPopupWindow.setHeight(ListPopupWindow.MATCH_PARENT);
    mFolderPopupWindow.setAnchorView(toolbar);
    mFolderPopupWindow.setModal(true);
    mFolderPopupWindow.setAnimationStyle(R.style.popwindow_anim_style);
    mFolderPopupWindow.setOnItemClickListener(this);
}
 
开发者ID:gzsll,项目名称:TLint,代码行数:12,代码来源:GalleryActivity.java

示例7: createPopUps

import android.widget.ListPopupWindow; //导入方法依赖的package包/类
private void createPopUps() {
    //Create the Adapter
    if (mAdapterReference == null) {
        mAdapterItemType = new ArrayAdapter(getContext(), R.layout.reference_spinner_item, new String[]{"Simple Item", "Expandable", "Expandable Section", "Section"});
        mAdapterReference = new ArrayAdapter(getContext(), R.layout.reference_spinner_item, getListener().getReferenceList());
    }
    //Setting up the popups
    Log.d(TAG, "Setting up the Popups");
    //Item Type
    mPopupItemType = new ListPopupWindow(getContext());
    mPopupItemType.setAnchorView(mBottomSheetDialog.findViewById(R.id.select_item_type));
    mPopupItemType.setModal(true);
    mPopupItemType.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NOT_NEEDED);
    mPopupItemType.setAnimationStyle(android.R.style.Animation_Dialog);
    mPopupItemType.setAdapter(mAdapterItemType);
    mPopupItemType.setVerticalOffset(-100);

    //Header Reference
    mPopupReference = new ListPopupWindow(getContext());
    mPopupReference.setAnchorView(mBottomSheetDialog.findViewById(R.id.select_reference_button));
    mPopupReference.setModal(true);
    mPopupReference.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NOT_NEEDED);
    mPopupReference.setAnimationStyle(android.R.style.Animation_Dialog);
    mPopupReference.setAdapter(mAdapterReference);
    mPopupReference.setVerticalOffset(-100);
    if (mAdapterReference.getCount() > 6)
        mPopupReference.setHeight(getResources().getDimensionPixelSize(R.dimen.popup_max_height));
}
 
开发者ID:davideas,项目名称:FlexibleAdapter,代码行数:29,代码来源:BottomSheetSectionDialog.java

示例8: onLongClick

import android.widget.ListPopupWindow; //导入方法依赖的package包/类
@Override public boolean onLongClick(View v) {
	String[] versions = { "Camera", "Laptop", "Watch", "Smartphone",
			"Television" };
	final ListPopupWindow listPopupWindow = new ListPopupWindow(
			getActivity());
	listPopupWindow.setAdapter(new ArrayAdapter<String>(getActivity(),
			android.R.layout.simple_dropdown_item_1line, versions));
	listPopupWindow.setAnchorView(mListPopupButton);
	listPopupWindow.setWidth(300);
	listPopupWindow.setHeight(400);

	listPopupWindow.setModal(true);
	listPopupWindow.show();
	return false;
}
 
开发者ID:negusoft,项目名称:GreenMatter,代码行数:16,代码来源:ButtonFragment.java

示例9: initFromAttributes

import android.widget.ListPopupWindow; //导入方法依赖的package包/类
private void initFromAttributes(Context context, AttributeSet attrs, int defStyleAttr) {
    final TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.EditSpinner, defStyleAttr, 0);

    mPopup = new ListPopupWindow(context, attrs);
    mPopup.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
    mPopup.setPromptPosition(ListPopupWindow.POSITION_PROMPT_BELOW);

    Drawable selector = a.getDrawable(R.styleable.EditSpinner_dropDownSelector);
    if (selector != null) {
        mPopup.setListSelector(selector);
    }

    int dropDownAnimStyleResId = a.getResourceId(R.styleable.EditSpinner_dropDownAnimStyle, -1);
    if (dropDownAnimStyleResId > 0) {
        setDropDownAnimationStyle(dropDownAnimStyleResId);
    }

    mDropDownDrawable = a.getDrawable(R.styleable.EditSpinner_dropDownDrawable);
    int dropDownDrawableSpacing = a.getDimensionPixelOffset(R.styleable.EditSpinner_dropDownDrawableSpacing, 0);

    if (mDropDownDrawable != null) {
        int dropDownDrawableWidth = a.getDimensionPixelOffset(R.styleable.EditSpinner_dropDownDrawableWidth, -1);
        int dropDownDrawableHeight = a.getDimensionPixelOffset(R.styleable.EditSpinner_dropDownDrawableHeight, -1);
        setDropDownDrawable(mDropDownDrawable, dropDownDrawableWidth, dropDownDrawableHeight);
        setDropDownDrawableSpacing(dropDownDrawableSpacing);
    }

    // Get the anchor's id now, but the view won't be ready, so wait to actually get the
    // view and store it in mDropDownAnchorView lazily in getDropDownAnchorView later.
    // Defaults to NO_ID, in which case the getDropDownAnchorView method will simply return
    // this TextView, as a default anchoring point.
    mDropDownAnchorId = a.getResourceId(R.styleable.EditSpinner_dropDownAnchor,
            View.NO_ID);


    // For dropdown width, the developer can specify a specific width, or MATCH_PARENT
    // (for full screen width) or WRAP_CONTENT (to match the width of the anchored view).
    mPopup.setWidth(a.getLayoutDimension(R.styleable.EditSpinner_dropDownWidth,
            ViewGroup.LayoutParams.WRAP_CONTENT));
    mPopup.setHeight(a.getLayoutDimension(R.styleable.EditSpinner_dropDownHeight,
            ViewGroup.LayoutParams.WRAP_CONTENT));

    mPopup.setOnItemClickListener(new DropDownItemClickListener());
    mPopup.setOnDismissListener(new PopupWindow.OnDismissListener() {
        @Override
        public void onDismiss() {
            mLastDismissTime = SystemClock.elapsedRealtime();
            if (mOnDismissListener != null) {
                mOnDismissListener.onDismiss();
            }
        }
    });
    a.recycle();

    mIsEditable = getKeyListener() != null;

    setFocusable(true);
    addTextChangedListener(new MyWatcher());
}
 
开发者ID:xyxyLiu,项目名称:Edit-Spinner,代码行数:60,代码来源:EditSpinner.java

示例10: createPopupFolderList

import android.widget.ListPopupWindow; //导入方法依赖的package包/类
private void createPopupFolderList(int width, int height) {
	
    folderPopupWindow = new ListPopupWindow(getActivity());
    folderPopupWindow.setBackgroundDrawable(null);
    folderPopupWindow.setAdapter(folderAdapter);
    folderPopupWindow.setContentWidth(width);
    folderPopupWindow.setWidth(width);
    folderPopupWindow.setHeight(height * 5 / 8);
    folderPopupWindow.setAnchorView(popupAnchorView);
    folderPopupWindow.setModal(true);
    folderPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {

            folderAdapter.setSelectIndex(i);

            final int index = i;
            final AdapterView v = adapterView;

            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    folderPopupWindow.dismiss();

                    if (index == 0) {
                        getActivity().getSupportLoaderManager().restartLoader(LOADER_ALL, null, mLoaderCallback);
                        category_button.setText(R.string.all_folder);
                        callback.onChangeAlbum(context.getResources().getString(R.string.all_folder));
                        if (imageConfig.isShowCamera()) {
                            imageAdapter.setShowCamera(true);
                        } else {
                            imageAdapter.setShowCamera(false);
                        }
                    } 
                    else {
                        Folder folder = (Folder) v.getAdapter().getItem(index);
                        if (null != folder) {
                            imageList.clear();
                            imageList.addAll(folder.images);
                            imageAdapter.notifyDataSetChanged();

                            category_button.setText(folder.name);
                            callback.onChangeAlbum(folder.name);
                            if (resultList != null && resultList.size() > 0) {
                                imageAdapter.setDefaultSelected(resultList);
                            }
                        }
                        imageAdapter.setShowCamera(false);
                    }

                    grid_image.smoothScrollToPosition(0);
                }
            }, 100);
        }
    });
    
}
 
开发者ID:jaikydota,项目名称:Android-ImagesPickers,代码行数:58,代码来源:ImageSelectorFragment.java


注:本文中的android.widget.ListPopupWindow.setHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。