likaiyuan559 / toucheffects Goto Github PK
View Code? Open in Web Editor NEWAndroid View点击特效TouchEffects,几行代码为所有控件添加点击效果
License: MIT License
Android View点击特效TouchEffects,几行代码为所有控件添加点击效果
License: MIT License
使用 androidx.appcompat.widget.AppCompatRadioButton 会报类型转换异常
java.lang.ClassCastException: com.lky.toucheffectsmodule.effects_view.TouchEffectsButton cannot be cast to androidx.appcompat.widget.AppCompatRadioButton
2017-08-06 04:24:36.976 11296-11296/com.deling.launcher E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.deling.launcher, PID: 11296
android.view.InflateException: Binary XML file line #95: com.lky.toucheffectsmodule.effects_view.TouchEffectsButton cannot be cast to android.view.ViewGroup
Caused by: java.lang.ClassCastException: com.lky.toucheffectsmodule.effects_view.TouchEffectsButton cannot be cast to android.view.ViewGroup
at android.view.LayoutInflater.rInflate(LayoutInflater.java:864)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:995)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:859)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatDialog.setContentView(AppCompatDialog.java:95)
at androidx.appcompat.app.AlertController.installContent(AlertController.java:232)
at androidx.appcompat.app.AlertDialog.onCreate(AlertDialog.java:279)
at android.app.Dialog.dispatchOnCreate(Dialog.java:403)
at android.app.Dialog.show(Dialog.java:302)
at com.hrs.setting.fragments.syssetting.wifi2.CustomDialogManager.createDialog(CustomDialogManager.java:59)
at com.hrs.setting.fragments.syssetting.wifi2.WifiContentDialog.createDetailDialog(WifiContentDialog.java:86)
at com.hrs.setting.fragments.syssetting.wifi2.SettingNet_wifiFragment.showWifiDetailDialog(SettingNet_wifiFragment.java:385)
at com.hrs.setting.fragments.syssetting.wifi2.SettingNet_wifiFragment.onItemClick2(SettingNet_wifiFragment.java:633)
at com.hrs.setting.fragments.syssetting.wifi2.SettingNet_wifiFragment$2.onItemClicked(SettingNet_wifiFragment.java:236)
at com.hrs.setting.adapter.WifiDisListAdapter$ViewHolder$1.onClick(WifiDisListAdapter.java:144)
at com.lky.toucheffectsmodule.effects_adapter.EffectsAdapter.lambda$createClick$0(EffectsAdapter.java:115)
at com.lky.toucheffectsmodule.effects_adapter.-$$Lambda$EffectsAdapter$Yq9_SbqlNb8wh814PtBEwLQABQY.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
给兼容api23以下的吧
目前是支持低api的哦,详见demo中minSdkVersion,16是没有问题的。
你是用的drawforground() api23以下没效果的
Originally posted by @ab503044120 in #2 (comment)
作者开源的项目很棒,已经初步考虑在实际项目中使用。但是水波纹效果只有在手指离开后才会有而不是一开始触摸的就慢慢有水波纹,这是刻意这样设计的吗?
fragment中添加了7个item,点击低4个弹出activity后返回 ,然后点击第二个,发现点击第二个item获取到的信息还是刚才点击的第4个item的信息.去掉Toucheffects就不会有这个问题了.
在列标中设置点击事件会导致下标错乱
android.view.InflateException: Binary XML file line #97: com.lky.toucheffectsmodule.effects_view.TouchEffectsButton cannot be cast to android.view.ViewGroup
能否添加一个调整点击色值的
我的华为手机有时候点了一会儿之后,再次点击所有的按钮都无效了,点击没有反应。
比如 现在 常用的遇到的bug
java.lang.ClassCastException: com.lky.toucheffectsmodule.effects_view.TouchEffectsLinearLayout cannot be cast to androidx.appcompat.widget.LinearLayoutCompat
recyclerView设置长按失效,另外有没有单独取消点击效果的api?
java.lang.NoSuchMethodError: No static method metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; in class Ljava/lang/invoke/LambdaMetafactory; or its super classes (declaration of 'java.lang.invoke.LambdaMetafactory' appears in /apex/com.android.runtime/javalib/core-oj.jar)
设置ripple的情况下,带圆角的view点击效果指示的还是不带圆角的view,影响点击体验
带有webview的界面中使用,webview加载完成后出现如下错误:
09-05 21:03:06.917 3779-3872/com.xujl.mvcbind W/art: Method processed more than once: java.lang.String org.chromium.net.X509Util.hashPrincipal(javax.security.auth.x500.X500Principal)
09-05 21:03:07.289 3779-3779/com.xujl.mvcbind W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 3779
09-05 21:03:08.689 3779-3779/com.xujl.mvcbind W/art: Method processed more than once: java.util.Map com.android.webview.chromium.WebViewUrlWatcher.readConfigFile()
09-05 21:03:08.933 3779-3779/com.xujl.mvcbind W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 3779
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: android.view.InflateException: Binary XML file line #95: com.lky.toucheffectsmodule.effects_view.TouchEffectsButton cannot be cast to android.view.ViewGroup
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at androidx.appcompat.app.AppCompatDialog.setContentView(AppCompatDialog.java:94)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at androidx.appcompat.app.AlertController.installContent(AlertController.java:232)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at androidx.appcompat.app.AlertDialog.onCreate(AlertDialog.java:279)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.app.Dialog.dispatchOnCreate(Dialog.java:394)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.app.Dialog.show(Dialog.java:295)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at com.just.agentweb.DefaultUIController.onOpenPagePrompt(DefaultUIController.java:83)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at com.just.agentweb.AgentWebUIControllerImplBase.onOpenPagePrompt(AgentWebUIControllerImplBase.java:44)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at com.just.agentweb.DefaultWebClient.deepLink(DefaultWebClient.java:258)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at com.just.agentweb.DefaultWebClient.shouldOverrideUrlLoading(DefaultWebClient.java:301)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at com.just.agentweb.WebViewClientDelegate.shouldOverrideUrlLoading(WebViewClientDelegate.java:58)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at com.android.webview.chromium.WebViewContentsClientAdapter.shouldOverrideUrlLoading(WebViewContentsClientAdapter.java:342)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at org.chromium.android_webview.AwContentsClient.shouldIgnoreNavigation(AwContentsClient.java:168)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:256)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:39)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.os.Looper.loop(Looper.java:148)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5539)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at java.lang.reflect.Method.invoke(Native Method)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: Caused by: java.lang.ClassCastException: com.lky.toucheffectsmodule.effects_view.TouchEffectsButton cannot be cast to android.view.ViewGroup
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.view.LayoutInflater.rInflate(LayoutInflater.java:836)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.view.LayoutInflater.parseInclude(LayoutInflater.java:971)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.view.LayoutInflater.rInflate(LayoutInflater.java:831)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
09-05 21:03:09.060 3779-3779/com.xujl.mvcbind W/System.err: ... 24 more
可以单独设置点击时才有效果吗?目前按下时也有效果,会导致类似列表拖动时出现效果
目前发现个问题,正常在layout布局里静态添加到xml的控件正常 ,但动态创建后 通过FrameLayout add 到 这样的view 不起作用
在普通的veiw或者RecyclerView中,如果执行滑动的手势,会触发点击效果。普通的view还好,但是RecyclerView触碰的item会闪烁一下,用户体验不是很好。这个有没有办法处理呢?我看了看微信,微信在滑动列表时item是没有反馈的,似乎是加了个延迟来判断的点击还是滑动。
动画效果导致反应事件太慢,能不能够在速度体验上优化下。
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.