Java Code Examples for android.widget.PopupWindow.OnDismissListener

The following are top voted examples for showing how to use android.widget.PopupWindow.OnDismissListener. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: HiBangClient   File: RecommendActivity.java   View source code 6 votes vote down vote up
private void initPopupWindow() {

		mPopupWindow = new NearByPopupWindow(this);
		mPopupWindow.setOnSubmitClickListener(new onSubmitClickListener() {

			@Override
			public void onClick() {
				// mPeopleFragment.onManualRefresh();
			}
		});
		mPopupWindow.setOnDismissListener(new OnDismissListener() {

			@Override
			public void onDismiss() {
				mHeaderSpinner.initSpinnerState(false);
			}
		});

	}
 
Example 2
Project: letv   File: PaySucceedActivity.java   View source code 6 votes vote down vote up
private void pointMeSendRedPackage() {
    if (this.mHalfPlaySharePopwindow == null) {
        ShareUtils.RequestShareLink(this);
        if (this.mRedPacketBean != null) {
            this.mHalfPlaySharePopwindow = new HalfPlaySharePopwindow(this, 8, this.mRedPacketBean.title, this.mRedPacketBean.url, LetvUrlMaker.getSharedSucceedUrl(this.mRedPacketBean.channelId + "", this.mOrderId), this.mRedPacketBean.mobilePic, this.mRedPacketBean.shareDesc, this.mGiftShareAwardCallback);
            this.mHalfPlaySharePopwindow.showPopupWindow(this.mRoot);
            this.mHalfPlaySharePopwindow.setOnDismissListener(new OnDismissListener(this) {
                final /* synthetic */ PaySucceedActivity this$0;

                {
                    if (HotFix.PREVENT_VERIFY) {
                        System.out.println(VerifyLoad.class);
                    }
                    this.this$0 = this$0;
                }

                public void onDismiss() {
                    this.this$0.mHalfPlaySharePopwindow = null;
                }
            });
        }
    }
}
 
Example 3
Project: PictureShow   File: PicPopupWindow.java   View source code 6 votes vote down vote up
private PicPopupWindow(Context context) {
	mContext = context;
	mInflater = (LayoutInflater) mContext
			.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	mPopupContent = (ViewGroup) mInflater.inflate(
			R.layout.popup_window_list, null);
	mPopupItemContent = (ViewGroup) mPopupContent
			.findViewById(R.id.popup_window_item_content);
	title = (TextView) mPopupContent
			.findViewById(R.id.popup_window_title_text);
	mPopupWindow = new PopupWindow(mPopupContent,
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	mPopupWindow.setFocusable(true);
	mPopupWindow.setBackgroundDrawable(new BitmapDrawable());
	mPopupWindow.setOnDismissListener(new OnDismissListener() {
		@Override
		public void onDismiss() {
			// TODO Auto-generated method stub
			resetItemByTag(setTag);
			if (mAnimationListener != null) {
				mAnimationListener.doAnimation(false);
			}
		}
	});
	mPopupWindow.setAnimationStyle(R.style.popup_window_animation);
}
 
Example 4
Project: Coding-Android   File: DialogUtil.java   View source code 6 votes vote down vote up
/**
 * 初始化进度条dialog
 *
 * @param activity
 * @return
 */
public static LoadingPopupWindow initProgressDialog(Activity activity, OnDismissListener onDismissListener) {
    if (activity == null || activity.isFinishing()) {
        return null;
    }

    // 获得背景(6个图片形成的动画)
    //AnimationDrawable animDance = (AnimationDrawable) imgDance.getBackground();

    //final PopupWindow popupWindow = new PopupWindow(popupView, RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT);
    final LoadingPopupWindow popupWindow = new LoadingPopupWindow(activity);
    ColorDrawable cd = new ColorDrawable(-0000);
    popupWindow.setBackgroundDrawable(cd);
    popupWindow.setTouchable(true);
    popupWindow.setOnDismissListener(onDismissListener);

    popupWindow.setFocusable(true);
    //animDance.start();
    return popupWindow;
}
 
Example 5
Project: Android_Study_Demos   File: ImageChooseActivity.java   View source code 6 votes vote down vote up
/**
 * 初始化展示文件夹的popupWindw
 */
private void initListDirPopupWindw()
{
	mListImageDirPopupWindow = new ListImageDirPopupWindow(
			LayoutParams.MATCH_PARENT, (int) (mScreenHeight * 0.7),
			mImageFloders, LayoutInflater.from(getApplicationContext())
					.inflate(R.layout.list_dir, null));

	mListImageDirPopupWindow.setOnDismissListener(new OnDismissListener()
	{

		@Override
		public void onDismiss()
		{
			// 设置背景颜色变暗
			WindowManager.LayoutParams lp = getWindow().getAttributes();
			lp.alpha = 1.0f;
			getWindow().setAttributes(lp);
		}
	});
	// 设置选择文件夹的回调
	mListImageDirPopupWindow.setOnImageDirSelected(this);
}
 
Example 6
Project: Translation   File: LoadPictureAcitivity.java   View source code 6 votes vote down vote up
/**
 * 初始化展示文件夹的popupWindw
 */
private void initListDirPopupWindw()
{
	mListImageDirPopupWindow = new ListImageDirPopupWindow(
			LayoutParams.MATCH_PARENT, (int) (mScreenHeight * 0.7),
			mImageFloders, LayoutInflater.from(getApplicationContext()).inflate(
			R.layout.list_dir, null));
	mListImageDirPopupWindow.setOnDismissListener(new OnDismissListener()
	{

		@Override
		public void onDismiss()
		{
			// 设置背景颜色变暗
			WindowManager.LayoutParams lp = getWindow().getAttributes();
			lp.alpha = 1.0f;
			getWindow().setAttributes(lp);
		}
	});
	// 设置选择文件夹的回调
	mListImageDirPopupWindow.setOnImageDirSelected(this);
}
 
Example 7
Project: Android-Birdcopy-Application   File: ChoosePictureActivity.java   View source code 6 votes vote down vote up
/**
 * 初始化展示文件夹的popupWindw
 */
private void updateListDirPopupWindw() {

    mListImageDirPopupWindow = new ListImageDirPopupWindow(
            LayoutParams.MATCH_PARENT, (int) (mScreenHeight * 0.7),
            mImageFloders, LayoutInflater.from(getApplicationContext())
            .inflate(R.layout.de_ph_list_dir, null));

    mListImageDirPopupWindow.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss() {
            // 设置背景颜色变暗
            WindowManager.LayoutParams lp = getWindow().getAttributes();
            lp.alpha = 1.0f;
            getWindow().setAttributes(lp);
        }
    });
    // 设置选择文件夹的回调
    mListImageDirPopupWindow.setOnImageDirSelected(this);
}
 
