-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(android): override user interface style #14113
base: master
Are you sure you want to change the base?
fix(android): override user interface style #14113
Conversation
The last changes make the app restart correctly now 👍 Which makes me wonder: are the other changes needed at all? Do we need a default At some point we'll need to find the source why it is behaving like this after 4-5 clicks but at least it will show the app again. Would love to have some community members to test this as there are some |
I'll explain why it's happening when I get on my laptop |
@m1ga titanium-sdk/android/titanium/src/java/org/appcelerator/titanium/TiRootActivity.java Line 171 in abbd387
At some point while clicking, the activity gets duplicated, which is the root activity of the app, when going inside this condition, we lose the state of the activity. |
@m1ga Here's what's happening. I assumed that since you keep clicking on the button and internally the activity is being recreated which in turn starts the while life cycle of the activity which is the root activity, at some point, the root activity gets duplicated. which leads us to the following titanium-sdk/android/titanium/src/java/org/appcelerator/titanium/TiRootActivity.java Lines 154 to 174 in 50d8604
if you go over the comments, you'll see at the very last line before calling See below: titanium-sdk/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java Lines 685 to 696 in 50d8604
By bypassing the We ara stepping over this as well titanium-sdk/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java Lines 722 to 725 in 50d8604
And I believe many other things that would cause the window/activity to lose it's state. I don't know if all of this makes since to you!, let me know |
@m1ga any updates on this one? |
@AbdullahFaqeir as mentioned on Slack: I'll take a look at it again at the weekend. And I think we should just use the one line from the last commit as that was fixing the issue, not the other default parts. But I'll test all at the weekend again and give more feedback |
Ok, I'll tested it again and I think we can reduce this PR to just one line: fixes the issue already. That would reduces the possible site effects as we don't change the XML or anything else in the BaseActivity besides the part inside the if condition (which is only triggered when you change the interface style) |
@m1ga |
I saw that but it didn't go into that method so it wasn't needed there in my tests. It was only needed in the one place. |
@m1ga it would in other cases, I'm not only fixing your case, I'm doing something to handle all cases in a proper way. |
I totally understand that 👍 Just want to make sure that the setTheme parts or the default transition will not introduce any change will make a default app behave different with 12.6.0 compared to 12.5.0.GA. E.g. in the onCreate you set The |
Fixes an unexpected behaviour when trying to change the dark/light mode multiple times which causes the screen to go blank and made the change between both animated.