fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Fresco and the new percent library

Open Shailevy opened this issue 11 years ago • 4 comments

Hi,

Can you please clarify how fresco will behave inside one of the new percent layouts like PercentFrameLayout ? (http://developer.android.com/reference/android/support/percent/PercentFrameLayout.html)

Shailevy avatar Aug 18 '15 11:08 Shailevy

As far as I know, we haven't done any special testing with this particular layout. Do you have any problems with it or?

plamenko avatar Aug 18 '15 14:08 plamenko

I didn't give it a try because a successful try on the Android doesn't say much due the ecosystem fragmentation, I'm guessing there might be some issue because of your statements about the drawee width and height:

Height and width mandatory# You must declare both android:layout_width and android:layout_height. Without both of these two, the view will not be able to lay the image out correctly.

"wrap_content Drawees do not support the wrap_content value for the layout_width and layout_height attributes.

The reason for this is that the content's size changes. The size of your downloaded image can be different from your placeholder - and the failure and retry images, if any, can be still different.

Use of wrap_content would force Android to do another layout pass when your image comes in - and for the layout to change before users' eyes, creating a jarring effect."

Now bear in mind Google's statement about the percentage view groups: "It is not necessary to specify layout_width/height if you specify layout_widthPercent. However, if you want the view to be able to take up more space than what percentage value permits, you can add layout_width/height="wrap_content". In that case if the percentage size is too small for the View's content, it will be resized using wrap_content rule."

So I feel like there is a some knowledge needed to figure out all the test cases here and if there is a problem I hope you guys will update the "gotachs" section quickly..

On the other hand, I used fresco in the past with a LinearLayout weight (0dp) and seems to work great so maybe I'm worried about nothing...

In a way, I'm kind of hoping you will take the lead and do some special testing with all the new layout tools in android.support.percent

I'm guessing you guys can tell if any problems are expected just by looking on all the relevant elements here

Shailevy avatar Aug 18 '15 17:08 Shailevy

We have not yet actually tested this, but I would expect the same rules to apply. You can freely lay out a Drawee using percents, but wrap_content will not work.

tyronen avatar Aug 25 '15 16:08 tyronen

this seems to be working fine in Android 25+ devices but on devices < 25 it crashes with OOM. Please advice how we go about this issue

kraghu avatar Sep 19 '17 00:09 kraghu