Example 8
Project: base-imageloader   File: LocalImageloaderActivity.java   View source code 6 votes vote down vote up
/**
 * 初始化展示文件夹的popupWindw
 */
private void initListDirPopupWindw()
{
	mListImageDirPopupWindow = new ListImageDirPopupWindow(
			LayoutParams.MATCH_PARENT, (int) (mScreenHeight * 0.7),
			mImageFloders, LayoutInflater.from(getApplicationContext())
					.inflate(R.layout.list_dir, null));

	mListImageDirPopupWindow.setOnDismissListener(new OnDismissListener()
	{

		@Override
		public void onDismiss()
		{
			// 设置背景颜色变暗
			WindowManager.LayoutParams lp = getWindow().getAttributes();
			lp.alpha = 1.0f;
			getWindow().setAttributes(lp);
		}
	});
	// 设置选择文件夹的回调
	mListImageDirPopupWindow.setOnImageDirSelected(this);
}
 
Example 9
Project: base-imageloader   File: LocalImageloaderActivity.java   View source code 6 votes vote down vote up
/**
 * 初始化展示文件夹的popupWindw
 */
private void initListDirPopupWindw()
{
	mListImageDirPopupWindow = new ListImageDirPopupWindow(
			LayoutParams.MATCH_PARENT, (int) (mScreenHeight * 0.7),
			mImageFloders, LayoutInflater.from(getApplicationContext())
					.inflate(R.layout.list_dir, null));

	mListImageDirPopupWindow.setOnDismissListener(new OnDismissListener()
	{

		@Override
		public void onDismiss()
		{
			// 设置背景颜色变暗
			WindowManager.LayoutParams lp = getWindow().getAttributes();
			lp.alpha = 1.0f;
			getWindow().setAttributes(lp);
		}
	});
	// 设置选择文件夹的回调
	mListImageDirPopupWindow.setOnImageDirSelected(this);
}
 
Example 10
Project: silent-contacts-android   File: PhotoSelectionHandler19.java   View source code 6 votes vote down vote up
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
public void onClick(View v) {
    final PhotoActionListener listener = getListener();
    if (listener != null) {
        if (getWritableEntityIndex() != -1) {
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
                showPhotoActionDialog(listener);
            }
            else {
                mPopup = PhotoActionPopup.createPopupMenu(mContext, mPhotoView, listener, mPhotoMode);
                mPopup.setOnDismissListener(new OnDismissListener() {
                @Override
                public void onDismiss() {
                    listener.onPhotoSelectionDismissed();
                }
            });
            mPopup.show();
            }
        }
    }
}
 
Example 11
Project: silent-contacts-android   File: PhotoSelectionHandler.java   View source code 6 votes vote down vote up
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
public void onClick(View v) {
    final PhotoActionListener listener = getListener();
    if (listener != null) {
        if (getWritableEntityIndex() != -1) {
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
                showPhotoActionDialog(listener);
            }
            else {
            mPopup = PhotoActionPopup.createPopupMenu(mContext, mPhotoView, listener, mPhotoMode);
            mPopup.setOnDismissListener(new OnDismissListener() {
                @Override
                public void onDismiss() {
                    listener.onPhotoSelectionDismissed();
                }
            });
            mPopup.show();
            }
        }
    }
}
 
