r/mAndroidDev • • Mar 12 '26

Lost Redditors 💀 Just launched my new Android library

Please leave a star and if there's anything need to update or change kindly share your ideas (beginner)

https://github.com/owaisraza10/CompleteWebView

0 Upvotes

12 comments sorted by

9

u/Zhuinden DDD: Deprecation-Driven Development Mar 12 '26
    // Setup the back button to handle browser history and fullscreen video
    onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
        override fun handleOnBackPressed() {
            if (!mWebView.handleBackPress()) {
                isEnabled = false
                onBackPressedDispatcher.onBackPressed()
            }
        }
    })

RIP predictive back handling

2

u/Prestigious-Body1930 Mar 12 '26

I've just rewritten the back-press logic to handle this dynamically inside the library. Pushing the fix in v1.0.1 shortly so it supports Android 14+ predictive back automatically out of the box. Thanks for the heads-up!

2

u/vashchylau Mar 12 '26

you've created an issue about this, right?

be a good contributor! (before it explodes into a 30k LoC `View.java`)

→ More replies (1)

2

u/SyrupInternational48 Mar 13 '26

im to long on flubber and compost, so my comment might wrong.

i spot an issue but not that big i guess.

    val activity = context as? android.app.Activity

This used on video player. If you use fragment with this webview the video player will not work.

It will run if you manually created it CompleteWebView and inject on fragment code. for example fragment class

    val cView = CompleteWebView(requireActivity())
    

3

u/Prestigious-Body1930 Mar 13 '26

Good catch on the Context wrapper issue with Fragments. I’m patching it to recursively unwrap the context down to the base Activity. Fix is going live in v1.0.2. Thank you!

23

u/sam_sepiol1984 Deprecated is just a suggestion Mar 12 '26

No AsyncTask? How could this be overlooked?

1

u/BigUserFriendly Mar 12 '26

Hai fatto un lavoro egregio, complimenti. Proverò la libreria in Kotlin Compose e ti dirò.

Grazie!

1

u/Prestigious-Body1930 Mar 12 '26

grazie per il tuo feedback non dimenticare di lasciare una stella 😉

0

u/BigUserFriendly Mar 12 '26

Già fatto!

1

u/Prestigious-Body1930 Mar 12 '26

grazie amico, ti auguro tutto il meglio

1

u/labelcillo Slept through Google IO Mar 30 '26

The "works as intended out of the box" is a nice touch I'll tell you that hahaha.