sakusaku3939 / DeepLAndroid

Unofficial Android App for DeepL Translator
MIT License
334 stars 18 forks source link

open popup as soon as the webview as completely loaded #67

Closed fm-sys closed 2 years ago

fm-sys commented 2 years ago

fix #62

fm-sys commented 2 years ago

BTW, this PR will most likely conflict with #64, so one of both PRs needs to be rebased as soon as the other one was merged...

sakusaku3939 commented 2 years ago

Thanks for the pull request! However, with this solution, there is a period of time when nothing is displayed until the WebView is loaded, which makes it look like it is not responsive.

For example, you can display a temporary element until it is loaded so that the fps does not drop. Simple example: change the NestedScrollView in the latest master's popup_layout to android:layout_height="480dp"

fm-sys commented 2 years ago

you can display a temporary element until it is loaded so that the fps does not drop.

In fact it's not the fps which drops. The screen keeps updating with 50 (?) Hz. It just looks like it got stuck, cause the webview adjusts it's height according to the (slowly) loaded website multiple times.

Simple example: change the NestedScrollView in the latest master's popup_layout to android:layout_height="480dp"

layout_height would probably break the possibility to expand the popup. Oh, and IMHO an empty popup looks even more unresponsive than a popup, which is shown with a very small delay.

But I will take a look what I can do with the "time in-between"

sakusaku3939 commented 2 years ago

I see, maybe it was not a good to test it on a low performance device. I'll leave it to you to make the changes here!

fm-sys commented 2 years ago

Another idea would be to show the popup directly, but use a shimmer effect while loading...

https://github.com/facebook/shimmer-android

(I will provide screenshots as time permits)

fm-sys commented 2 years ago

With shimmer effect loading animation:

Video

sakusaku3939 commented 2 years ago

Super cool!! Thank you for realizing a good solution.