Example 12
Project: HiBangClient   File: FriendActivity.java   View source code 5 votes vote down vote up
private void initPopupWindow()
{

	mPopupWindow = new PublishSelectPopupWindow(this);
	mPopupWindow.setOnSubmitClickListener(new onSubmitClickListener() {

		@Override
		public void onClick() {
		//	mFriendFragment.onManualRefresh();
	 
	     mHeaderLayout.changeMiddleTitle(" 交易中");
	     if(!currentFragment)
	     mFriendFragment.updateTradingAdapter();
	     else
	     mHelperFragment.updateTradingAdapter();
		}
	});
	
	mPopupWindow.setOnFinishClickListener(new onFinishClickListener() {

		@Override
		public void onClick() {
		//	mFriendFragment.onManualRefresh();			 
	     mHeaderLayout.changeMiddleTitle("交易完成");
	     if(!currentFragment)
	     mFriendFragment.updateSuccessAdapter();
	     else
	     mHelperFragment.updateSuccessAdapter();
		}
	});
	
	mPopupWindow.setOnDismissListener(new OnDismissListener() {

		@Override
		public void onDismiss() {
			mHeaderSpinner.initSpinnerState(false);
		}
	});

}
 
Example 13
Project: letv   File: VideoShotEditActivity.java   View source code 5 votes vote down vote up
public void share() {
    if (this.currentPhotoPos < this.photoFileName.getPhoto().size() && this.vsShareInfoBean != null) {
        String str;
        String randText = ((PhotoInfoBean) this.photoFileName.getPhoto().get(this.currentPhotoPos)).getPhotoDesc();
        VideoShotShareInfoBean videoShotShareInfoBean = this.vsShareInfoBean;
        String str2 = ((PhotoInfoBean) this.photoFileName.getPhoto().get(this.currentPhotoPos)).photoPath;
        if (TextUtils.isEmpty(this.vsShareInfoBean.mVideoName)) {
            str = "";
        } else {
            str = this.vsShareInfoBean.mVideoName + " " + (this.vsShareInfoBean.mVideoBean == null ? "" : this.vsShareInfoBean.mVideoBean.episode);
        }
        videoShotShareInfoBean.mPhotoPath = getFileAddedHybridWatermark(str2, 2130838567, str, randText);
        VideoShotShareInfoBean videoShotShareInfoBean2 = this.vsShareInfoBean;
        if (TextUtils.isEmpty(randText)) {
            randText = getResources().getString(2131099925);
        }
        videoShotShareInfoBean2.mRandText = randText;
        if (this.mHalfPlaySharePopwindow == null) {
            ShareUtils.RequestShareLink(this.mContext);
            this.mHalfPlaySharePopwindow = new HalfPlaySharePopwindow(this, 4);
            this.mHalfPlaySharePopwindow.setVideoShotData(this.vsShareInfoBean);
            this.mHalfPlaySharePopwindow.showPopupWindow(this.mRootLayout);
            this.mHalfPlaySharePopwindow.setOnDismissListener(new OnDismissListener(this) {
                final /* synthetic */ VideoShotEditActivity this$0;

                {
                    if (HotFix.PREVENT_VERIFY) {
                        System.out.println(VerifyLoad.class);
                    }
                    this.this$0 = this$0;
                }

                public void onDismiss() {
                    this.this$0.mHalfPlaySharePopwindow = null;
                }
            });
        }
    }
}
 
Example 14
Project: MyTravelingDiary   File: NIMPopupMenu.java   View source code 5 votes vote down vote up
@SuppressWarnings("deprecation")
private void initPopupWindow() {
    if (popWindow == null) {
        //popWindow = new PopupWindow(rootView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        popWindow = new PopupWindow(context);
        popWindow.setContentView(rootView);
        popWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
        if (scroll) {
            popWindow.setHeight(ScreenUtil.getDisplayHeight() * 2 / 3);
        } else {
            popWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
        }
        popWindow.setTouchable(true);
        popWindow.setBackgroundDrawable(new BitmapDrawable());
        // popWindow.setContentView(rootView);
        //setPopupWindowSize();
        // popWindow.setHeight(rootView.getMeasuredHeight());

        popWindow.setOnDismissListener(new OnDismissListener() {

            @Override
            public void onDismiss() {

            }
        });
    }
}
 
Example 15
Project: solved-hacking-problem   File: C0281v.java   View source code 5 votes vote down vote up
public boolean m2273d() {
    boolean z = false;
    this.f1066l = new by(this.f1057c, null, this.f1063i, this.f1064j);
    this.f1066l.m2564a((OnDismissListener) this);
    this.f1066l.m2562a((OnItemClickListener) this);
    this.f1066l.m2563a(this.f1060f);
    this.f1066l.m2565a(true);
    View view = this.f1065k;
    if (view == null) {
        return false;
    }
    if (this.f1067m == null) {
        z = true;
    }
    this.f1067m = view.getViewTreeObserver();
    if (z) {
        this.f1067m.addOnGlobalLayoutListener(this);
    }
    this.f1066l.m2561a(view);
    this.f1066l.m2570d(this.f1072r);
    if (!this.f1070p) {
        this.f1071q = m2259g();
        this.f1070p = true;
    }
    this.f1066l.m2574f(this.f1071q);
    this.f1066l.m2576g(2);
    this.f1066l.m2567c();
    this.f1066l.m2583m().setOnKeyListener(this);
    return true;
}
 
