android.widget.PopupWindow.setTouchable()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(212)

本文整理了Java中android.widget.PopupWindow.setTouchable()方法的一些代码示例,展示了PopupWindow.setTouchable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PopupWindow.setTouchable()方法的具体详情如下:
包路径:android.widget.PopupWindow
类名称:PopupWindow
方法名:setTouchable

PopupWindow.setTouchable介绍

暂无

代码示例

代码示例来源:origin: GitLqr/LQRWeChat

@Override
public void initTipView() {
  View view = View.inflate(SessionActivity.this, R.layout.popup_audio_wi_vo, null);
  mStateIV = (ImageView) view.findViewById(R.id.rc_audio_state_image);
  mStateTV = (TextView) view.findViewById(R.id.rc_audio_state_text);
  mTimerTV = (TextView) view.findViewById(R.id.rc_audio_timer);
  mRecordWindow = new PopupWindow(view, -1, -1);
  mRecordWindow.showAtLocation(mLlRoot, 17, 0, 0);
  mRecordWindow.setFocusable(true);
  mRecordWindow.setOutsideTouchable(false);
  mRecordWindow.setTouchable(false);
}

代码示例来源:origin: facebook/facebook-android-sdk

mPopupWindow.setTouchable(true);
mPopupContent.setOnClickListener(new View.OnClickListener() {
  @Override

代码示例来源:origin: seven332/EhViewer

mPopup = new PopupWindow(absoluteLayout);
mPopup.setOutsideTouchable(false);
mPopup.setTouchable(false);
mPopup.setFocusable(false);

代码示例来源:origin: stackoverflow.com

_p.setWidth(getWidth());
_p.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
_p.setTouchable(true);
_p.setFocusable(true);
_p.setOutsideTouchable(true);

代码示例来源:origin: ZieIony/Carbon

PopupWindow popupWindow = new PopupWindow(getContext());
popupWindow.setBackgroundDrawable(new ColorDrawable(0x7fff0000));
popupWindow.setTouchable(true);
popupWindow.setAnimationStyle(0);
View view = new View(getContext());

代码示例来源:origin: stackoverflow.com

mPopupWindow = new PopupWindow(popupView, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
mPopupWindow.setOutsideTouchable(true);
mPopupWindow.setTouchable(true);
mPopupWindow.setBackgroundDrawable(new ColorDrawable(0));
mPopupWindow.setFocusable(true);

代码示例来源:origin: pinguo-zhouwei/CustomPopwindow

/**
 * 添加一些属性设置
 * @param popupWindow
 */
private void apply(PopupWindow popupWindow){
  popupWindow.setClippingEnabled(mClippEnable);
  if(mIgnoreCheekPress){
    popupWindow.setIgnoreCheekPress();
  }
  if(mInputMode!=-1){
    popupWindow.setInputMethodMode(mInputMode);
  }
  if(mSoftInputMode!=-1){
    popupWindow.setSoftInputMode(mSoftInputMode);
  }
  if(mOnDismissListener!=null){
    popupWindow.setOnDismissListener(mOnDismissListener);
  }
  if(mOnTouchListener!=null){
    popupWindow.setTouchInterceptor(mOnTouchListener);
  }
  popupWindow.setTouchable(mTouchable);
}

代码示例来源:origin: stackoverflow.com

View popupView = layoutInflater.inflate(R.layout.index_popviewxml,
       null);
   final PopupWindow popupWindow = new PopupWindow(popupView,
       LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT, true);
   popupWindow.setTouchable(true);
   popupWindow.setFocusable(true);
   popupWindow.showAtLocation(popupView, Gravity.CENTER, 0, 0);

代码示例来源:origin: jzyhywxz/PopupWindow

protected void initWindow() {
  mInstance.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
  mInstance.setOutsideTouchable(true);
  mInstance.setTouchable(true);
}

代码示例来源:origin: stackoverflow.com

LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
   PopupWindow  share_popup = new PopupWindow(inflater.inflate(R.layout.share_dropdown, null, false), 162, LinearLayout.LayoutParams.WRAP_CONTENT, true);
   share_popup.setOutsideTouchable(true);
   share_popup.setTouchable(true);
   share_popup.setFocusable(true);
   Drawable image_saved = getResources().getDrawable(R.drawable.dummy_bg);
   share_popup.setBackgroundDrawable(image_saved);

代码示例来源:origin: stackoverflow.com

private void loadingPopup() {
  LayoutInflater inflater = this.getLayoutInflater();
  final View layout = inflater.inflate(R.layout.loading_dialog, null);

  final PopupWindow windows = new PopupWindow(layout , 300,300,true);
  windows.setFocusable(false);
  windows.setTouchable(true); 
  windows.setOutsideTouchable(true);
  layout.post(new Runnable() {
    public void run() {
      windows.showAtLocation(layout,Gravity.CENTER, 0, 0);
    }
  });
}

代码示例来源:origin: stackoverflow.com

int[] location = new int[2];
counterView.getLocationOnScreen(location);
final View mView = inflater.inflate(R.layout.xxxx, null, false);
final PopupWindow popUp = new PopupWindow(mView, Width, Height, false);
popUp.setTouchable(true);
popUp.setFocusable(true);
popUp.setOutsideTouchable(true);
popUp.showAtLocation(view, Gravity.NO_GRAVITY, location[0], location[1]);

代码示例来源:origin: stackoverflow.com

int[] location = new int[2];
counterView.getLocationOnScreen(location);
final View mView = inflater.inflate(R.layout.xxxx, null, false);
final PopupWindow popUp = new PopupWindow(mView, Width, Height, false);
popUp.setTouchable(true);
popUp.setFocusable(true);
popUp.setOutsideTouchable(true);
popUp.showAtLocation(view, Gravity.NO_GRAVITY, location[0], location[1]);

代码示例来源:origin: stackoverflow.com

PopupWindow dropdown_group_popup_window ;
View popupView =  dropdown_layoutInflater.inflate(R.layout.visibility_dropdown_window, (ViewGroup) findViewById(R.id.visibility_dropdown_view)); dropdown_group_popup_window = new PopupWindow(popupView, WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT);
       dropdown_group_popup_window.setContentView(popupView);//you can enter your layout here which you wanna show as a dropdown
       dropdown_group_popup_window.showAsDropDown(view); // here you need to pass the view below which you want to show your dropdown
  dropdown_group_popup_window.setOutsideTouchable(true);
     dropdown_group_popup_window.setTouchable(true);
     dropdown_group_popup_window.setBackgroundDrawable(new BitmapDrawable());

代码示例来源:origin: tohodog/QSVideoPlayer

private PopupWindow getPopupWindow(View popupView) {
  PopupWindow mPopupWindow = new PopupWindow(popupView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true);
  mPopupWindow.setTouchable(true);
  mPopupWindow.setOutsideTouchable(true);
  mPopupWindow.setBackgroundDrawable(new ColorDrawable(0));
  mPopupWindow.setAnimationStyle(R.style.jc_popup_toast_anim);
  return mPopupWindow;
}

代码示例来源:origin: stackoverflow.com

text_click=(TextView)findViewById(R.id.text_click);

     text_click.setOnClickListener(new View.OnClickListener() {
       @Override
       public void onClick(View v) {
         LayoutInflater inflater= (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
         int[] locationOfView = new int[2];
         text_click.getLocationOnScreen(locationOfView);
         final View mView = inflater.inflate(R.layout.activity_map_view, null, false);
         final PopupWindow popUp = new PopupWindow(mView, 500, 500, false);
         popUp.setTouchable(true);
         popUp.setFocusable(true);
         popUp.setOutsideTouchable(true);
popUp.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(mContext,android.R.color.transparent)));
         popUp.showAtLocation(mView, Gravity.NO_GRAVITY, locationOfView[0], (locationOfView[1]+ text_click.getHeight()));
       }
     });

代码示例来源:origin: stackoverflow.com

public void popup() {
  // TODO Auto-generated method stub
  LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View popupView = inflater.inflate(R.layout.popuplayout, null, false);

  PopupWindow pw = new PopupWindow(getActivity());
  pw.setWidth(WindowManager.LayoutParams.MATCH_PARENT);
  pw.setHeight(WindowManager.LayoutParams.MATCH_PARENT);

  pw.setTouchable(true);
  pw.setFocusable(true);
  pw.setOutsideTouchable(true);
  pw.setContentView(popupView);

  pw.showAtLocation(popupView, Gravity.CENTER, 0, 0);
}

代码示例来源:origin: dongorigin/AndroidDemo

@Override
protected void initPageView() {
  popupButton = (Button) findViewById(R.id.btn_popup);
  popupView = getLayoutInflater().inflate(R.layout.popup_window_layout, null);
  popupWindow = new PopupWindow(popupView, LayoutParams.MATCH_PARENT,
      LayoutParams.WRAP_CONTENT);
  popupWindow.setTouchable(true);
  popupWindow.setOutsideTouchable(true);
  popupWindow.setBackgroundDrawable(new BitmapDrawable());
  popupWindow.setAnimationStyle(R.style.PopupWindowAnimation);
}

代码示例来源:origin: 18Gray/ProCamera

public static PopupWindow createFilterPopupWindow(Context context)
{
  LayoutInflater layoutInflater = LayoutInflater.from(context);
  View view = layoutInflater.inflate(R.layout.layout_common_recycler, null);
  RecyclerLayout recycler_layout = (RecyclerLayout) view.findViewById(R.id.recycler_layout);
  List<VerticalRecyclerItem> verticalRecyclerItemArrayList = GenerateDataUtils.generateFilterMenuList();
  recycler_layout.setLayoutManagerNum(2);
  RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) recycler_layout.getLayoutParams();
  layoutParams.width = RelativeLayout.LayoutParams.MATCH_PARENT;
  layoutParams.height = DimenUtil.dp2px(context, 120);
  recycler_layout.setLayoutParams(layoutParams);
  recycler_layout.showRecyclerView(GenerateDataUtils.generateDataBeanList(8, verticalRecyclerItemArrayList), Constants.viewModelPackage);
  PopupWindow popupWindow = new PopupWindow(view, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
  popupWindow.setTouchable(true);
  popupWindow.setOutsideTouchable(true);
  popupWindow.setBackgroundDrawable(new BitmapDrawable(context.getResources(), (Bitmap) null));
  return popupWindow;
}

代码示例来源:origin: Jay-Goo/MultiSelectPopWindow

private MultiSelectPopWindow(final Builder builder){
  mBuilder = builder;
  //init PopWindow
  View popview = View.inflate(builder.mActivity, R.layout.multi_select_list_popwindow, null);
  mPopupWindow = new PopupWindow(popview, WindowManager.LayoutParams.MATCH_PARENT,
      WindowManager.LayoutParams.WRAP_CONTENT);
  mPopupWindow.setAnimationStyle(R.style.popwindow_anim_style);
  mPopupWindow.setBackgroundDrawable(new ColorDrawable(0x00000000));
  mPopupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
  mPopupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
  mPopupWindow.setFocusable(true);
  mPopupWindow.setTouchable(true);
  mPopupWindow.setOutsideTouchable(builder.isOutsideTouchable);
  initViews(mPopupWindow.getContentView());
  initListener();
}

相关文章