本文整理了Java中android.widget.PopupWindow.setClippingEnabled()
方法的一些代码示例,展示了PopupWindow.setClippingEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PopupWindow.setClippingEnabled()
方法的具体详情如下:
包路径:android.widget.PopupWindow
类名称:PopupWindow
方法名:setClippingEnabled
暂无
代码示例来源: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: skydoves/PowerMenu
/**
* sets the clipping enable or unable.
*
* @param isClipping clipping enable or unable.
*/
public void setIsClipping(boolean isClipping) {
this.menuWindow.setClippingEnabled(isClipping);
}
代码示例来源:origin: Hu12037102/MediaSelector
private void createWindows() {
if (mPopupWindow == null) {
mPopupWindow = new PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
mPopupWindow.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(mContext, R.color.color80000000)));
mPopupWindow.setClippingEnabled(false);
//mPopupWindow.setOutsideTouchable(true);
@SuppressLint("InflateParams")
View inflateView = LayoutInflater.from(mContext).inflate(R.layout.popup_media_view, null, false);
RecyclerView mRvFolder = inflateView.findViewById(R.id.rv_folder);
mViewRoot = inflateView.findViewById(R.id.ll_root);
mRvFolder.setLayoutManager(new LinearLayoutManager(mContext));
mFolderAdapter = new MediaFolderAdapter(mFolderData);
mRvFolder.setItemAnimator(new DefaultItemAnimator());
mRvFolder.setAdapter(mFolderAdapter);
mPopupWindow.setContentView(inflateView);
// mPopupWindow.setAnimationStyle(R.style.DialogAnimation);
}
}
代码示例来源:origin: bq/MarkerSeekBar
popupWindow.setClippingEnabled(false); //Allow to draw outside screen
代码示例来源:origin: ViHtarb/Tooltip
@Override
public void onGlobalLayout() {
ViewTreeObserverCompat.removeOnGlobalLayoutListener(mContentView.getViewTreeObserver(), this);
final ViewTreeObserver vto = mAnchorView.getViewTreeObserver();
if (vto != null) {
vto.addOnScrollChangedListener(mOnScrollChangedListener);
}
if (mArrowView != null) {
mContentView.getViewTreeObserver().addOnGlobalLayoutListener(mArrowLayoutListener);
}
PointF location = calculateLocation();
mPopupWindow.setClippingEnabled(true);
mPopupWindow.update((int) location.x, (int) location.y, mPopupWindow.getWidth(), mPopupWindow.getHeight());
}
};
代码示例来源:origin: mnnyang/ClassSchedule
private void initWindow(final Activity activity, final PopupWindow.OnDismissListener dismissListener, View popupView) {
mPopupWindow.setContentView(popupView);
mPopupWindow.setBackgroundDrawable(new ColorDrawable(0));
mPopupWindow.setFocusable(true);
mPopupWindow.setTouchable(true);
mPopupWindow.setOutsideTouchable(true);
mPopupWindow.setClippingEnabled(true);
mPopupWindow.setAnimationStyle(R.style.animZoomIn);
mPopupWindow.getContentView().measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
mPopupWindow.showAtLocation(activity.getWindow().getDecorView(), Gravity.CENTER, 0, 0);
mPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
WindowManager.LayoutParams lp = activity.getWindow().getAttributes();
lp.alpha = 1.0f;
activity.getWindow().setAttributes(lp);
dismissListener.onDismiss();
}
});
}
代码示例来源:origin: vilyever/AndroidDrawingView
public PopupWindow getPopupWindow() {
if (self.popupWindow == null) {
self.popupWindow = new PopupWindow(self.getPopupBackgroundView());
self.popupWindow.setFocusable(true);
self.popupWindow.setClippingEnabled(false);
self.popupWindow.setAnimationStyle(android.R.style.Animation_Dialog);
self.popupWindow.setBackgroundDrawable(new ColorDrawable());
self.popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
self.popupBackgroundView.removeAllViews();
if (self.getDelegate() != null) {
self.getDelegate().popupWindowDidDismiss(self);
}
}
});
}
return popupWindow;
}
代码示例来源:origin: YoungBill/Android-FloatWindow
/**
* 初始化弹窗
*
* @param contentView,弹窗内容
*/
private void initPopupWindow(View contentView) {
int height = DeviceUtils.getScreenHeight(mContext) + DeviceUtils.getNavigationBarHeight(mContext);
mPopupWindow = new PopupWindow(contentView, WindowManager.LayoutParams.MATCH_PARENT, height);
mPopupWindow.setBackgroundDrawable(mContext.getResources().getDrawable(R.color.colorPopWindow));
mPopupWindow.setOutsideTouchable(true);
mPopupWindow.setFocusable(true);
mPopupWindow.setClippingEnabled(false);
mPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
mParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
mParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
mWindowManager.updateViewLayout(mFloatView, mParams);
mFloatView.findViewById(R.id.touchBt).setVisibility(View.VISIBLE);
}
}, 280);
}
});
}
代码示例来源:origin: WiInputMethod/VE
public void create(Context context) {
toolPaint = new Paint();
editText = new EditText(context);
editText.setPadding(0, 0, 0, 0);
editText.setGravity(Gravity.LEFT & Gravity.CENTER_VERTICAL);
editText.setVisibility(View.VISIBLE);
editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
editText.setBackgroundResource(R.drawable.blank);
ViewsUtil.setBackgroundWithGradientDrawable(editText, softKeyboard.skinInfoManager.skinData.backcolor_editText);
//editText.setBackgroundColor(softKeyboard.skinInfoManager.skinData.backcolor_editText);
editText.getBackground().setAlpha(Global.getCurrentAlpha());
editText.setOnClickListener(editOnClickListener);
if (Global.shadowSwitch)
editText.setShadowLayer(Global.shadowRadius, 0, 0, softKeyboard.skinInfoManager.skinData.shadow);
container = new PopupWindow(editText, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
container.setFocusable(false);
container.setTouchable(true);
container.setClippingEnabled(false);
container.setBackgroundDrawable(null);
}
代码示例来源:origin: osfans/trime
@Override
public View onCreateCandidatesView() {
LayoutInflater inflater = getLayoutInflater();
mCompositionContainer =
(LinearLayout) inflater.inflate(R.layout.composition_container, (ViewGroup) null);
hideComposition();
mFloatingWindow = new PopupWindow(mCompositionContainer);
mFloatingWindow.setClippingEnabled(false);
mFloatingWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
mFloatingWindow.setWindowLayoutType(getDialogType());
mComposition = (Composition) mCompositionContainer.getChildAt(0);
mCandidateContainer =
(FrameLayout) inflater.inflate(R.layout.candidate_container, (ViewGroup) null);
mCandidate = (Candidate) mCandidateContainer.findViewById(R.id.candidate);
mCandidate.setCandidateListener(this);
setShowComment(!Rime.getOption("_hide_comment"));
mCandidate.setVisibility(!Rime.getOption("_hide_candidate") ? View.VISIBLE : View.GONE);
loadBackground();
return mCandidateContainer;
}
代码示例来源:origin: MCMrARM/revolution-irc
public TextSelectionHandlePopup(Context ctx, boolean rightHandle) {
mView = new TextSelectionHandleView(ctx, rightHandle);
mWindow = new PopupWindow(mView.getContext(), null, android.R.attr.textSelectHandleWindowStyle);
mWindow.setSplitTouchEnabled(true);
mWindow.setClippingEnabled(false);
mWindow.setContentView(mView);
mWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
mWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
mView.measure(0, 0);
}
代码示例来源:origin: supertaohaili/book
/**
* 添加一些属性设置
* @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: ViHtarb/Tooltip
private Tooltip(Builder builder) {
isDismissOnClick = builder.isDismissOnClick;
mGravity = Gravity.getAbsoluteGravity(builder.mGravity, ViewCompat.getLayoutDirection(builder.mAnchorView));
mMargin = builder.mMargin;
mAnchorView = builder.mAnchorView;
mOnClickListener = builder.mOnClickListener;
mOnLongClickListener = builder.mOnLongClickListener;
mOnDismissListener = builder.mOnDismissListener;
mPopupWindow = new PopupWindow(builder.mContext);
mPopupWindow.setClippingEnabled(false);
mPopupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
mPopupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
mPopupWindow.setContentView(getContentView(builder));
mPopupWindow.setBackgroundDrawable(new ColorDrawable());
mPopupWindow.setOutsideTouchable(builder.isCancelable);
mPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
mAnchorView.getViewTreeObserver().removeOnScrollChangedListener(mOnScrollChangedListener);
mAnchorView.removeOnAttachStateChangeListener(mOnAttachStateChangeListener);
if (mOnDismissListener != null) {
mOnDismissListener.onDismiss();
}
}
});
}
代码示例来源:origin: stackoverflow.com
window.setOutsideTouchable(true);
window.setIgnoreCheekPress();
window.setClippingEnabled(false);
window.setTouchInterceptor(new OnTouchListener()
内容来源于网络,如有侵权,请联系作者删除!