Example 16
Project: solved-hacking-problem   File: C0281v.java   View source code 5 votes vote down vote up
public boolean m2273d() {
    boolean z = false;
    this.f1066l = new by(this.f1057c, null, this.f1063i, this.f1064j);
    this.f1066l.m2564a((OnDismissListener) this);
    this.f1066l.m2562a((OnItemClickListener) this);
    this.f1066l.m2563a(this.f1060f);
    this.f1066l.m2565a(true);
    View view = this.f1065k;
    if (view == null) {
        return false;
    }
    if (this.f1067m == null) {
        z = true;
    }
    this.f1067m = view.getViewTreeObserver();
    if (z) {
        this.f1067m.addOnGlobalLayoutListener(this);
    }
    this.f1066l.m2561a(view);
    this.f1066l.m2570d(this.f1072r);
    if (!this.f1070p) {
        this.f1071q = m2259g();
        this.f1070p = true;
    }
    this.f1066l.m2574f(this.f1071q);
    this.f1066l.m2576g(2);
    this.f1066l.m2567c();
    this.f1066l.m2583m().setOnKeyListener(this);
    return true;
}
 
Example 17
Project: GridPassword   File: CustomBoardEditText.java   View source code 5 votes vote down vote up
private void init() {

		// 隐藏系统键盘
		hideSysInput();

		initAttributes(context);

		numKeyboard = new Keyboard(context, R.layout.keyboard_symbols_md);

		keyboardView = (KeyboardView) LayoutInflater.from(context).inflate(
				R.layout.keyboard_view, null);
		keyboardView.setEnabled(true);
		keyboardView.setPreviewEnabled(false);
		keyboardView.setOnKeyboardActionListener(listener);

		mKeyboardWindow = new PopupWindow(keyboardView,
				ViewGroup.LayoutParams.MATCH_PARENT,
				ViewGroup.LayoutParams.WRAP_CONTENT);
		mKeyboardWindow.setAnimationStyle(R.style.AnimationFade);
		mKeyboardWindow.setOnDismissListener(new OnDismissListener() {

			@Override
			public void onDismiss() {
				if (scrolldis > 0) {
					int temp = scrolldis;
					scrolldis = 0;
					if (null != mContentView) {
						mContentView.scrollBy(0, -temp);
					}
				}
			}
		});
	}
 
Example 18
Project: LitePlayer   File: MainActivity.java   View source code 5 votes vote down vote up
private void onShowMenu() {
	onPopupWindowShown();
	if(mPopupWindow == null) {
		View view = View.inflate(this, R.layout.exit_pop_layout, null);
		View shutdown = view.findViewById(R.id.tv_pop_shutdown);
		View exit = view.findViewById(R.id.tv_pop_exit);
		View cancel = view.findViewById(R.id.tv_pop_cancel);
		
		// 不需要共享变量, 所以放这没事
		shutdown.setOnClickListener(this);
		exit.setOnClickListener(this);
		cancel.setOnClickListener(this);
		
		mPopupWindow = new PopupWindow(view,
				LinearLayout.LayoutParams.MATCH_PARENT,
				LinearLayout.LayoutParams.WRAP_CONTENT, true);
		mPopupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
		mPopupWindow.setAnimationStyle(R.style.popwin_anim);
		mPopupWindow.setFocusable(true);
		mPopupWindow.setOnDismissListener(new OnDismissListener() {
			@Override
			public void onDismiss() {
				onPopupWindowDismiss();
			}
		});
	}
	
	mPopupWindow.showAtLocation(getWindow().getDecorView(), 
			Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL, 0, 0);
}
 
Example 19
Project: ItHome   File: LaPinAddressAdd.java   View source code 5 votes vote down vote up
public void initPopupWindow(){
	// 利用layoutInflater获得View
			LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			View view = layoutInflater.inflate(R.layout.citys, null);
			mProvince = (WheelView) view.findViewById(R.id.id_province);
			mCity = (WheelView) view.findViewById(R.id.id_city);
			mArea = (WheelView) view.findViewById(R.id.id_area);
			

			// 下面是两种方法得到宽度和高度 getWindow().getDecorView().getWidth()

			popupWindow = new PopupWindow(view,
					WindowManager.LayoutParams.MATCH_PARENT,
					WindowManager.LayoutParams.WRAP_CONTENT);
			// 设置popWindow弹出窗体可点击,这句话必须添加,并且是true
			popupWindow.setFocusable(true);

			// 必须要给调用这个方法,否则点击popWindow以外部分,popWindow不会消失
		     popupWindow.setBackgroundDrawable(new BitmapDrawable());
		     
		     
		    mProvince.setViewAdapter(new ArrayWheelAdapter<String>(LaPinAddressAdd.this, mProvinceDatas));
				// 添加change事件
			mProvince.addChangingListener(this);
				// 添加change事件
			mCity.addChangingListener(this);
				// 添加change事件
			mArea.addChangingListener(this);

			mProvince.setVisibleItems(5);
			mCity.setVisibleItems(5);
			mArea.setVisibleItems(5);
		    popupWindow.setOnDismissListener(new OnDismissListener() {
				public void onDismiss() {						
					city.setText(mCurrentProviceName+mCurrentCityName+mCurrentAreaName);
				}
			});
		     
}
 
