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): statusBarColor for Window #14089

Merged
merged 5 commits into from
Sep 13, 2024
Merged

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Jul 27, 2024

Android:
Add statusBarColor property to change the statusBar color using code

var win = Ti.UI.createWindow({
	statusBarColor:"#0f0"
});
setTimeout(function(){
	win.statusBarColor = "#f00";
},2000)

win.open();

Test:
run the code: status bar is green and after one second it's red

Current workaround
either use a normal Android theme and set it there or Hyperloop

import Activity from 'android.app.Activity';
import Color from 'android.graphics.Color';

var win = Ti.UI.createWindow();
win.addEventListener("open", function(){
	const activity = new Activity(win.activity);
	setInterval(function(){
		activity.getWindow().setStatusBarColor(Color.argb(Math.floor(Math.random()*255), Math.floor(Math.random()*255), Math.floor(Math.random()*255), 0));
	}, 500)
})
win.open();

Copy link
Contributor

@cb1kenobi cb1kenobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works!

@cb1kenobi cb1kenobi merged commit 78bf085 into master Sep 13, 2024
7 checks passed
@cb1kenobi cb1kenobi deleted the androidStatusBarColor branch September 13, 2024 22:33
hansemannn pushed a commit that referenced this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants