Android Question Device Theme Change Resizes Activity

LWGShane

Well-Known Member
Licensed User
Longtime User
I'm doing a rewrite of my in-house app (B4A via B4XPages) and am trying to implement AppCompat.DayNight. However, I am encountering a weird issue or possible bug where the activity is resized upon changing the device theme. I've attached the project file.

What exactly is going on and is it possible to fix it?
 

Attachments

  • TabletopKeeper.zip
    15.3 KB · Views: 55

walterf25

Expert
Licensed User
Longtime User
Can you give us a little more context, I downloaded your project and only see a dark screen with a menu on the bottom, can you describe the steps to reproduce the issue?
 
Upvote 0

LWGShane

Well-Known Member
Licensed User
Longtime User
Can you give us a little more context, I downloaded your project and only see a dark screen with a menu on the bottom, can you describe the steps to reproduce the issue?

Like I said, change the device theme (Light/Dark Mode) and the Activity will be resized. (You'll notice that the "Made with love in B4X" will be gone after a theme change.)
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Like I said, change the device theme (Light/Dark Mode) and the Activity will be resized. (You'll notice that the "Made with love in B4X" will be gone after a theme change.)
I don't see any issue, works fine here.
 
Upvote 0

LWGShane

Well-Known Member
Licensed User
Longtime User
I've attached some images that detail the problem I'm having on my device (Pixel 8 Pro). It seems that the app is ignoring the navigation bar after a theme change. This only happens during runtime; reloading the app seems to "correct" the problem.

Any ideas as to why this occurs?

Update: I've determined that this is a B4A bug and not a B4XPages bug. (I've attached the non-B4XPages project too.)

 

Attachments

  • ThemeChange.zip
    10.6 KB · Views: 48
Last edited:
Upvote 0

LWGShane

Well-Known Member
Licensed User
Longtime User
As stated in my initial post, upon changing the device theme the activity somehow resizes as seen in my screenshots. It's also not just my app; the bug affects ALL B4A apps, including the B4A Bridge app. (The "Made with Love" view is below the bottom navigation bar after changing the theme.)
 

Attachments

  • Screenshot_20240728-063137.png
    78.1 KB · Views: 51
  • Screenshot_20240728-063142.png
    70.1 KB · Views: 53
  • Screenshot_20240726-091836.png
    27.9 KB · Views: 49
  • Screenshot_20240726-091829.png
    36 KB · Views: 53
Last edited:
Upvote 0

walterf25

Expert
Licensed User
Longtime User
We have asked you to show us exactly what steps you are doing to reproduce the issue, you can't expect help if you are not willing to be more descriptive about the issue, in other words we won't spend our time figuring out how to reproduce the issue, you need to include more clear instructions and details about how exactly to reproduce the issue.
 
Upvote 0

LWGShane

Well-Known Member
Licensed User
Longtime User
I've detailed what I do in numerous posts (changing the device theme from dark to light and vice versa) and have provided screenshots of the issue/bug in multiple B4A apps. If you can't read my posts and view the screenshots then that's a you problem; not a me problem.





I'm not sure how you change the theme, but when the activity is resized it should be destroyed and recreated. I guess that it doesn't happen for some reason and it causes this issue.

If I change the theme via the system settings that's when it happens since the Activity needs to be re-created. Closing and re-opening the app does "correct" this.
If I change the theme programmatically via my "Theme.TMODE" properties then it's fine since there's no need to technically re-create the activity.

I'm always the one to find these weird issues/bugs.

Thank you for the answer
 
Upvote 0

Similar Threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…