Example 20
Project: FMTech   File: RateReviewModuleV2Layout.java   View source code 5 votes vote down vote up
final void configureOverflow(final boolean paramBoolean)
{
  this.mRatingOverflow.setOnClickListener(new View.OnClickListener()
  {
    public final void onClick(View paramAnonymousView)
    {
      PlayPopupMenu localPlayPopupMenu = new PlayPopupMenu(RateReviewModuleV2Layout.this.getContext(), RateReviewModuleV2Layout.this.mRatingOverflow);
      Resources localResources = RateReviewModuleV2Layout.this.getContext().getResources();
      FinskyApp.get().getEventLogger().logClickEvent(238, null, RateReviewModuleV2Layout.this.mParentNode);
      if (!paramBoolean) {
        localPlayPopupMenu.addMenuItem(1, localResources.getString(2131362106), true, RateReviewModuleV2Layout.this);
      }
      localPlayPopupMenu.addMenuItem(2, localResources.getString(2131362078), true, RateReviewModuleV2Layout.this);
      RateReviewModuleV2Layout.this.mRatingOverflow.setImageResource(2130838073);
      localPlayPopupMenu.mOnPopupDismissListener = new PopupWindow.OnDismissListener()
      {
        public final void onDismiss()
        {
          RateReviewModuleV2Layout.this.mRatingOverflow.setImageResource(2130838071);
        }
      };
      localPlayPopupMenu.show();
    }
  });
  this.mRatingOverflow.setVisibility(0);
  if (this.mOverflowArea.isEmpty())
  {
    this.mRatingOverflow.getHitRect(this.mOverflowArea);
    this.mOverflowArea.inset(-this.mOverflowTouchExtend, -this.mOverflowTouchExtend);
    setTouchDelegate(new PlayTouchDelegate(this.mOverflowArea, this.mRatingOverflow));
  }
}
 
Example 21
Project: 365browser   File: ChromeTabbedActivity.java   View source code 5 votes vote down vote up
private void showFeatureEngagementTextBubbleForDownloadHome() {
    final FeatureEngagementTracker tracker =
            FeatureEngagementTrackerFactory.getFeatureEngagementTrackerForProfile(
                    Profile.getLastUsedProfile());
    if (!tracker.shouldTriggerHelpUI(FeatureConstants.DOWNLOAD_HOME_FEATURE)) return;

    ViewAnchoredTextBubble textBubble = new ViewAnchoredTextBubble(this,
            getToolbarManager().getMenuButton(), R.string.iph_download_home_text,
            R.string.iph_download_home_accessibility_text);
    textBubble.setDismissOnTouchInteraction(true);
    textBubble.addOnDismissListener(new OnDismissListener() {
        @Override
        public void onDismiss() {
            mHandler.post(new Runnable() {
                @Override
                public void run() {
                    tracker.dismissed(FeatureConstants.DOWNLOAD_HOME_FEATURE);
                    getAppMenuHandler().setMenuHighlight(null);
                }
            });
        }
    });
    getAppMenuHandler().setMenuHighlight(R.id.downloads_menu_id);
    int yInsetPx =
            getResources().getDimensionPixelOffset(R.dimen.text_bubble_menu_anchor_y_inset);
    textBubble.setInsetPx(0, FeatureUtilities.isChromeHomeEnabled() ? yInsetPx : 0, 0,
            FeatureUtilities.isChromeHomeEnabled() ? 0 : yInsetPx);
    textBubble.show();
}
 
Example 22
Project: 365browser   File: TextBubble.java   View source code 5 votes vote down vote up
@Override
public void onDismiss() {
    if (mIgnoreDismissal) return;

    mHandler.removeCallbacks(mDismissRunnable);
    for (OnDismissListener listener : mDismissListeners) listener.onDismiss();
}
 
Example 23
Project: AndroidDemos   File: ShowActivity.java   View source code 5 votes vote down vote up
private void initPop(){
	//View popupView = getLayoutInflater().inflate(R.layout.dialog_custom_view, null);
	mView = mInflater.inflate(R.layout.dialog_custom_view,null);
	mPopupWindow = new PopupWindow(mView, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, true);
       mPopupWindow.setTouchable(true);
       mPopupWindow.setOutsideTouchable(false);
       mPopupWindow.setBackgroundDrawable(new BitmapDrawable(getResources(), (Bitmap) null));
       mPopupWindow.getContentView().setFocusableInTouchMode(true);
       mPopupWindow.getContentView().setFocusable(true);
       mPopupWindow.setAnimationStyle(R.style.anim_menu_bottombar);
       mPopupWindow.setOnDismissListener(new OnDismissListener() {
		
		@Override
		public void onDismiss() {
			// TODO Auto-generated method stub
			 lp.alpha = 1f;
			 getWindow().setAttributes(lp);	
		}
	});
	gv_listing=(GridView)mView.findViewById(R.id.gv_listing);
	listingAdapter=new GridAdapter(this,myApp);
	gv_listing.setAdapter(listingAdapter);
	if(bt_listing==null||tv_listing==null){
		bt_listing=(Button)mView.findViewById(R.id.bt_listing);
		tv_listing=(TextView)mView.findViewById(R.id.tv_listing);
	}
	numlist = myApp.position+1+"/"+myApp.listSize;
	bt_listing.setOnClickListener(bt_listing_click);
	tv_listing.setText(numlist);
	gv_listing.setOnItemClickListener(gv_listing_listener);
}
 
Example 24
Project: Android-Birdcopy-Application   File: ChoosePictureActivity.java   View source code 5 votes vote down vote up
/**
 * 初始化展示文件夹的popupWindw
 */
