Screen orientation issue

Good day,

I have issue with screen orientation in my phone.

I am trying to resize a label with the width of the screen. I did it before and it works perfectly but here is the issue. I set the screen orientation in portrait and when the user has disable the option of auto rotate on his phone the resize works good even the phone is in vertical or horizontal position. Now when the user turn on the auto rotate and put the phone horizontal the rezise do it with the width in horizontal way even if I set the screen in portrait. This only happens on my huawei p30 android version 10 because in a samsung j2 the resize works fine in both cases.

I show you my configuration and my blocks to explain the problem:

Use this

bild

Hey bob I could fix the resize problem with your solution but now I have other problem as before when the auto rotation is on and I put the phone in landscape always open in this way even if I set screen in prortrait.

That is the issue and for this I have problem with lottie animation because is crashing. The animation doesnt work property. I have to say that in normal way the lottie animation works perfectly fine.

Its not the problem of DeviceDensity.
Also why are you dividing it by 360?

what do u mean with devide density? I could fix the problem as I said. Now I have problems with lottie animations. 360 is just a standar width for a phone, it can be variable. I just use this because is perfectly according to my phone

It’s a magic number

Either your phone is overwriting the settings you set in screen1, one thing you can try is add a line in manifestfile android:screenOrientation

Btw @Elaprendiz bob is not my name.

@Boban sorry for the wrong name, my bad.

Well it sounds hard to edit the apk, but i will seach and try. :/…

But why happen this? is a kind of bug?? Maybe kodular team can improve this, because in other phones work ok?

1 Like

Try this one

I tried by myself with my own apk and didnt work and I tried with your apk and didnt wokr neither, the same problem happens. The app first open in landscape then in portrait.

The button has to do something?

I am using a huawei p30 on android 10, I dont know if you can try on this phone to replicate the problem.

just use this block