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


Java PopupWindow.setElevation方法代码示例

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


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

示例1: CustomPopupWindow

import android.widget.PopupWindow; //导入方法依赖的package包/类
private CustomPopupWindow(Builder builder) {

        if (builder.contentViewId == 0 || builder.width == 0 || builder.height == 0) {
            throw new IllegalArgumentException("The parameter is incomplete, be sure to contain contentView, width and height.");
        }

        mContext = builder.context;
        mContentView = LayoutInflater.from(mContext).inflate(builder.contentViewId, null);
        mPopupWindow = new PopupWindow(mContentView, builder.width, builder.height, builder.focus);

        if (Build.VERSION.SDK_INT >= 21) mPopupWindow.setElevation(builder.elevation);
        mPopupWindow.setOutsideTouchable(builder.outsideCancel);
        mPopupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        mPopupWindow.setAnimationStyle(builder.animStyle);
    }
 
开发者ID:InnoFang,项目名称:PartyBuildingStudies,代码行数:16,代码来源:CustomPopupWindow.java

示例2: buildPopupWindow

import android.widget.PopupWindow; //导入方法依赖的package包/类
private PopupWindow buildPopupWindow(Activity parent) {
    LayoutInflater inflater = (LayoutInflater) parent.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    ViewGroup popupViewGroup = parent.findViewById(R.id.popup_layout);
    View popupView = inflater.inflate(R.layout.progress_popup_window, popupViewGroup);

    PopupWindow popupWindow = new PopupWindow(popupView, 750, 350, true);
    popupWindow.setBackgroundDrawable(new ColorDrawable(Color.WHITE));
    popupWindow.setElevation(10);
    popupWindow.setFocusable(false);
    popupWindow.showAtLocation(popupView, Gravity.CENTER, 0, 0);
    return popupWindow;
}
 
开发者ID:stevesoltys,项目名称:backup,代码行数:13,代码来源:RestoreBackupActivityController.java

示例3: init

import android.widget.PopupWindow; //导入方法依赖的package包/类
private void init() {
    setupColors();
    setupList();
    mSearchEditText.setImeOptions(EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
    mStartSearchImageView.setOnClickListener(this);
    mDoneSearchImageView.setOnClickListener(this);
    mSearchEditText.addTextChangedListener(mTextWatcher);

    mPopupWindow = new PopupWindow(mContext);
    mPopupWindow.setContentView(mSpinnerListContainer);
    mPopupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
    mPopupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
    mPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
        @Override
        public void onDismiss() {
            hideEdit();
        }
    });
    mPopupWindow.setFocusable(false);
    mPopupWindow.setElevation(DefaultElevation);
    mPopupWindow.setBackgroundDrawable(ContextCompat.getDrawable(mContext, R.drawable.spinner_drawable));

    mSpinnerListView.setOnItemClickListener(mOnItemSelectedListener);
    if (mCurrSelectedView == null) {
        if (!TextUtils.isEmpty(mSearchHintText)) {
            mSearchEditText.setHint(mSearchHintText);
        }
        if (!TextUtils.isEmpty(mNoItemsFoundText)) {
            mEmptyTextView.setText(mNoItemsFoundText);
        }
        if (mCurrSelectedView == null && !TextUtils.isEmpty(mRevealEmptyText)) {
            TextView textView = new TextView(mContext);
            textView.setText(mRevealEmptyText);
            mCurrSelectedView = new SelectedView(textView, -1, 0);
            mRevealItem.addView(textView);
        }
    } else {
        mSpinnerListView.performItemClick(mCurrSelectedView.getView(), mCurrSelectedView.getPosition(), mCurrSelectedView.getId());
    }
    clearAnimation();
    clearFocus();
}
 
开发者ID:michaelprimez,项目名称:searchablespinner,代码行数:43,代码来源:SearchableSpinner.java


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