private void initListDirPopupWindwDefault() {
    // - getStatusBarHeight()

    // 高度手动换算 44dp
    tv_titleHeight = ScreenSizeUtil.Dp2Px(this, 110);

    int dialogHeight = mScreenHeight - tv_titleHeight - mBottomLyHeight
            - getStatusBarHeight();

    mListImageDirPopupWindow = new ListImageDirPopupWindow(
            LayoutParams.MATCH_PARENT, dialogHeight, mImageFloders,
            LayoutInflater.from(getApplicationContext()).inflate(
                    R.layout.de_ph_list_dir, null));

    mListImageDirPopupWindow.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss() {
            // 设置背景颜色变暗
            WindowManager.LayoutParams lp = getWindow().getAttributes();
            lp.alpha = 1.0f;
            getWindow().setAttributes(lp);
        }
    });
    // 设置选择文件夹的回调
    mListImageDirPopupWindow.setOnImageDirSelected(this);
}
 
Example 25
Project: iLocker   File: CommentActivity.java   View source code 5 votes vote down vote up
private void initElements() {
	mLayoutFooterPlaceHolder = (LinearLayout) mLayoutComment.findViewById(R.id.fragment_comment_footer_placeholder);
	mImageClose = (ImageView) mLayoutComment.findViewById(R.id.fragment_comment_close);
	mImageSubmit = (ImageView) mLayoutComment.findViewById(R.id.fragment_comment_submit);
	mEditTextComment = (EditText) mLayoutComment.findViewById(R.id.fragment_comment_content);
	mEditTextComment.setOnClickListener(this);
	
	mEditTextComment.setText(content);
	mEditTextComment.setTextColor(color);

	mEditTextComment.setText(content);
	mEditTextComment.setSelection(mEditTextComment.getText().length());
	mIVColorButton = (NoSizeCircleColorView) mLayoutComment.findViewById(R.id.iv_color_btn);
	mIVColorButton.setColor(color);
	
	popupWindow = new PopupWindow(colorPickerView, LayoutParams.MATCH_PARENT, keyboardHeight, false);
	popupWindow.setWidth(width);
	popupWindow.setOnDismissListener(new OnDismissListener() {
		@Override
		public void onDismiss() {
			mLayoutFooterPlaceHolder.setVisibility(LinearLayout.GONE);
		}
	});
	findViewById(R.id.fragment_comment_layout_main).setOnClickListener(this);
	mLayoutComment.setOnClickListener(this);
	mIVColorButton.setOnClickListener(this);
	mImageClose.setOnClickListener(this);
	mImageSubmit.setOnClickListener(this);
}
 
Example 26
Project: NIM_Android_UIKit   File: NIMPopupMenu.java   View source code 5 votes vote down vote up
@SuppressWarnings("deprecation")
private void initPopupWindow() {
    if (popWindow == null) {
        //popWindow = new PopupWindow(rootView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        popWindow = new PopupWindow(context);
        popWindow.setContentView(rootView);
        popWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
        if (scroll) {
            popWindow.setHeight(ScreenUtil.getDisplayHeight() * 2 / 3);
        } else {
            popWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
        }
        popWindow.setTouchable(true);
        popWindow.setBackgroundDrawable(new BitmapDrawable());
        // popWindow.setContentView(rootView);
        //setPopupWindowSize();
        // popWindow.setHeight(rootView.getMeasuredHeight());

        popWindow.setOnDismissListener(new OnDismissListener() {

            @Override
            public void onDismiss() {

            }
        });
    }
}
 
Example 27
Project: Makeblock-App-For-Android   File: LayoutView.java   View source code 5 votes vote down vote up
protected void startUpgradeing(){
	
	stopTimer();
	startTimer(500);
	engineState = STAGE_PROBING;
	
	if(blt!=null){
		blt.commMode = Bluetooth.MODE_FORWARD;
	}else{
		BluetoothLE.sharedManager().commMode = BluetoothLE.MODE_FORWARD;
	}
	
	uploadPb = ProgressDialog.show(this.mContext, getString(R.string.Upgrade_Firmware), getString(R.string.Please_Press_Reset_Button));
	uploadPb.setCancelable(true);
	uploadPb.setOnDismissListener(new DialogInterface.OnDismissListener() {
           @Override
           public void onDismiss(DialogInterface dialog) {
           	if(blt!=null){
           		blt.commMode = Bluetooth.MODE_LINE;
           	}else{
           		BluetoothLE.sharedManager().commMode = BluetoothLE.MODE_LINE;
           	}
			stopTimer();
			engineState = STAGE_IDLE;
			disableAllModule();
			runBtn.setImageResource(R.drawable.run_button);
			//startTimer(1000);
           }
       });
}
 
Example 28
Project: itmarry   File: PullDownView.java   View source code 5 votes vote down vote up
public void initPopuWindow()
{
	View 	window 		= (View)activity.getLayoutInflater().inflate(R.layout.pulldown_layout, null);
	listView			= (ListView)window.findViewById(R.id.pulldown_listview);
	listaAdapter		= new PullDownListAdapter(activity, data);
	listView.setAdapter(listaAdapter);
	popupWindow 		= new PopupWindow(window, width, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT,true);
	height = popupWindow.getHeight();
	popupWindow.setOutsideTouchable(true);
	popupWindow.setBackgroundDrawable(new BitmapDrawable());
	popupWindow.setOnDismissListener(new OnDismissListener() {
		
		@Override
		public void onDismiss() {
			// TODO Auto-generated method stub
			dataHandler.onPullDownViewDissmiss();
		}
	});
	listView.setOnItemClickListener(new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
				long arg3) {
			// TODO Auto-generated method stub
			dataHandler.selected(arg2);		// 接口实现选中后的处理
			popupWindow.dismiss();
		}
		
	});
}
 
