jaredrummler / Cyanea

A theme engine for Android
Apache License 2.0
1.45k stars 144 forks source link

How to set the navigationBar color setted together with the default cyaned app colors for the app first run? #52

Closed jrcacd closed 5 years ago

gianccm commented 5 years ago

You can set the navigation bar color as soon as the launcher Activity (e.g. MainActivity) is opened. Place this code under onCreate:

@Override protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        getCyanea().edit().shouldTintNavBar(true);
        ...

    }

Don't forget to add the public method for getCyanea() to work. Place it in the same Activity:

@NotNull
    @Override
    public Cyanea getCyanea() {
        return super.getCyanea();
    }

This is Java code, by the way.

jrcacd commented 5 years ago

Ok, thanks

jaredrummler commented 5 years ago

The best way to do this is to create bools.xml and add the following value:

<bool name="should_tint_nav_bar">true</bool>
jrcacd commented 5 years ago

Ok, thanks