Skip to content
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

feat(android): no_limits layout #11911

Closed
wants to merge 3 commits into from
Closed

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Aug 15, 2020

JIRA: https://jira.appcelerator.org/browse/AC-6589

Optional Description:

Make the statusbar background fully transparent but still show it (instead of going fullscreen)

left window:

"Window" : {
	extendSafeArea: true
}

right window:

"Window" : {
	extendSafeArea: true,
	noLimits: true
}

@build
Copy link
Contributor

build commented Aug 15, 2020

Fails
🚫

🔬 There are library changes, but no changes to the unit tests. That's OK as long as you're refactoring existing code, but will require an admin to merge this PR. Please see README.md#unit-tests for docs on unit testing.

🚫 Tests have failed, see below for more information.
Warnings
⚠️ This PR has milestone set to 9.3.0, but the version defined in package.json is 9.2.0 Please either: - Update the milestone on the PR - Update the version in package.json - Hold the PR to be merged later after a release and version bump on this branch
⚠️

Commit 5989a607c4dc8adee1d2d888e5427de4d52b055d has a message "docs" giving 2 errors:

  • subject may not be empty
  • type may not be empty
⚠️

Commit 0905a1b331f48de99b7cf9921ba78eae1cc4b171 has a message "text updates" giving 2 errors:

  • subject may not be empty
  • type may not be empty
Messages
📖

💾 Here's the generated SDK zipfile.

📖 🎉 Another contribution from our awesome community member, m1ga! Thanks again for helping us make Titanium SDK better. 👍
📖

🚨 This PR has one or more commits with warnings/errors for commit messages not matching our configuration. You may want to squash merge this PR and edit the message to match our conventions, or ask the original developer to modify their history.

📖 ❌ 8 tests have failed There are 8 tests failing and 711 skipped out of 8086 total tests.

Tests:

ClassnameNameTimeError
ios.ipad.Titanium.Media.AudioPlayer#start, #stop (14.0)25.025
Error: timeout of 5000ms exceeded
file:///Users/build/Library/Developer/CoreSimulator/Devices/0035AEF4-D58B-4282-9C16-4D3301CDDBFC/data/Containers/Bundle/Application/B9B760DB-3A68-4EB1-A892-F58703CE56CA/mocha.app/ti-mocha.js:4326:27
ios.ipad.Titanium.UI.WebViewprogress event (14.0)10
Error: timeout of 10000ms exceeded
file:///Users/build/Library/Developer/CoreSimulator/Devices/0035AEF4-D58B-4282-9C16-4D3301CDDBFC/data/Containers/Bundle/Application/B9B760DB-3A68-4EB1-A892-F58703CE56CA/mocha.app/ti-mocha.js:4290:32
ios.ipad.Titanium.UI.WebViewhtml-script-tag (14.0)10.002
Error: timeout of 10000ms exceeded
file:///Users/build/Library/Developer/CoreSimulator/Devices/0035AEF4-D58B-4282-9C16-4D3301CDDBFC/data/Containers/Bundle/Application/B9B760DB-3A68-4EB1-A892-F58703CE56CA/mocha.app/ti-mocha.js:4290:32
ios.ipad.Titanium.UI.WebView.zoomLevel (14.0)10
Error: timeout of 10000ms exceeded
file:///Users/build/Library/Developer/CoreSimulator/Devices/0035AEF4-D58B-4282-9C16-4D3301CDDBFC/data/Containers/Bundle/Application/B9B760DB-3A68-4EB1-A892-F58703CE56CA/mocha.app/ti-mocha.js:4290:32
ios.iphone.Titanium.Media.AudioPlayer#start, #stop (14.0)25.031
Error: timeout of 5000ms exceeded
file:///Users/build/Library/Developer/CoreSimulator/Devices/B98CCEEE-6478-4929-BE6A-C6DB04CAF126/data/Containers/Bundle/Application/73F82AD4-69C3-4578-8E6D-5CB7350A50F3/mocha.app/ti-mocha.js:4326:27
ios.iphone.Titanium.UI.WebViewprogress event (14.0)10.002
Error: timeout of 10000ms exceeded
file:///Users/build/Library/Developer/CoreSimulator/Devices/B98CCEEE-6478-4929-BE6A-C6DB04CAF126/data/Containers/Bundle/Application/73F82AD4-69C3-4578-8E6D-5CB7350A50F3/mocha.app/ti-mocha.js:4290:32
ios.iphone.Titanium.UI.WebViewhtml-script-tag (14.0)10.002
Error: timeout of 10000ms exceeded
file:///Users/build/Library/Developer/CoreSimulator/Devices/B98CCEEE-6478-4929-BE6A-C6DB04CAF126/data/Containers/Bundle/Application/73F82AD4-69C3-4578-8E6D-5CB7350A50F3/mocha.app/ti-mocha.js:4290:32
ios.iphone.Titanium.UI.WebView.zoomLevel (14.0)10.001
Error: timeout of 10000ms exceeded
file:///Users/build/Library/Developer/CoreSimulator/Devices/B98CCEEE-6478-4929-BE6A-C6DB04CAF126/data/Containers/Bundle/Application/73F82AD4-69C3-4578-8E6D-5CB7350A50F3/mocha.app/ti-mocha.js:4290:32

