Skip to content

Latest commit

 

History

History
104 lines (78 loc) · 3.28 KB

README.md

File metadata and controls

104 lines (78 loc) · 3.28 KB

color chooser

license GitHub release GitHub issues GitHub closed issues Maven Central

ScreenShots

How to use

jCenter will close in May. In 0.2.4 moved to mavenCentral from jcenter.
Please note that the groupID has changed

Download from mavenCentral.
latest version: Maven Central

repositories {
    jcenter()
}
dependencies {
    implementation 'net.mm2d.color-chooser:color-chooser:<version>'
}

Versions below 0.2.4 were distributed with jCenter. However, jCenter will close and old versions are not migrated to mavenCentral. If you need an older version, please use the Github Pages repository.

repositories {
    maven { url = URI("https://ohmae.github.com/maven") }
}
dependencies {
    implementation 'net.mm2d:color-chooser:<version>'
}

Register the listener to receive the result. Write the following process in onViewCreated of Fragment or onCreate of Activity.

ColorChooserDialog.registerListener(REQUEST_KEY, this) {
    // it is selected color as @ColorInt
}

To show dialog. On FragmentActivity or Fragment

ColorChooserDialog.show(
    this,         // Fragment or FragmentActivity
    REQUEST_KEY,  // request key for receive result
    initialColor, // initial color, optional, default #FFFFFF
    true,         // need for alpha, optional, default false
    TAB_RGB       // initial tab, TAB_PALETTE/TAB_HSV/TAB_RGB, optional, default  TAB_PALETTE
)

The style of implementing a callback interface in Activity and Fragment has been deprecated.

Please see Sample code for detail.

API Document

Dependent OSS

color-chooser

  • Kotlin
  • Android Jetpack
    • androidx.appcompat:appcompat
    • androidx.constraintlayout:constraintlayout
    • androidx.core:core-ktx
    • com.google.android.material:material

sample app

  • Kotlin
  • Android Jetpack
    • androidx.appcompat:appcompat
    • androidx.constraintlayout:constraintlayout
    • androidx.navigation:navigation-fragment-ktx
    • androidx.navigation:navigation-ui-ktx
    • com.google.android.material:material
  • LeakCanary

Author

大前 良介 (OHMAE Ryosuke) http://www.mm2d.net/

License

MIT License