Ripple effect on all clickable items is slow - android

I do not know what could it be, but does not look like a performance issue (like doing too much work on the background) because there is no message on LogCat saying Slow measurement, Frames skipped or ConstraintLayout issues. The app animations work perfectly. But, unfortunately, all the clickable elements that I added on the xml:
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
are too slow. That slow, that whenever I click, instead of the smooth animation that moves and starts on the exact pixel I click on, it appears an awful shadow and remains like so for a while (~2 sec).
If it is indeed an android performance issue, how to debug it? Also, I do not know where to start and which information I need to add in order to add valuable information to this question but, if needed, please, ask for it and I will try to add as much information as possible.
The only thing I could say in advance is I am using MVVM and coroutines, so there is no performance issues on that matter, but maybe only UI related?
EDIT:
Samsung J2 Prime and Samsung Galaxy Note 3 work good, all animations are good (even though is a small and old device)
Motorola Zoom and Redmi Note 8 Pro are working with laggy animations (animations are meant only the clickable animation (Ripple effect), the ConstraintLayout animations are working smooth.

Related

Remove Intro Animation from Android Live Wallpaper App

Say what you want about Live Wallpapers, but I found an App for Android called Chrooma, which I actually quite like.
https://play.google.com/store/apps/details?id=com.gamelounge.chrooma_lwp.android&hl=de&gl=US
The problem is, it's kinda outdated.
Even though it mostly works fine, it sometimes has some issues loading the shapes. Sometimes it just takes a while and you have an odd, uni-colored background. Sometimes the shapes are layered all in the same spot.
To me, it feels like the intro animation is causing some issues. It feels like it's "thinking" too long what it should do next/how to slide the shapes in. There is a setting inside the app to disable it, but it (sometimes) does it anyways.
So I was wondering...is there a way to remove those animations from the code completely?
But I've actually never touched Android apk before, so please talk slowly :D

Fullpage.js choppy scrolling on Android 4.2.1

I'm using fullpage.js for an html5/css3/jquery based app for Android 4.2 tablet, that I generate with PhoneGap web service. On PC and emulators everything works smooth and fast, but on tablet itself scrolling between sections is very slow and choppy. Scrolling between slides is a bit better, though not smooth either. I have css3: true in fullpage.js options and I use very light-weight images and elements for the app. Let's say each section loads around 50kb per scroll. I have fixed background for all sections and it stays in place without lags, only loaded per-section content is getting choppy (it looks like it's loading in square patches).
When I open the same html files in tablet's Chrome browser, everything works smooth as well. So I believe it's Android's default WebView causing this choppiness and issues. Is there any way to make it work smooth with fullpage.js?
The link you just posted took 94 seconds to load on my PC using Chrome. And it had plenty of console errors.
Besides that, it is clearly a problem of performance with your site.
You are trying to create a HUGE website layout. With 30 sections and nothing less than 105 slides...
Do not expect it to work smooth on a mobile phone. Your layout in a 1280x1024 resolution is creating a layout of 28.170 pixels height and a few more thousand pixels width. And all of it has to be moved on every scroll.
You can probably make it easier for your browser if you implement some lazy load technique (or even an ajax one for the section/slide contents). This way you will still having the huge layout but it will be empty at least.
Check out this answer for that.
You can even take a look at the lazy load option fullpage.js provides.
Also, using the option scrollBar:true might improve the performance.

Quirky animation on SurfaceView with good FPS

I implement linear animation for lot of objects on SurfaceView and found the following issue: on Samsung S4 and S3 the animation is quirky, but FPS is near 60. On other devices works perfectly.
After I disabled hardware acceleration in Manifest it worked much better, but sometimes the screen is flickering.
Please advice where might be the root of problem. Thanks!
upd: as for code - I don't create any objects in realtime but reusing the ones from object pools.

Google Maps slow in Android 2.2's WebView when using CSS3 transformations

I can't get CSS3 transformations and Google Maps to play nice together in Android 2.2's WebView. Here is a fiddle, with two buttons to test transformations. You will need to enable "Emulate touch events" in Chrome to be able to click on them in the desktop. The device I'm using has a 1024x600 screen.
If I don't do anything special, there is flickering when a transformation starts. Now, if I add -webkit-backface-visibility: hidden to the element I'm applying the transformation to, everything is silky smooth and there is no flicker, but the map becomes impossibly slow, and you can't barely scroll around.
I tried to work around this by removing -webkit-backface-visibility by setting it to visible. This works, and the map will be fine again, but setting the property causes flicker. I also played around with -webkit-perspective and -webkit-transform-style, which also seem to get rid of the flicker when a transformation starts, but they also cause flicker when removed.
I also noticed that applying '-webkit-backface-visibility: hidden' to any element on the page makes the flickering at the beginning of transformations disappear. So I put a small div with the property on it, and when the transforms were done, I hid it with "display: none". This causes flicker as well.
My question is, thus: how can I have -webkit-backface-visibility (which I need in order to make the transformations flicker-free) and Google Maps, without making Maps slow?
Possible issues can be 2.2 is rather out of date and you should realistically be using 3.0 now to support tablets. Also, if you are testing on an emulator then this will be your issue.

Orientation change messes with hardware acceleration settings

I'm developing an app with sdk 11 (Honeycomb). In this app I make use of hardware acceleration (at application level) to make animations smoother and without it, they are unacceptably sluggish. Since my client really wants to have them, I have to find another solution than turning the acceleration off.
The problem itself is that I have an Activity which contains few WebView elements. 3, to be exact - 1 is always shown and 2 others are used for preloading pages, so they are invisible (I mean positioned off the screen, but still "visible"). I use translation animation to "switch" between them. With hardware acceleration on, they render web pages incorrectly - I get big, flickering black boxes over the page. This is of course unacceptable, so I bypassed the problem by turning hardware acceleration off for all WebViews:
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
I've also tried to set this in xml file (android:layerType="software"), but it worked exactly the same way (as it should be). Anyway, both those methods work pretty well - the animations and WebViews are smooth enough and there are no artifacts. The problem arises however once the orientation changes. Even though I make no important distinctions between portrait and landscape mode in my code, it works like this:
Activity starts in portrait mode, change orientation to landscape, back to portrait, and so on. Everything works as expected.
Activity starts in landscape mode. It works fine. Orientation changes to portrait. Artifacts start to show again. Most often whole screen just goes black with webpage showing through once in the blue moon when I scroll/zoom the page. This is exactly the same as if the WebViews used hardware acceleration. Back to landscape - it works fine again.
This had led me to think that the hardware acceleration might be the problem. I was proved myself right by trying to set software acceleration at different levels of view hierarchy to see if this strange behavior stops. I found out that it does indeed stop, and it works without bugs, but only once whole Activity is software accelerated, which is unacceptable to me (my translation animations! [+slow scrolling in webviews]). If only views/viewgroups in the layout xml file are set to be software accelerated, it still bugs. Is there anything about orientation changes which can trigger such behavior? Any solutions, hacks, hints, suggestions, ideas, thoughts, however incomplete, are welcome - I'm out of those.
If you need more info or some code, I will gladly provide it to you.
Thank you for your time!

Categories

Resources