I need to draw UI which is exactly twice the screen width, scrolled within HorizontalScrollView.
Pseudocode is like that:
<HorizontalScrollView width=device_screen>
<myUI width=device_screen*2>...</myUI>
</HorizontalScrollView>
I do not want to set exact width in px/dp for each device on the market, but I did not find a way to set view width declaratively for ANY device relatively to its parent.
It there any way for that?
You can use WindowManager class to get current display info, multiply by 2 and assign it to the width of the view. Something like this: