SystemUiController - Android Ui color controller (status bar, navigation bar)

Overview

SystemUiController

Android system ui color controller (status bar, navigation bar)

Download

implementation "land.sungbin:systemuicontroller:${version}"

Usage

extensions

Activity.setStatusBarColor(@ColorInt color: Int, darkIcons: Boolean = false) // set color only status bar
Activity.setNavigationBarColor(@ColorInt color: Int, darkIcons: Boolean = false) // set color only navigation bar
Activity.setSystemBarsColor(@ColorInt color: Int, darkIcons: Boolean = false) // set color both statur bar and navigation bar

this extentions can be used for Fragment as well as Activity.

instance

Or, you can use an instance of SystemUiController directly.

class SystemUiController(private val window: Window) {
   setStatusBarColor(@ColorInt color: Int, darkIcons: Boolean = false)
   setNavigationBarColor(@ColorInt color: Int, darkIcons: Boolean = false)
   setSystemBarsColor(@ColorInt color: Int, darkIcons: Boolean = false)
}

Happy Coding :)

You might also like...
SmileyRating is a simple rating bar for android. It displays animated smileys as rating icon.
SmileyRating is a simple rating bar for android. It displays animated smileys as rating icon.

Smiley Rating SmileyRating is a simple rating bar for android. It displays animated smileys as rating icon. Drawn completely using android canvas Insp

A swipe button for Android with a circular progress bar for async operations
A swipe button for Android with a circular progress bar for async operations

