razerdp / basepopup Goto Github PK
View Code? Open in Web Editor NEWAndroid下打造通用便捷的PopupWindow弹窗库
Home Page: https://github.com/razerdp/BasePopup
License: Apache License 2.0
Android下打造通用便捷的PopupWindow弹窗库
Home Page: https://github.com/razerdp/BasePopup
License: Apache License 2.0
我想返回键不取消 popwindow 设置了这个参数但是没用
compile 'com.github.razerdp:BasePopup:v1.2.0'
无法导入,一直停留在Gradle:Resolve dependencies 'app_debugCompile' , 本来以为是我网络的问题,试了一下别的库 能导入 ,麻烦检查一下 远程库为什么不能使用了
这是Android7.0 的 popupWindow.showAsDropDown()的bug
解决办法:
下载up主的代码,把lib这个module导入自己的项目(为了修改代码)
修改razerdp.basepopup.BasePopupWindow.java下的tryToShowPopup方法为下面的样子
原谅我不会排版😢
private void tryToShowPopup(View v) {
try {
int offset[];
//传递了view
if (v != null) {
offset = calcuateOffset(v);
if (showAtDown) {
if (Build.VERSION.SDK_INT < 24) {
mPopupWindow.showAsDropDown(v, offset[0], offset[1]);
} else {
// 获取控件的位置,安卓系统>7.0
int[] location = new int[2];
v.getLocationOnScreen(location);
mPopupWindow.showAtLocation(v, Gravity.NO_GRAVITY, offset[0], offset[1] +
location[1] + v.getHeight());
}
} else {
mPopupWindow.showAtLocation(v, popupGravity, offset[0], offset[1]);
}
}
................
}
}
你好,我在调用mInterpolatorPopup.setDismissWhenTouchOutside(false);
或在CustomInterpolatorPopup的构造方法中调用setDismissWhenTouchOutside(false);
依然无效果,还是可以触摸外部后弹窗消失。
测试机型:华为荣耀v8 ,系统版本7.0
Genymotion模拟器,系统版本7.1
描述功能:让pop显示在某个view的上方
SlideFromBottomPopup slideFromBottomPopup = new SlideFromBottomPopup(PopUpBottomSheetActivity.this);
slideFromBottomPopup.setOffsetY(DisplayUtil.dip2px(80, PopUpBottomSheetActivity.this));
slideFromBottomPopup.showPopupWindow(ll_bottom);、
80dp的时候就会显示在ll_bottom下面,90dp的时候就会显示在ll_bottom上面,反正很明显,offset计算的有问题
is it possible to create a new method to make the popupwindow cover the statusbar
经测试有三种情况会引起(只针对SlideFromTopPopup):
1.在SlideFromTopPopup显示的时候 切换App并返回
2.在SlideFromTopPopup显示的时候 将App切换到后台并返回
3.在SlideFromTopPopup显示的时候 手机插入数据线,系统弹出插入作用的提示框的时候
1.在SlideFromTopPopup显示的时候 切换App并返回
2.在SlideFromTopPopup显示的时候 将App切换到后台并返回
3.在SlideFromTopPopup显示的时候 手机插入数据线,系统弹出插入作用的提示框的时候
系统版本Android8.0 华为nova2s
更新2.0新版后不能响应点击事件,你可以看下你的demo里的menu popup里text 的点击也是没有反应的。
java.lang.AbstractMethodError: abstract method not implemented
at razerdp.basepopup.HackWindowManager.getGlobalSystemUiVisibility(HackWindowManager.java)
at android.widget.PopupWindow.getVisibleDisplayRect(PopupWindow.java:1439)
at android.widget.PopupWindow.findDropDownPosition(PopupWindow.java:1274)
at android.widget.PopupWindow.showAsDropDown(PopupWindow.java:946)
at razerdp.basepopup.PopupWindowProxy.callSuperShowAsDropDown(PopupWindowProxy.java:48)
at razerdp.basepopup.PopupCompatManager$ImplBefore24.showAsDropDown(PopupCompatManager.java:145)
at razerdp.basepopup.PopupCompatManager.showAsDropDown(PopupCompatManager.java:23)
at razerdp.basepopup.PopupWindowProxy.showAsDropDownProxy(PopupWindowProxy.java:35)
at razerdp.basepopup.BasePopupWindow.tryToShowPopup(BasePopupWindow.java:469)
at razerdp.basepopup.BasePopupWindow.showPopupWindow(BasePopupWindow.java:456)
现在的场景是上部有个EditText,然后EditText中输入文字会实时在下方用pop显示出搜索到的数据的pop,但现在如果pop显示后EditText就会失去焦点,之前使用自带的PopupWindow设置setFocusable(false)就可以了,请问这个库这个问题怎么解决?
BasePopupWindow.showPopupWindow()方法有时候不弹出界面的问题。(就是什么反应都没有)
但是同样的代码在调试的时候,最后又能弹出来。
没有报错
我的activity 是继承了一个BaseActivityWithRecyclerView然后在上面传入当前activity.this 在华为matel 9上日志输出
please make sure that context is instance of activity
我在另外一个界面 直接继承BaseActivity 就正常显示
E/PopupWindowProxy: please make sure that context is instance of activity
Android4.4版本下,布局里加入liseview或者recyclerview,背景无法覆盖状态栏
Android4.4版本下,4.4布局里加入liseview或者recyclerview
在继承了BasePopup的内部做点击事件 怎么跳转?????
如题,demo还是老版本,新的版本中没有setRelativePivot,那么怎么设置点赞的popup
anima view在pop的布局设置为其中的子view。并不能精确位置。小米miui8(android7.0) 。
有的地方anima view就是和pop的view相同,可以精确位置。但是有的地方就是不行。
设置了 setAutoShowInputMethod(true); 和getInputView()
java.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.app.Activity
PopupWindowProxy.class 87行
父布局:android.support.design.widget.CoordinatorLayout
popup.setDismissWhenTouchOuside(false);
方法无效点击外部还是会消失
习惯的拼写new XxPopup(content,new OnclickListener{"点击操作"}).showPopupWindow;,请问下如何在“点击操作”中直接dismiss当前popup。
原来用的是1.8.7
更新到1.8.8之后 输入框点击调不出键盘 ,按返回 没dismiss
大佬这要怎么搞
上手难难,demo很好,但是用到项目里根本不行 主要是显示在某个view 的方位
如何点击back键不关闭pop
最外层使用RelativeLayout的时候onMeasure空指针。
`public void onSuccess(String s, Call call, Response response) {
TL_info tl_info = GsonUtilsZcyke.GsonToBean(s, TL_info.class);
if (tl_info.isIsSuccessful()) {
netLoadingPopup.setOnDismissListener(new BasePopupWindow.OnDismissListener() {
@OverRide
public void onDismiss() {
startActivityAnim(HWStreamActivity.class);
}
});
} else {
showToast("初始化失败,请重试");
}
}
@Override
public void onBefore(BaseRequest request) {
super.onBefore(request);
showNetLoading();
}
@Override
public void onAfter(@Nullable String s, @Nullable Exception e) {
super.onAfter(s, e);
dismissNetLoading();
}
@Override
public void onError(Call call, Response response, Exception e) {
super.onError(call, response, e);
showToast("网络异常");
}`
现象:网络请求未Error,startActivityAnim(HWStreamActivity.class);也会调用
粗略解释:在结合使用网络框架时,网络请求为Error,OnDismissListener也会强行调用
根目录的gradle已经添加了jitpack,还是拉取不下来,Failed to resolve: com.github.razerdp:BasePopup:1.8.0
好郁闷
showPopupWindow(View v)和showPopupWindow(int res)传view对象和id都不起作用
就跟没修复一样,图片上传不了,点击slide,右上,展示跟左上一样,左下,右下都没反应
java.lang.NoClassDefFoundError: razerdp.library.R$style
at razerdp.basepopup.BasePopupWindow.initView(BasePopupWindow.java:70)
at razerdp.basepopup.BasePopupWindow.(BasePopupWindow.java:51)
this.mPopupWindow.setAnimationStyle(style.PopupAnimaFade);
找不到这个 style
我依赖的是 compile 'com.github.razerdp:BasePopup:v1.1.7'
我前几分钟还可以点,过了会就报这个错
Error:Failed to resolve: com.github.razerdp:BasePopup:1.8.0
下面是我所有的依赖
compile fileTree(include: ['*.jar'], dir: 'libs')
//tools
provided 'javax.annotation:jsr250-api:1.0'
annotationProcessor 'com.google.dagger:dagger-compiler:2.10'
compile 'com.blankj:utilcode:1.7.1'
compile 'com.umeng.analytics:analytics:6.0.1'
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.18'
compile 'com.qiniu:qiniu-android-sdk:7.3.3'
compile 'com.android.support:multidex:1.0.1'
compile project(':PushSDK')
//view
annotationProcessor rootProject.ext.dependencies["butterknife-compiler"]
compile 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.2-alpha-7'
compile rootProject.ext.dependencies["appcompat-v7"]
compile rootProject.ext.dependencies["support-v4"]
compile rootProject.ext.dependencies["design"]
compile rootProject.ext.dependencies["recyclerview-v7"]
compile rootProject.ext.dependencies["cardview-v7"]
compile 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
compile 'com.jakewharton.rxbinding2:rxbinding-design:2.0.0'
compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
compile 'com.youth.banner:banner:1.4.9'
compile 'com.sunfusheng:marqueeview:1.2.0'
compile 'com.lai.weavey:loadinglayout:1.3.1'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'com.just.agentweb:agentweb:1.2.5'
compile 'com.github.razerdp:BasePopup:1.8.0'
compile 'com.lzy.widget:imagepicker:0.5.5'
compile 'com.github.iwgang:countdownview:2.1.6'
compile 'com.contrarywind:Android-PickerView:3.2.5'
compile 'com.alibaba.android:vlayout:1.0.9@aar'
//arms
compile 'me.jessyan:arms:2.1.0'
//test
compile rootProject.ext.dependencies["logger"]
debugCompile rootProject.ext.dependencies["canary-debug"]
releaseCompile rootProject.ext.dependencies["canary-release"]
testCompile rootProject.ext.dependencies["canary-release"]
在4.4的手机,顶部下滑的动画根本不执行
at android.widget.PopupWindow$1.onScrollChanged(PopupWindow.java:149)
at android.view.ViewTreeObserver.dispatchOnScrollChanged(ViewTreeObserver.java:1016)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2464)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2396)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2026)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1104)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5962)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:794)
at android.view.Choreographer.doCallbacks(Choreographer.java:607)
at android.view.Choreographer.doFrame(Choreographer.java:577)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:780)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5296)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)
加载viewpager的时候无法获取到它的id
那个点击 某个按钮的时候 到底那个显示 popwup 那个坐标到底是怎么计算的啊·可不可以说的详细点啊·其他的都还比较好用·就是这个 计算这个坐标 写的 不够详细·我根本 搞不明白·
service回掉MainActivity的方法,方法执行弹出poupwindow方法,此时锚点VIew并未绘画完成。导致这个问题,使用WIKI中的三种方法均无效,使用延迟1秒后执行可行,但是想在此讨论是否有其他方法。
1.此方法调用弹出poupwindow
2.此方法为回调接口
3.此处为拉起MainActivity.
E/WindowManager: android.view.WindowLeaked: Activity hjk.indi.cloudcontacts.activity.MainActivity has leaked window android.widget.PopupWindow$PopupViewContainer{2926b9e7 V.E..... ........ 0,0-929,453} that was originally added here
at android.view.ViewRootImpl.(ViewRootImpl.java:373)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:271)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
at android.widget.PopupWindow.invokePopup(PopupWindow.java:1104)
at android.widget.PopupWindow.showAsDropDown(PopupWindow.java:1008)
at razerdp.basepopup.PopupWindowProxy.showAsDropDown(PopupWindowProxy.java:108)
at android.widget.PopupWindow.showAsDropDown(PopupWindow.java:968)
at razerdp.basepopup.BasePopupWindow.tryToShowPopup(BasePopupWindow.java:480)
at razerdp.basepopup.BasePopupWindow.showPopupWindow(BasePopupWindow.java:468)
at hjk.indi.cloudcontacts.activity.DialPoupWindow.showPopupWindow(DialPoupWindow.java:110)
07-22 09:06:27.340 12139-12139/com.westarsoft.subway E/BasePopupWindow: show error
07-22 09:06:27.340 12139-12139/com.westarsoft.subway W/System.err: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
07-22 09:06:27.340 12139-12139/com.westarsoft.subway W/System.err: at android.view.ViewRootImpl.setView(ViewRootImpl.java:567)
07-22 09:06:27.340 12139-12139/com.westarsoft.subway W/System.err: at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:310)
07-22 09:06:27.340 12139-12139/com.westarsoft.subway W/System.err: at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
07-22 09:06:27.340 12139-12139/com.westarsoft.subway W/System.err: at android.widget.PopupWindow.invokePopup(PopupWindow.java:1258)
07-22 09:06:27.340 12139-12139/com.westarsoft.subway W/System.err: at android.widget.PopupWindow.showAtLocation(PopupWindow.java:1032)
07-22 09:06:27.340 12139-12139/com.westarsoft.subway W/System.err: at android.widget.PopupWindow.showAtLocation(PopupWindow.java:995)
07-22 09:06:27.340 12139-12139/com.westarsoft.subway W/System.err: at com.example.framelib.basepopup.BasePopupWindow.tryToShowPopup(BasePopupWindow.java:297)
07-22 09:06:27.340 12139-12139/com.westarsoft.subway W/System.err: at com.example.framelib.basepopup.BasePopupWindow.showPopupWindow(BasePopupWindow.java:256)
07-22 09:06:27.340 12139-12139/com.westarsoft.subway W/System.err: at com.example.framelib.activtiy.BaseActivity.showProgressDialog(BaseActivity.java:190)
07-22 09:06:27.340 12139-12139/com.westarsoft.subway W/System.err: at com.example.framelib.activtiy.BaseActivity.showProgressDialog(BaseActivity.java:176)
07-22 09:06:27.340 12139-12139/com.westarsoft.subway W/System.err: at com.westarsoft.subway.activity.education.DailyQuestionActivity.setupViews(DailyQuestionActivity.java:76)
07-22 09:06:27.340 12139-12139/com.westarsoft.subway W/System.err: at com.example.framelib.activtiy.BaseActivity.onCreate(BaseActivity.java:38)
传入activity,当activity被回收一直显示泄露,忘给出解决方案
手机nexus6 版本6.0,
1.8.0版本setBackPressEnable有效
1.8.4版本setBackPressEnable无效
SlideFromTopPopupfrag中,pop显示的时候,点击action上的menu,pop不会消失,但是双击两次pop会消失,这个界面除了popwindow空白点击处,可以正常消失,其他地方都有这个问题,但是不容易发现。不知道是不是bug,项目中用了您的一部分代码,现在点击pop的布局,可以有消息动画,可是点击别的地方,就没有消失动画了。
我在listview中点击弹出popup,但是却弹出在下一条目上。华为7.0以上系统
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.