Generated by 🚫 dangerJS against 0905a1b

apidoc/Titanium/UI/Window.yml Outdated Show resolved Hide resolved
apidoc/Titanium/UI/Window.yml Outdated Show resolved Hide resolved
@sgtcoolguy sgtcoolguy modified the milestones: 9.2.0, 9.3.0 Aug 17, 2020
@sgtcoolguy
Copy link
Contributor

@garymathews Can you please give CR? LGTM, but you or Josh should verify as well. Also, we'll need to re-target this to 9_3_X since master/9.2.0 is iOS only right now.

@jquick-axway jquick-axway self-requested a review August 31, 2020 21:35
@jquick-axway
Copy link
Contributor

jquick-axway commented Sep 1, 2020

@m1ga , I disagree with this change.

You're making a bad assumption that FLAG_LAYOUT_NO_LIMITS will make the top status bar and bottom navigation bar transparent. This is undocumented. While this appears to be true between Android 5.0 - 10.0 in the emulator, it's not true in the Android 4.4 emulator (the status bar is completely opaque) and this flag is ignored on Android 11 (I tested this in the emulator and a real device). Also, we shouldn't assume 3rd party devices will make the status bar transparent either.

The FLAG_LAYOUT_NO_LIMITS comes with other trade-offs that developers might not want as well. It breaks our "safeAreaPadding" feature, preventing us from detecting system insets anymore like status bar height. It also breaks virtual keyboard "adjustPan" support.

Side Note: You can already set this flag "today" by doing the following...

const FLAG_LAYOUT_NO_LIMITS = 512;
const window = Ti.UI.createWindow({
	extendSafeArea: true,
	theme: "Theme.AppCompat.NoTitleBar",
	windowFlags: FLAG_LAYOUT_NO_LIMITS,
});

The BEST solution that you can do today is to use a theme that sets the status bar transparent.

Alternately, we can add an API that allows the developer to set that status bar color via the Java Window.setStatusBarColor() method. This Java method does allow you to set it transparent. We also get to keep our "safeAreaPadding" feature so that you can correctly detect inset height of the status bar. Note that this Java method is API Level 21 (aka: Android 5.0). I think this approach is probably the most convenient to use.

Edit:
I'm okay with us adding a new Ti.UI.Android.FLAG_LAYOUT_NO_LIMITS constant, but we shouldn't document that it makes the status bar transparent. If that's the goal, then a new statusBarColor property would be better.

@m1ga
Copy link
Contributor Author

m1ga commented Sep 1, 2020

@jquick-axway oh wow! Thanks for having such a detailed look at it. Didn't know that it is different on all platforms. I'll check that again

@sgtcoolguy sgtcoolguy changed the title feat (android): no_limits layout feat(android): no_limits layout Sep 4, 2020
@sgtcoolguy sgtcoolguy marked this pull request as draft November 2, 2020 20:14
@sgtcoolguy sgtcoolguy modified the milestones: 9.3.0, 10.0.0 Nov 20, 2020
@jquick-axway
Copy link
Contributor

@m1ga , if you don't mind, I'm going to close this PR in favor of PR #12809 which implements this via a "windowFlags" constant.

@m1ga m1ga deleted the layoutNoLimits branch September 16, 2022 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants