Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- good day all :wave: i'm working on a leanback app (have a *bit* of standard android experience, but it was many years ago, and i'm quite rusty), and attempting to embrace support libraries, kotlin, and a handful of the other "new" stuff that has come along in my absence...
- i'm really struggling to wrap my head around the idea of callbacks, the concept of coroutines in kotlin, the relationship between the two, and how to use them effectively and cleanly.
- in particular, my current project is a "simple" video browser (at this point), which so far uses the provided leanback support classes, to query TMDb for lists of movies, then queries for extended details about each movie in the list, in order to get artwork, details, etc.
- i'm doing this with retrofit + moshi (for the queries), and glide (for the images, obviously), which works fine for loading the images themselves, but has got me in "callback hell" already, and doesn't really lend itself well to the next feature i'd like to implement: palette matching.
- the logic i'm using for all the aforementioned callbacks is included here: https://gist.github.com/dmyoung9/8641facbc9214c3f35e11df28d7b60c5, but is only the pertinent code rather than the entire contents. this also seems to work "fine", but has a couple unintended behaviors at the moment that i can't quite figure out:
- * palette colors often don't get shown until the VH has been rebound
- * the currently selected card often has the wrong color (in some cases very obviously a color from an adjacent card)
- * callbacks :face_with_symbols_over_mouth:
- are there any recommended resources, tips, or any other help you guys could offer me here?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement