As Gallery View is deprecated, I'm trying to find a solution to implement an Horizontal List with different views (linearlayouts).
The first option was to use HorizontalScrollView it's fine, but I have to generate all the view by code and all views are stored in memory.
Another option is to use Viewpager, I need to implement my custom pagerAdapter and override the "getPageWidth" method to return a value between 0.0f and 1.0f.
The question is: In layouts I can set the with as a dip value in the XML, but working with PagerAdapter I need to return a float value and I don't know how to calculate this value to work as a dip in layouts.
Thanks.