https://kotlinlang.org logo
#compose
Title
# compose
t

tieskedh

10/25/2019, 1:16 PM
I guess the oposite isn't possible either? (I need to include a logo inside my TopAppBar, but I use FitStart... A work-around for creating an image as title isn't difficult, but I don't know how to do FitStart...)
a

Andrey Kulikov

10/25/2019, 1:46 PM
we didn't yet implement other scale types apart of CENTER_CROP, but it is not really hard to implement it manually. please take a look how DrawImage component works here https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/ui/ui-foundation/src/main/java/androidx/ui/foundation/Image.kt. official support for other scale types is planned
1
t

tieskedh

10/25/2019, 2:42 PM
Thx, I found the function and it indeed looked very easy... I couldn't find the code for FitStart. In the ImageView a couple of fitTypes are dealt with straight away, but the implementation of FitStart is native (to my understanding). Therefor I couldn't find it... The Matrix is also not accepted straight away, and I don't know how to map it to Matrix4... But I understand that official support is comming later 🙂
a

Andrey Kulikov

10/25/2019, 2:54 PM
please at least add canvas.save() before calling concat and canvas.restore() after drawing so this transformation will not be applied for other components accidentally