Use generics to get rid of casting
It is better to use generics instead of casting like below.
imageView.doOnPreDraw {
(it as ImageView).doSomething()
}
Please retain an overload with the old signature and a deprecated annotation with a visibility of hidden to maintain binary compatibility as well.
Does it make sense to upgrade the signature for doOnLayout and doOnNextLayout to use generics as well?
Sure!
On Tue, Feb 6, 2018 at 11:48 AM Dave Thomas [email protected] wrote:
Does it make sense to upgrade signature for doOnLayout and doOnNextLayout to use generics as well?
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/android/android-ktx/pull/177#issuecomment-363486825, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEERDlv_dmnXKjdWNCy05WWhBba1Elks5tSIJagaJpZM4R6jyt .
@romainguy Thank you for your review!
I updated current.txt and added some tests.