Code Monkey home page Code Monkey logo

Comments (8)

gliechtenstein avatar gliechtenstein commented on June 24, 2024

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.

danieleorlando avatar danieleorlando commented on June 24, 2024

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.

realitix avatar realitix commented on June 24, 2024

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.

gliechtenstein avatar gliechtenstein commented on June 24, 2024

@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:

  1. UIStatusBarStyleLightContent: white text with transparent background
  2. UIStatusBarStyleDefault: black text with transparent background

uistatusbarstyle

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.

maks avatar maks commented on June 24, 2024

Tricky to keep it x-platform. Perhaps allow any colour on android and on iOS ignore if not 000 or fff ?

from jasonette-android.

danieleorlando avatar danieleorlando commented on June 24, 2024

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.

maks avatar maks commented on June 24, 2024

@danieleorlando sorry I don't follow what you mean about the colours?

from jasonette-android.

danieleorlando avatar danieleorlando commented on June 24, 2024

@maks

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.