ProSwipeButton A swipe button for Android with a circular progress bar for async operations Gradle dependencies { ... compile 'in.shadowfax:pr

An Index Side Bar With Wave Effect
An Index Side Bar With Wave Effect

WaveSideBar You can use WaveSideBar in the contacts page of your application. Refer to AlexLiuSheng/AnimSideBar. Screenshot Include the WaveSideBar to

🪄 It's a library that helps you customize your notification bar
🪄 It's a library that helps you customize your notification bar

NotificationBarCustom 🪄 It's a library that helps you customize your notification bar Demo Contrast(white) Contrast(black) Transparent Setup Add it i

MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team
MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team

MIUI 原生通知图标 Fix the native notification bar icon function abandoned by the MIUI

A skeleton of google's appcompat android navigation drawer with material design.
A skeleton of google's appcompat android navigation drawer with material design.

Lollipop AppCompat Skeleton A skeleton of google's appcompat android navigation drawer with material design. Compatible to work on 4.0+ Based on Googl

Create an header for com.google.android.material.navigation.NavigationView
Create an header for com.google.android.material.navigation.NavigationView

Header View This is a view for NavigationView in android.support.design library Import At the moment the library is in my personal maven repo reposito

(Deprecated) A custom view component that mimics the new Material Design Bottom Navigation pattern.
(Deprecated) A custom view component that mimics the new Material Design Bottom Navigation pattern.

BottomBar (Deprecated) I don't have time to maintain this anymore. I basically wrote the whole library in a rush, without tests, while being a serious

Simple and lightweight UI library for user new experience, combining floating bottom navigation and bottom sheet behaviour. Simple and beautiful.
Simple and lightweight UI library for user new experience, combining floating bottom navigation and bottom sheet behaviour. Simple and beautiful.

Simple and lightweight UI library for user new experience, combining floating bottom navigation and bottom sheet behaviour. Simple and beautiful.

Comments
  • Request feature: auto detect color is darkness

    Request feature: auto detect color is darkness

    It might be useful to detect how dark a color is to set icons to dark or light mode.

    In Kotlin using extension function on Int type and with a darkness threshold parameter it can look like the following:

    /**
     * Determines if this color is dark.
     * @param threshold - min darkness value; the higher the value, the darker the color;
     * float value between 0.0 and 1.0.
     */
    fun Int.isColorDark(@FloatRange(from = 0.0, to = 1.0) threshold: Float = 0.9f): Boolean {
        val darkness = 1 - (Color.red(this) * 0.299 + Color.green(this) * 0.587 + Color.blue(this) * 0.114) / 255
        return darkness >= threshold
    }
    
    opened by webserveis 1
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • gradle.properties (gradle)
    • settings.gradle (gradle)
    • build.gradle (gradle)
    • app/build.gradle (gradle)
    • scripts/publish-module.gradle (gradle)
    • scripts/publish-root.gradle (gradle)
    • systemuicontroller/build.gradle (gradle)
    • gradle/wrapper/gradle-wrapper.properties (gradle-wrapper)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    With your current configuration, Renovate will create 6 Pull Requests:

    Update dependency androidx.appcompat:appcompat to v1.5.1
    • Schedule: ["at any time"]
    • Branch name: renovate/androidx.appcompat-appcompat-1.x
    • Merge into: main
    • Upgrade androidx.appcompat:appcompat to 1.5.1
    Update dependency androidx.core:core-ktx to v1.9.0
    • Schedule: ["at any time"]
    • Branch name: renovate/androidx.core-core-ktx-1.x
    • Merge into: main
    • Upgrade androidx.core:core-ktx to 1.9.0
    Update dependency com.android.tools.build:gradle to v7.3.1
    Update dependency com.google.android.material:material to v1.7.0
    Update dependency gradle to v7.5.1
    • Schedule: ["at any time"]
    • Branch name: renovate/gradle-7.x
    • Merge into: main
    • Upgrade gradle to 7.5.1
    Update dependency org.jetbrains.kotlin:kotlin-gradle-plugin to v1.7.21

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
Releases(1.0.1)
Owner
Ji Sungbin
mobile(both Android and iOS) engineer / 항상 느끼는거지만 너무 초라한 내 깃허브 ㅠ
Ji Sungbin
A util for setting status bar style on Android App.

StatusBarUtil A util for setting status bar style on Android App. It can work above API 19(KitKat 4.4). 中文版点我 Sample Download StatusBarUtil-Demo Chang

Jaeger 8.8k Jan 7, 2023
A color picker and a color preference for use in Android applications.

HSV-Alpha Color Picker for Android This library implements a color picker and a color preference for use in Android applications. Features I couldn't

Martin Stone 279 Nov 26, 2022
WindView is an Android Library to show Weather's Wind & pressure Status

WindView WindView is an Android Library to show Weather's Wind & pressure Status Screenshot Demo demo.apk Setup Step 1: Add it as a Dependency in Your

Ahmad Nemati 209 Nov 18, 2022
Step by step,just use HorizontalStepView,VerticalStepView. step indicator,flow indicator,timeline,order process,express status

StepView Step by step. Step indicator. Flow indicator。 snapshot like this:HorizontalStepView like this also like this:VerticalStepView Yeah,I am not w

baoyachi. Aka Rust Hairy crabs 4.1k Dec 30, 2022
🎨 Android colorpicker for getting colors from any images by tapping on the desired color.

ColorPickerView ?? ColorPickerView implements getting HSV colors, ARGB values, Hex color codes from any image drawables or your gallery pictures by ta

Jaewoong Eum 1.3k Dec 26, 2022
Android view that allows the user to create drawings. Customize settings like color, width or tools. Undo or redo actions. Zoom into DrawView and add a background.

DrawView Android view that allows the user to create drawings. Draw anything you like in your Android device from simple view. Customize draw settings

Oscar Gilberto Medina Cruz 839 Dec 28, 2022
A material Switch with icon animations and color transitions

Material Animated Switch A material Switch with icon animations and color transitions Sample video: Youtube Material Animated Switch video Sample app:

Adrián Lomas 1.2k Dec 29, 2022
Simple View to change Brush Size, Alpha and Color

BrushView Simple View to change Brush Size, Alpha and Color Screenshots How to install In your build.gradle project allprojects { repositories {

Andres Ruiz 16 Jun 28, 2018
A View on which you can freely draw, customizing paint width, alpha and color, and take a screenshot of the content. Useful for note apps, signatures or free hand writing.

FreeDrawView A View that let you draw freely on it. You can customize paint width, alpha and color. Can be useful for notes app, signatures or hands-f

Riccardo Moro 643 Nov 28, 2022
A color picker for Jetpack compose 🎨

Compose Color Picker ?? Color Picker for Jetpack compose A color picker for Jetpack compose ?? Download ?? Working on it ?? Usage ColorPicker { co

mhssn 12 Dec 8, 2022