zzz40500 / androidsweetsheet Goto Github PK
View Code? Open in Web Editor NEW一个富有动感的Sheet(选择器)
License: Apache License 2.0
一个富有动感的Sheet(选择器)
License: Apache License 2.0
Thanks. :)
点击之后直接应用崩溃
java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@347765a3
at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1282)
at android.graphics.Canvas.setBitmap(Canvas.java:216)
at android.view.View.buildDrawingCacheImpl(View.java:14438)
at android.view.View.buildDrawingCache(View.java:14339)
at android.view.View.getDrawingCache(View.java:14246)
at android.view.View.draw(View.java:14933)
at android.view.ViewGroup.drawChild(ViewGroup.java:3426)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3219)
at android.view.View.draw(View.java:15138)
at android.view.ViewGroup.drawChild(ViewGroup.java:3426)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3219)
at android.view.View.draw(View.java:15138)
at android.view.ViewGroup.drawChild(ViewGroup.java:3426)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3219)
at android.view.View.draw(View.java:15138)
at android.view.ViewGroup.drawChild(ViewGroup.java:3426)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3219)
at android.view.View.draw(View.java:15138)
at android.view.ViewGroup.drawChild(ViewGroup.java:3426)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3219)
at android.view.View.draw(View.java:15234)
at android.widget.FrameLayout.draw(FrameLayout.java:598)
at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2650)
at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2644)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2557)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2352)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1982)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
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:5254)
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:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
Hello,
After adding the line
maven { url "https://jitpack.io" }
and the gradle compile line : compile 'com.github.zzz40500:AndroidSweetSheet:1.1.0'
I still have : Failed to resolve: com.github.zzz40500:androidsweetsheet:1.1.0
Do you have any fix of this error please ?
Thank you !
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:4310)
at android.view.ViewGroup.addView(ViewGroup.java:4146)
at android.view.ViewGroup.addView(ViewGroup.java:4118)
at com.mingle.sweetpick.CustomDelegate.show(CustomDelegate.java:124)
at com.mingle.sweetpick.SweetSheet.show(SweetSheet.java:115)
at com.acgcode.template.MainActivity$1.onClick(MainActivity.java:81)
at android.view.View.performClick(View.java:5207)
at android.view.View$PerformClick.run(View.java:21177)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5458)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
应该是控件内部没有执行完,需要考虑执行完才能进行下一次show
还有怎样可以隐藏那个拖拽的按钮呢?
sheet = new SweetSheet(mRootView);
CustomDelegate customDelegate = new CustomDelegate(true, CustomDelegate.AnimationType.DuangLayoutAnimation);
View mSheetView = LayoutInflater.from(getActivity()).inflate(R.layout.disc_near_shop_bottom_sheet, null, false);
customDelegate.setCustomView(mSheetView);
sheet.setDelegate(customDelegate);
hello, please add setgravity for rtl language, thanks
你好,请问下为什么AS使用gradle下载不下来你的代码啊?
支持新增一個dismiss listener, 設置彈出速度 二級聯動
謝
I'd like to change my sheet color.
How to do that?
java.lang.IllegalStateException: Cannot start this animator on a detached view!
at android.view.RenderNode.addAnimator(RenderNode.java:817)
at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:277)
at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:261)
at android.animation.RevealAnimator.(RevealAnimator.java:37)
at android.view.ViewAnimationUtils.createCircularReveal(ViewAnimationUtils.java:48)
at com.mingle.widget.CircleRevealHelper.circularReveal(CircleRevealHelper.java:64)
at com.mingle.widget.CircleRevealHelper.circularReveal(CircleRevealHelper.java:52)
at com.mingle.widget.CRImageView.circularReveal(CRImageView.java:84)
at com.mingle.sweetpick.CustomDelegate$AnimationImp.onEnd(CustomDelegate.java:180)
at com.mingle.widget.SweetView$4.onAnimationEnd(SweetView.java:126)
at com.nineoldandroids.animation.ValueAnimator.endAnimation(ValueAnimator.java:1034)
at com.nineoldandroids.animation.ValueAnimator.access$900(ValueAnimator.java:43)
at com.nineoldandroids.animation.ValueAnimator$AnimationHandler.handleMessage(ValueAnimator.java:669)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5292)
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:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
ide是android studio , 加入这个库之后sync出错,请问应该如何解决?
Can we implement SweetSheet library like Android SlidingPaneLayout ?
作者你好,这个库,相当不错,我使用和分析代码后,将其运用到自己的项目中,结果在使用过程中出现了一个bug:
10-21 12:36:57.174 16444-16444/ E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NullPointerException
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2821)
at android.view.View.draw(View.java:13513)
at android.view.View.getDisplayList(View.java:12461)
at android.view.View.getDisplayList(View.java:12505)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2934)
at android.view.View.getDisplayList(View.java:12397)
at android.view.View.getDisplayList(View.java:12505)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2934)
at android.view.View.getDisplayList(View.java:12397)
at android.view.View.getDisplayList(View.java:12505)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2934)
at android.view.View.getDisplayList(View.java:12397)
at android.view.View.getDisplayList(View.java:12505)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2934)
at android.view.View.getDisplayList(View.java:12397)
at android.view.View.getDisplayList(View.java:12505)
at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1187)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2149)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2021)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1832)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4216)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5004)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
at dalvik.system.NativeStart.main(Native Method)
上述log提示我绘制错误,我关闭硬件加速,出现softwaredraw的错误,不知道是什么地方的问题,这困惑了我很久。
请问如何可以自定义动画时间
控件效果很好,我这里有个小建议,关于按返回键Dismiss的。
一般情况是,如果在控件已经弹出,点击返回键,A:让其dismiss,B:要么什么都不做(也不finish,控件在弹出状态下finish实在太奇怪了)。
所以每次使用弹出框的时候,监听返回键是必须的。如果每次都要实现onBackPress(),必须在Activity中有效不说,其次是Activity要拿到mSheet的引用,封装起来很不方便。
查了一下资料,可以通过setOnKeyListener()来监听键盘事件,可能需要等界面绘制完成才能获取焦点?所以加了post。
亲测有效。
这样的话,可以向外提供返回键的响应模式(上面提到的A、B);
最后还是感谢你的控件,写得很不错~
mBg.post(new Runnable() {
@OverRide
public void run() {
mBg.setFocusableInTouchMode(true);
mBg.setOnKeyListener(new View.OnKeyListener() {
@OverRide
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
dismiss();
return true;
}
return false;
}
});
}
});
问下如果扩展adapter模式,需要从哪里下手? 作者您那边有空实现这个嘛
Hi,
I have integrated this lib in the application, but it crashes the app in android 4.4.2, can anybody help with it?
Thanks
直接安裝Demo上去,背景並非像示意一樣會有模糊底及白色區域彈跳效果
java.lang.IllegalStateException: Cannot start this animator on a detached view! at android.view.RenderNode.addAnimator(RenderNode.java:817) at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:277) at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:261) at android.animation.RevealAnimator.<init>(RevealAnimator.java:37) at android.view.ViewAnimationUtils.createCircularReveal(ViewAnimationUtils.java:48) at com.mingle.widget.CircleRevealHelper.circularReveal(CircleRevealHelper.java:64) at com.mingle.widget.CircleRevealHelper.circularReveal(CircleRevealHelper.java:52) at com.mingle.widget.CRImageView.circularReveal(CRImageView.java:84) at com.mingle.sweetpick.CustomDelegate$AnimationImp.onEnd(CustomDelegate.java:180) at com.mingle.widget.SweetView$4.onAnimationEnd(SweetView.java:126) at com.nineoldandroids.animation.ValueAnimator.endAnimation(ValueAnimator.java:1034) at com.nineoldandroids.animation.ValueAnimator.access$900(ValueAnimator.java:43) at com.nineoldandroids.animation.ValueAnimator$AnimationHandler.handleMessage(ValueAnimator.java:669) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5264) 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:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
我在外面添加了防抖动点击,依然会崩溃。所以我认为是里面onclick的dismiss的动画问题,如果增加动画的防抖动点击可以修复这个BUG。
Usually works fine, but sometime bottom sheet not get visible ??
Clicking rapidly on custom views causes crash. kindly view the log
Process: .buttomsheet, PID: 26272
java.lang.IllegalStateException: Cannot start this animator on a detached view!
at android.view.RenderNode.addAnimator(RenderNode.java:817)
at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:300)
at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:282)
at android.animation.RevealAnimator.<init>(RevealAnimator.java:37)
at android.view.ViewAnimationUtils.createCircularReveal(ViewAnimationUtils.java:53)
at com.mingle.widget.CircleRevealHelper.circularReveal(CircleRevealHelper.java:64)
at com.mingle.widget.CircleRevealHelper.circularReveal(CircleRevealHelper.java:52)
at com.mingle.widget.CRImageView.circularReveal(CRImageView.java:84)
at com.mingle.sweetpick.CustomDelegate$AnimationImp.onEnd(CustomDelegate.java:180)
at com.mingle.widget.SweetView$4.onAnimationEnd(SweetView.java:126)
at com.nineoldandroids.animation.ValueAnimator.endAnimation(ValueAnimator.java:1034)
at com.nineoldandroids.animation.ValueAnimator.access$900(ValueAnimator.java:43)
at com.nineoldandroids.animation.ValueAnimator$AnimationHandler.handleMessage(ValueAnimator.java:669)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5643)
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:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)```
java.lang.IllegalStateException: Cannot start this animator on a detached view!
at android.view.RenderNode.addAnimator(RenderNode.java:812)
at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:300)
at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:282)
at android.animation.RevealAnimator.(RevealAnimator.java:37)
at android.view.ViewAnimationUtils.createCircularReveal(ViewAnimationUtils.java:55)
at com.mingle.widget.CircleRevealHelper.circularReveal(CircleRevealHelper.java:64)
at com.mingle.widget.CircleRevealHelper.circularReveal(CircleRevealHelper.java:52)
at com.mingle.widget.CRImageView.circularReveal(CRImageView.java:84)
at com.mingle.sweetpick.CustomDelegate$AnimationImp.onEnd(CustomDelegate.java:180)
at com.mingle.widget.SweetView$4.onAnimationEnd(SweetView.java:126)
at com.nineoldandroids.animation.ValueAnimator.endAnimation(ValueAnimator.java:1034)
at com.nineoldandroids.animation.ValueAnimator.access$900(ValueAnimator.java:43)
at com.nineoldandroids.animation.ValueAnimator$AnimationHandler.handleMessage(ValueAnimator.java:669)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5438)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
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.