You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

org.jraf:android-wear-color-picker

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

org.jraf:android-wear-color-picker

A color picker activity optimized for Wear OS (aka Android Wear). Handy for watch face settings.


Version published
Maintainers
1

Readme

Source

Android Arsenal

Wear OS Color Picker

A color picker activity optimized for Wear OS (formerly known as Android Wear). Handy for watch face settings.

The UI presents a wheel of colors with different hues and lightness.

Demo

How to use

Adding the library to your project

The artifact is available on Maven Central.

dependencies {
    implementation("org.jraf:android-wear-color-picker:3.0.0")
}

Note: the artifact was hosted on JCenter in the past, but is now on Maven Central since v2.2.4

Use the library

The picker uses the ActivityResultContract API to be launched and to return the picked color:

// 1. Setup the pick launcher
val colorPickLauncher = registerForActivityResult(ColorPickActivity.Contract()) { pickedColorResult ->
    if (pickedColorResult == null) {
        // The user closed the picker without picking anything
    } else {
        // Get the picked color. The result is an Int in the form 0xAARRGGBB.
        pickedColor = pickedColorResult.pickedColor
    }
}

// ...

// 2. Launch the picker. The picked color parameter is optional - if specified, the picker will start already positioned on that color.
colorPickLauncher.launch(ColorPickActivity.Contract.PickRequest(pickedColor))

You can also have a look at the sample.

That's it!

License

Copyright (C) 2015-present Benoit 'BoD' Lubek (BoD@JRAF.org)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

FAQs

Package last updated on 21 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc