Skip to content

Commit

Permalink
Merge pull request #4 from vadiole/develop
Browse files Browse the repository at this point in the history
Release 1.0.3
  • Loading branch information
vadiole authored Dec 19, 2022
2 parents ad6b870 + 7e849af commit c2026d1
Show file tree
Hide file tree
Showing 38 changed files with 380 additions and 564 deletions.
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea
.DS_Store
/build
/captures
Expand Down
70 changes: 38 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,63 @@
[![maven central](https://img.shields.io/maven-central/v/io.github.vadiole/colorpicker?color=236dc22&labelColor=424242)](https://search.maven.org/artifact/io.github.vadiole/colorpicker/1.0.2/aar)
[![maven central](https://img.shields.io/maven-central/v/io.github.vadiole/colorpicker?color=236dc22&labelColor=424242)](https://search.maven.org/artifact/io.github.vadiole/colorpicker/1.0.3/aar)

# Color Picker — beautiful library for Android

<img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/1_l.png" alt="screenshot 1" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/2_l.png" alt="screenshot 2" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/1_d.png" alt="screenshot 3" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/2_d.png" alt="screenshot 4" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/3_l.png" alt="screenshot 5" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/4_l.png" alt="screenshot 6" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/3_d.png" alt="screenshot 7" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/4_d.png" alt="screenshot 8" width="25%" height="25%">

### Features
- Simple dialog builder
- ARGB, RGB & HSV color models
- Dark theme support
- Sliders with gradient background
- Switch color models in runtime

- Simple dialog builder
- RGB & HSV color models, with optional alpha channel
- Dark theme support
- Sliders with gradient background
- Switch color models in runtime

### Download

### Setup
Kotlin DSL:
```kotlin
implementation("io.github.vadiole:colorpicker:1.0.3")
```

Groove:
```gradle
dependencies {
implementation 'io.github.vadiole:colorpicker:1.0.2'
}
implementation 'io.github.vadiole:colorpicker:1.0.3'
```

### Usage

```kotlin

// create dialog
// Create dialog
val colorPicker: ColorPickerDialog = ColorPickerDialog.Builder()

// set initial (default) color
.setInitialColor(currentColor)
// Set initial (default) color
.setInitialColor(currentColor)

// Set Color Model, can be ARGB, RGB, AHSV or HSV
.setColorModel(ColorModel.HSV)

// set Color Model. ARGB, RGB or HSV
.setColorModel(ColorModel.HSV)
// Set is user be able to switch color model
.setColorModelSwitchEnabled(true)

// set is user be able to switch color model
.setColorModelSwitchEnabled(true)
// Set your localized string resource for OK button
.setButtonOkText(android.R.string.ok)

// set your localized string resource for OK button
.setButtonOkText(android.R.string.ok)
// Set your localized string resource for Cancel button
.setButtonCancelText(android.R.string.cancel)

// set your localized string resource for Cancel button
.setButtonCancelText(android.R.string.cancel)
// Callback for picked color (required)
.onColorSelected { color: Int ->
// Use color
}

// callback for picked color (required)
.onColorSelected { color: Int ->
// use color
}
// Create dialog
.create()

// create dialog
.create()


// show dialog from Activity
colorPicker.show(supportFragmentManager, "color_picker")
// Show dialog from Activity
colorPicker.show(supportFragmentManager, "color_picker")

// show dialog from Fragment
// Show dialog from Fragment
colorPicker.show(childFragmentManager, "color_picker")
```

Expand Down
17 changes: 8 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.32"
ext.verName = "1.0.3"

repositories {
google()
jcenter()
gradlePluginPortal()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:7.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20"
}
}

allprojects {
repositories {
google()
jcenter()
gradlePluginPortal()
mavenCentral()
}
}

Expand Down
1 change: 1 addition & 0 deletions colorpicker/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
secring.gpg
53 changes: 26 additions & 27 deletions colorpicker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,48 @@ plugins {
id 'kotlin-android'
}

ext {
PUBLISH_GROUP_ID = 'io.github.vadiole'
PUBLISH_VERSION = '1.0.2'
PUBLISH_ARTIFACT_ID = 'colorpicker'
}

apply from: "${rootProject.projectDir}/scripts/publish-mavencentral.gradle"


android {
compileSdkVersion 30
buildToolsVersion "30.0.3"

sourceSets {
main.res.srcDirs 'res', 'res-public'
}
compileSdkVersion 33

defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0.2"

consumerProguardFiles "consumer-rules.pro"
targetSdkVersion 33
}


buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

sourceSets {
main.res.srcDirs 'res', 'res-public'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
kotlinOptions {
jvmTarget = '11'
}
}
kotlinOptions {
jvmTarget = '1.8'

publishing {
singleVariant("release") {
withSourcesJar()
}
}
}

dependencies {
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
}

ext {
PUBLISH_GROUP_ID = 'io.github.vadiole'
PUBLISH_ARTIFACT_ID = 'colorpicker'
PUBLISH_VERSION = '1.0.3'
}

apply from: "${rootProject.projectDir}/scripts/publish-mavencentral.gradle"
Empty file removed colorpicker/consumer-rules.pro
Empty file.
21 changes: 0 additions & 21 deletions colorpicker/proguard-rules.pro

This file was deleted.

4 changes: 1 addition & 3 deletions colorpicker/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="vadiole.colorpicker">

</manifest>
<manifest package="vadiole.colorpicker" />
Loading

0 comments on commit c2026d1

Please sign in to comment.