https://kotlinlang.org logo
Title
a

am414

12/31/2018, 3:43 PM
hi everyone 👋 I have a silly issue and I don't recognize what happens, actually, this is my first time to use a library written in Java for (android+kotlin) project I use this lib https://github.com/ittianyu/BottomNavigationViewEx
BottomNavigationViewEx (latest version) + SdkVersion 28
and I can't even declare the view to use it, I tried a few ways but always compiler error + runtime error so my question is that how I can declare this BottomNavigationViewEx View in my kotlin project
val bottomNavigationViewEx = findViewById<BottomNavigationViewEx>(R.id.main_bottom_navigation)
java.lang.RuntimeException: Unable to start activity ComponentInfo: java.lang.ClassCastException: com.google.android.material.bottomnavigation.BottomNavigationView cannot be cast to com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
i

itnoles

12/31/2018, 4:07 PM
You have to change it on XML layout too
a

am414

12/31/2018, 4:15 PM
@itnoles thanks for reply, sorry change the view to what ?
i

itnoles

12/31/2018, 4:17 PM
in XML, change com.google.android.material.bottomnavigation.BottomNavigationView to com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
🙏 1
a

am414

12/31/2018, 4:19 PM
oooooh 😂 many thanks bro, i didn't expect this
r

rnpy

01/02/2019, 8:58 PM
I'd recommend against using that lib, it's a pretty ugly hack that uses reflection to modify the support library bottom bar control