Example 29
Project: taxitwin-app   File: MainActivity.java   View source code 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    settingsPopup = new SettingsPopup(this);
    settingsPopup.setOnDismissListener(new OnDismissListener() {

        public void onDismiss() {
            settingsMenuItem.setIcon(R.drawable.ic_action_expand);
        }
    });

    MapsInitializer.initialize(getApplicationContext());

    broadcastReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (intent.hasCategory(CATEGORY_OFFER_DATA_CHANGED)) {
                notifyChangedData();
            }
            if (intent.hasCategory(MyTaxiTwinActivity.CATEGORY_TAXITWIN_DATA_CHANGED)) {
                showTaxiTwinDialog();
            }
            if (intent.hasCategory(ServicesManagement.CATEGORY_GPS_DISABLED)) {
                DialogFragment alertFragment = new ServicesAlertDialogFragment(R.string.services_gps_alert_message);
                alertFragment.show(getFragmentManager(), "gps_alert");
            }
            if (intent.hasCategory(ServicesManagement.CATEGORY_NETWORK_DISABLED)) {
                DialogFragment alertFragment = new ServicesAlertDialogFragment(R.string.services_network_alert_message);
                alertFragment.show(getFragmentManager(), "network_alert");
            }
        }
    };

    buildGUI(savedInstanceState);
}
 
Example 30
Project: Common-Library   File: SwipeListView.java   View source code 5 votes vote down vote up
public void showUndoPopup(OnDismissListener listener, String text,
		OnClickListener click) {
	mUndoText.setText(text);
	mUndoPopup.showAtLocation(this, Gravity.CENTER_HORIZONTAL
			| Gravity.BOTTOM, 0, 12);
	mUndoPopup.setOnDismissListener(listener);
	mUndoButton.setOnClickListener(click);
}
 
Example 31
Project: fanfouapp-opensource   File: QuickAction.java   View source code 5 votes vote down vote up
/**
 * Set listener for window dismissed. This listener will only be fired if
 * the quicakction dialog is dismissed by clicking outside the dialog or
 * clicking on sticky item.
 */
public void setOnDismissListener(
        final QuickAction.OnDismissListener listener) {
    setOnDismissListener(this);

    mDismissListener = listener;
}
 
Example 32
Project: HiBangClient   File: HelperPublishFragment.java   View source code 4 votes vote down vote up
@Override
public boolean onChildClick(ExpandableListView parent, View v,
		int groupPosition, int childPosition, long id) {

	//System.out.println("群编号为:" + groupPosition + "子编号为:" + childPosition);

	int count = 0;
	for (int i = 1; i < groupPosition; i++) {
		count += childList.get(i).size();
	}
	count = count + childPosition + 1;
	// CPubHelpMeMsg msg = new CPubHelpMeMsg();
	// msg.setReqItemID(count);
	// msg.setUserID(application.getUser().getUserID());
	// msg.setStartTime("2014-03-16 12:30:00");
	// msg.setEndTime("2014-03-17 12:30:00");
	// msg.setReqDetail("最好是粉色的哦!");
	// application.client.sendMessage(msg);
	// MyPubHelpMe myMsg = new
	// MyPubHelpMe(msg,childList.get(groupPosition).get(childPosition).getName());
	// DBManage.addCPubHelpMe(myMsg);

	mPopupWindow = new PublishPopupWindow(mActivity, mApplication, count,
			childList.get(groupPosition).get(childPosition).getName(),flag);
	mPopupWindow.setOnSubmitClickListener(new onSubmitClickListener() {

		@Override
		public void onClick() {
			

		}
	});
	mPopupWindow.setOnDismissListener(new OnDismissListener() {

		public void onDismiss() {
			// mHeaderSpinner.initSpinnerState(false);
		}
	});

	mPopupWindow
			.showViewTopCenter(findViewById(R.id.publish_fragment_root));

	return false;
}
 
Example 33
Project: HiBangClient   File: PublishFragment.java   View source code 4 votes vote down vote up
@Override
public boolean onChildClick(ExpandableListView parent, View v,
		int groupPosition, int childPosition, long id) {

	System.out.println("群编号为:" + groupPosition + "子编号为:" + childPosition);

	int count = 0;
	for (int i = 1; i < groupPosition; i++) {
		count += childList.get(i).size();
	}
	count = count + childPosition + 1;
	// CPubHelpMeMsg msg = new CPubHelpMeMsg();
	// msg.setReqItemID(count);
	// msg.setUserID(application.getUser().getUserID());
	// msg.setStartTime("2014-03-16 12:30:00");
	// msg.setEndTime("2014-03-17 12:30:00");
	// msg.setReqDetail("最好是粉色的哦!");
	// application.client.sendMessage(msg);
	// MyPubHelpMe myMsg = new
	// MyPubHelpMe(msg,childList.get(groupPosition).get(childPosition).getName());
	// DBManage.addCPubHelpMe(myMsg);

	mPopupWindow = new PublishPopupWindow(mActivity, mApplication, count,
			childList.get(groupPosition).get(childPosition).getName(),flag);
	mPopupWindow.setOnSubmitClickListener(new onSubmitClickListener() {

		@Override
		public void onClick() {

			
		}
	});
	mPopupWindow.setOnDismissListener(new OnDismissListener() {

		public void onDismiss() {
			// mHeaderSpinner.initSpinnerState(false);
		}
	});

	mPopupWindow
			.showViewTopCenter(findViewById(R.id.publish_fragment_root));

	return false;
}
 
