Android Question Is it necessary to design in 2 variants (landscape and portrait)

Nitin Joshi

Active Member
Licensed User
I am struggling from the beginning to unify control placement to match any mobile variant.

I start my question from the basic.....Do I need to make design in, 320 x 480, scale=1 (160dpi) and 480 x 320, scale=1 (160dpi), 2 variants?

Dear experts, I am now going step by step to develop a standard method for all my app to get rid of control placement. Please help me from above basic question.
 

eps

Expert
Licensed User
Longtime User
Probably not, one is for landscape and one for portrait - it depends if you want or think that users will want to use your app interchangeably in portrait or landscape mode.

Sticking to the one that works the best is the easier way forward. Usually one approach works more naturally, stick to that.
 
Upvote 0

Nitin Joshi

Active Member
Licensed User
Thank you for suggestion. However, I want to implement landscape and portrait both modes for user convenience. Controls placement is different in each mode.

What can be suggested? Appreciate experts feedback.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Appreciate experts feedback.
You keep requesting help only from so called 'Experts'. In this forum, 'Experts' is irrelevant. You can be labeled expert simply by accumulating thousands of posts, without really being an expert. Everyone has an expertise in a given to[pic that can help even if he/she is a beginner. You were given two solid answers. Based on how frequently your question was asked in the past, which is a lot, the general rule is one, but in some cases one portrait and one landscape is more than enough. as long as anchors are implemented.
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
You keep requesting help only from so called 'Experts'

Relax. Maybe he meant "expert" generally. Even if not: Relax. Keep on with your good work here in the forum!

PS: I'm an "expert", too but lousy creating UI's šŸ˜‚ .

Back to topic:

As most phones have "the same size", it got less important to have different variants or so. In the past we had 4Ā² upt to 6/7Ā² phones which. More important for tablets: Here you have more "space" and can add more stuff/views. At the end it's up to the developer to create nice UI's.
 
Upvote 0

Nitin Joshi

Active Member
Licensed User
I have created my design in 2 variants, 320 x 480, scale=1 (160dpi) and 480 x 320, scale=1 (160dpi). I have used anchors but i am not satisfied with the result especially when there are more controls.
I have created below code and i believe assured that placement of controls unified for any device. Unfortunately, i am not getting expected result. Can anyone help in below code? I will be very thankful.

Calling sub to arrange controls:
Sub Arrange_Me ()
    Dim scaleX, scaleY As Double
    If Activity.Height>Activity.Width Then
        scaleX=(Activity.Width/320)/Density
        scaleY=(Activity.Height/480)/Density
    Else
        scaleX=(Activity.Width/480)/Density
        scaleY=(Activity.Height/320)/Density
    End If
    For Each setMe As View In Activity.GetAllViewsRecursive
        setMe.Left=setMe.Left*scaleX
        setMe.Top=setMe.Top*scaleY
        setMe.Width=setMe.Width*scaleX
        setMe.Height=setMe.Height*scaleY
    Next
End Sub
 
Upvote 0
Top