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

Handle when header color is White #13

Open
Sampath-Lokuge opened this issue Jun 26, 2017 · 2 comments
Open

Handle when header color is White #13

Sampath-Lokuge opened this issue Jun 26, 2017 · 2 comments

Comments

@Sampath-Lokuge
Copy link

Hi,
This is really nice work.Thanks for the project.
I have 2 questions:

  1. How can I handle when header color is White? Because text color is also white, we cannot see the items in the status bar.

  2. Can we use your option for Android and native status bar plugin for iOS devices on the same project?

@jeneser
Copy link
Owner

jeneser commented Jun 28, 2017

How can I handle when header color is White? Because text color is also white, we cannot see the items in the status bar.

Android 5.0, We are able to change only status bar color not status bar text color. Android Lollipop Set Status Bar Text Color
If you use API 23, There's a solution here. API 23 status bar color is White
I'm not sure. Can it work perfectly in ionic? I can't give a solution to you. I need to know more and do more testing. If you find the solution, I'm happy to accept a pull request.

Can we use your option for Android and native status bar plugin for iOS devices on the same project?

Of course.
I can answer your question now. A pr merged: Platform separately: Each platform does not affect each other.
I did some work to make all the code only act on android platform. The code is harmless!
E.g:

// src/app/app.component.ts
if (this.platform.is('android')) {
	this.statusBar.backgroundColorByHexString("#33000000");
}
/* src/app/app.scss */
.platform-android {
  page-home, page-language-details {
    @extend %super-bar;
  }
}

I use this.platform.is('android') and .platform-android selector to get information about current device. So that the code only acts on android device. More information, please check the source code.
Are you satisfied with these answers?😀

@Sampath-Lokuge
Copy link
Author

Thanks a lot @jeneser
I'll try to implement your solution later today and will let you know if I'll have any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants