Android Question Widgets - Screen Size

RichardN

Well-Known Member
Licensed User
Longtime User
To be honest I have not written code for a widget since circa Android 4!

I am just looking at a project, testing on a big screen Samsung S9+ and having difficulty in getting the widget anything larger than 4x5 units on the screen.

The guidance on the forum is very old now.

Q. What is the relashionship between parent panel size and widget size on larger devices?

Q. Is it still appropriate to use layout scripts to size the panel + other elements?

Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is it still appropriate to use layout scripts to size the panel + other elements?
Anchors and designer script will not work with home screen widgets. All views should be anchored to the top left.

and having difficulty in getting the widget anything larger than 4x5 units on the screen
Are you sure that there could be larger widgets? What is the size of the panel?
 
Upvote 0

RichardN

Well-Known Member
Licensed User
Longtime User
Judging by the selection of native Samsung and other installed widgets I should be able to achieve at least 5x5 size. My guess is that a full screen widget would be 5x7 at standard icon size. The screen pixels are big at 1440 x 2960 but I don't see why this should not be handled just the same as smaller px screens.

I will play with it a bit more and report back.
 
Upvote 0

RichardN

Well-Known Member
Licensed User
Longtime User
Having revisited the base panel size I can achieve both 5x5 and 5x7 widgets on this larger screen quite happily.
 
Upvote 0
Top