Comments (8)
Are you trying to set a different color for the status bar compared to the toolbar? or are they the same color?
The reason I ask is because maybe it's a better idea to just make the statusbar color match the toolbar color, assuming that that's what most people would want.
from jasonette-android.
It's a different color. Cause in Material Design guidelines, status bar has a darker color from toolbar
I added this on JasonViewActivity.java in setup_header function
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { String statusColor = header.getJSONObject("style").getString("status"); getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); getWindow().setStatusBarColor(JasonHelper.parse_color(statusColor)); }
As you can see, I added "status" also on JSON file structure
from jasonette-android.
Hello @gliechtenstein.
I think it's a good idea to let user customize status bar color, it's just a single string.
Do we do it ?
from jasonette-android.
@realitix iOS provides only two options (.default
and .lightcontent
) https://developer.apple.com/documentation/uikit/uistatusbarstyle?language=objc
Basically, there are two modes on iOS:
- UIStatusBarStyleLightContent: white text with transparent background
- UIStatusBarStyleDefault: black text with transparent background
For now we are trying to keep the JSON markup as cross-platform as possible, so one idea I have is do something similar for Android instead of manual color setting. Any better ideas?
from jasonette-android.
Tricky to keep it x-platform. Perhaps allow any colour on android and on iOS ignore if not 000 or fff ?
from jasonette-android.
If you want to keep the JSON markup as cross-platform as possible, the only way is to use material color 700 for the status bar only when the toolbar color is a 500 color
https://material.io/guidelines/style/color.html
from jasonette-android.
@danieleorlando sorry I don't follow what you mean about the colours?
from jasonette-android.
Material design specs:
"A primary color is the color displayed most frequently across your app’s screens and components. It can also be used to accent elements, if you don’t have a secondary color.
To create contrast between elements, you can use lighter or darker tones of your primary color. The contrast between lighter and darker tones helps show division between surfaces, such as between the status bar and a toolbar."
So, primary color (toolbar) is the one on JSON.
If this color is in Material Design Palette (#500), we pick the darker version (#700) and set to status bar.
from jasonette-android.
Related Issues (20)
- IndexOutOfBoundsException Error - App crashes at second load HOT 1
- Security Guidelines
- No example of loading.json HOT 2
- Close Preload only when html in WebView completes rendering
- Ability to detect that WebView failed to load
- POST request with json data HOT 1
- Development moved to https://github.com/jasonelle/jasonelle HOT 8
- Gradle error: 'Could not find lint-gradle-api.jar' HOT 1
- Back button closed app HOT 4
- Jasonette-android build.gradle
- get value of TextField and set it to label as text
- Can't run demo app at Android 4.4.2 device HOT 4
- App only saying Offline... HOT 1
- Web Container to have location access HOT 3
- cookies are not stored
- 64bit Warning when submitting to Google Play store. HOT 4
- Top section of web browser doesn't get taps HOT 3
- web container not downloading pdf file
- Filter items through Menu-Search
- Link
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jasonette-android.