Example 34
Project: letv   File: ExitRetainPopupwindow.java   View source code 4 votes vote down vote up
private void initPopupwindow() {
    this.mPopupWindow = new ExitRetainMyPopupwindow(LetvApplication.getInstance());
    this.mPopupWindow.setWidth(UIs.getScreenWidth());
    this.mPopupWindow.setHeight(UIs.getScreenHeight());
    if (VERSION.SDK_INT >= 11) {
        this.mPopupWindow.setFocusable(true);
    }
    this.mPopupWindow.setBackgroundDrawable(new BitmapDrawable(this.mContext.getResources()));
    this.contentView = LayoutInflater.from(this.mContext).inflate(R.layout.exit_retain_popupwindow, null);
    this.mPopupWindow.setContentView(this.contentView);
    this.mPopupWindow.setOnDismissListener(new OnDismissListener(this) {
        final /* synthetic */ ExitRetainPopupwindow this$0;

        {
            if (HotFix.PREVENT_VERIFY) {
                System.out.println(VerifyLoad.class);
            }
            this.this$0 = this$0;
        }

        public void onDismiss() {
            LogInfo.log(ExitRetainPopupwindow.TAG, " onDismiss isClickLookBtn : " + this.this$0.isClickLookBtn + " isNewUser " + this.this$0.isNewUser() + " isFristShow : " + this.this$0.mCurrentHomeMetaData.isFristShow);
            if (this.this$0.mCurrentHomeMetaData == null || this.this$0.mCurrentHomeMetaData.isFristShow || !this.this$0.isNewUser() || this.this$0.mExitRetainDataMap.size() <= 1) {
                if (!this.this$0.isClickLookBtn || !this.this$0.isNewUser()) {
                    this.this$0.mExitRetainDataMap.clear();
                } else if (this.this$0.isNewUser()) {
                    this.this$0.isClickLookBtn = false;
                }
                this.this$0.mExitRetainCallBack.onDismissPopWindow();
                return;
            }
            LogInfo.log(" 当前对话框是不带按钮的 ");
        }
    });
    this.mPopupWindow.setDismissListener(new DismissListener(this) {
        final /* synthetic */ ExitRetainPopupwindow this$0;

        {
            if (HotFix.PREVENT_VERIFY) {
                System.out.println(VerifyLoad.class);
            }
            this.this$0 = this$0;
        }

        public void onPreDismiss() {
            LogInfo.log(ExitRetainPopupwindow.TAG, "initPopupwindow  onPreDismiss >> ");
            if (this.this$0.isClickBackKey()) {
                this.this$0.pressBackKey = true;
            }
        }

        public void onDismissed() {
            LogInfo.log(ExitRetainPopupwindow.TAG, "initPopupwindow  onDismissed >> " + this.this$0.pressBackKey);
            if (!this.this$0.pressBackKey || this.this$0.mCurrentHomeMetaData == null || this.this$0.mCurrentHomeMetaData.isFristShow || this.this$0.mExitRetainCallBack == null) {
                this.this$0.pressBackKey = false;
                return;
            }
            LogInfo.log(ExitRetainPopupwindow.TAG, "initPopupwindow  onExitAppliation >> ");
            this.this$0.mExitRetainCallBack.onExitAppliation();
        }
    });
}
 
Example 35
Project: TreebolicLib   File: QuickAction.java   View source code 4 votes vote down vote up
/**
 * Set listener for window dismissed. This listener will only be fired if the quickaction dialog is dismissed by clicking outside the dialog or clicking on
 * sticky item.
 */
public void setOnDismissListener(final OnDismissListener listener)
{
	setOnDismissListener(this);
	this.dismissListener = listener;
}
 
Example 36
Project: boohee_v5.6   File: ActivityChooserView.java   View source code 4 votes vote down vote up
public void setOnDismissListener(OnDismissListener listener) {
    this.mOnDismissListener = listener;
}
 
Example 37
Project: boohee_v5.6   File: ListPopupWindow.java   View source code 4 votes vote down vote up
public void setOnDismissListener(OnDismissListener listener) {
    this.mPopup.setOnDismissListener(listener);
}
 
Example 38
Project: solved-hacking-problem   File: ActivityChooserView.java   View source code 4 votes vote down vote up
public void setOnDismissListener(OnDismissListener onDismissListener) {
    this.f1172l = onDismissListener;
}
 
Example 39
Project: solved-hacking-problem   File: by.java   View source code 4 votes vote down vote up
public void m2564a(OnDismissListener onDismissListener) {
    this.f1379e.setOnDismissListener(onDismissListener);
}
 
Example 40
Project: solved-hacking-problem   File: ActivityChooserView.java   View source code 4 votes vote down vote up
public void setOnDismissListener(OnDismissListener onDismissListener) {
    this.f1172l = onDismissListener;
}