google / flexbox-layout

Flexbox for Android
Apache License 2.0
18.22k stars 1.79k forks source link

FlexboxLayoutManager works with static images but not when load image from url #587

Open akankshapaul048 opened 2 years ago

akankshapaul048 commented 2 years ago

When adapter is notified all image fit to a single line instead of stretching by image size

val layoutManager = FlexboxLayoutManager(mContext).apply { flexWrap = FlexWrap.WRAP flexDirection = FlexDirection.ROW alignItems = AlignItems.STRETCH }

val lp = ivGallery?.layoutParams if (lp is FlexboxLayoutManager.LayoutParams) { lp.flexGrow = 1f } device-2021-09-15-190844