Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements and changes #6

Open
wants to merge 53 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1a6c311
Preparing for jitpack
alexandre-g Mar 15, 2017
5387bfe
Adding 'no color' button
alexandre-g Mar 15, 2017
497d0ae
No-color button fix and layout tweaks
alexandre-g Mar 15, 2017
7307c2a
Merge branch 'master' of https://github.com/AzeeSoft/AndroidPhotoshop…
vlad-roid Sep 30, 2019
c340794
Fixed crashes in BitmapsGenerator
vlad-roid Sep 30, 2019
2f2515f
Fixed Context memory leaks in all picker classes
vlad-roid Sep 30, 2019
3cfdeb8
Code formatting and refactoring
vlad-roid Sep 30, 2019
52f466d
Gradle wrapper 3.3 -> 5.4.1; Gradle build tools 2.2.0 -> 3.5.0; Maven…
vlad-roid Sep 30, 2019
c1fbee8
Migrated from legacy support library to AndroidX; Fixed "dialod"
vlad-roid Sep 30, 2019
f5bcfab
Removed application declaration from manifest to prevent transitive c…
vlad-roid Sep 30, 2019
9050055
Updated .gitignore
vlad-roid Sep 30, 2019
88261ad
Library version 1.1.2 -> 1.2.0
vlad-roid Sep 30, 2019
85536bc
Update README.md
vlad-roid Sep 30, 2019
b728deb
Update README.md
vlad-roid Sep 30, 2019
4be7d9c
No color option tweaks
vlad-roid Oct 9, 2019
2eb3225
renamed dialog_root -> dialog_color_picker_root as a precaution so us…
vlad-roid Oct 9, 2019
a67842c
Gradle build tools 3.5.0 -> 3.5.1
vlad-roid Oct 9, 2019
e18828b
Revert commit "Preparing for jitpack" and set version to 1.1.0
vlad-roid Oct 9, 2019
f953e05
Added showing "no color" option via style/theme
vlad-roid Oct 9, 2019
cfb3748
Reverted readme changes for pull request
vlad-roid Oct 9, 2019
24bda9c
Update README.md
vlad-roid Oct 9, 2019
18b2a7b
Merge remote-tracking branch 'origin/master' into improvements
vlad-roid Oct 9, 2019
e0fccb2
Fixed Android 4.0 incompatibility (introduced in this fork)
vlad-roid Oct 9, 2019
a8708ff
Renamed onBitmapGenerationFailedListener -> onBitmapGenerationFailed
vlad-roid Oct 9, 2019
5c455f6
Added onBitmapGenerationFailedListener handling to ColorPickerDialog,…
vlad-roid Oct 9, 2019
f4aaf0a
Android Studio standard formatting
vlad-roid Oct 9, 2019
94e17f4
Removed redundant AppTheme styles
vlad-roid Oct 9, 2019
123957e
Merge branch 'master' into improvements
vlad-roid Oct 9, 2019
f71b076
Gradle build tools 3.5.1 -> 3.6.0
vlad-roid Feb 28, 2020
ac0936e
Android build tools 29.0.2 -> 29.0.3
vlad-roid Feb 28, 2020
0d30fb7
Renamed OrientedSeekBar orientation attr to cp_orientation to avoid c…
vlad-roid Feb 28, 2020
d0ac5ef
Gradlew wrapper 5.4.1 -> 6.2.1
vlad-roid Feb 28, 2020
d0d3c24
Added android.useAndroidX=true
vlad-roid Feb 28, 2020
624bdaa
Library version 1.2.0 -> 1.2.1
vlad-roid Feb 28, 2020
2e2f440
Merge branch 'master' into improvements
vlad-roid Feb 28, 2020
e69aa8a
Update README.md
vlad-roid Feb 28, 2020
40d08fd
Update README.md
vlad-roid Feb 28, 2020
70465d4
Library version 1.2.1 -> 1.2.2
vlad-roid Feb 28, 2020
136a682
Merge remote-tracking branch 'origin/master'
vlad-roid Feb 28, 2020
02dd5c1
Update README.md
vlad-roid Feb 28, 2020
896735a
Gradle build tools 3.6.0 -> 3.6.1
vlad-roid Mar 2, 2020
86c7f7b
Moved mipmap-xxxhdpi to mipmap
vlad-roid Mar 2, 2020
6413c45
Changed pressed state of SatValPicker to accent color
vlad-roid Mar 2, 2020
1eda188
Library version 1.2.2 -> 1.2.3
vlad-roid Mar 2, 2020
fa62968
Update README.md
vlad-roid Mar 2, 2020
bf1ca68
Merge remote-tracking branch 'origin/master'
vlad-roid Mar 2, 2020
8c392df
Merge branch 'master' into improvements
vlad-roid Mar 2, 2020
2daa493
Fix for commit: Renamed OrientedSeekBar orientation attr to cp_orient…
vlad-roid Mar 2, 2020
d460045
Fix for commit: Renamed OrientedSeekBar orientation attr to cp_orient…
vlad-roid Mar 2, 2020
998d2d7
Library version 1.2.3 -> 1.2.4
vlad-roid Mar 2, 2020
bb93ae3
Update README.md
vlad-roid Mar 2, 2020
acfd8bf
Merge branch 'master' into improvements
vlad-roid Mar 2, 2020
8a300be
Merge branch 'master' into improvements
vlad-roid Mar 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/build
.idea/
.gradle/
local.properties
*.iml
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,34 @@

A full featured Color picker Library for Android! Just like the one in Photoshop!

# Differences from original repository

* Posted on jitpack.io instead of jcenter
* Added a "no color" option (transparent color value)
* Original bitmap generation was prone to crashes, which are instead caught in this fork's source code
* Original HuePicker, OpacityPicker and SatValPicker have memory leaks, which are fixed in this fork's code
* For the above changes, HuePicker provides the method `setBitmapGenerationFailedListener` which listens for bitmap generation failure; ColorPickerDialog uses this listener to automatically reattempt reloading the bitmap every second while the dialog is still showing
* Migrated from legacy support library to AndroidX AppCompat v1.1.0, leaving inflation of the correct Button classes to the implementations of this library
* Changed pressed state of SatValPicker to accent color

Other internal changes:
* Library updates: Gradle wrapper 3.3 -> 6.2.1; Gradle build tools 2.2.0 -> 3.6.1; Maven gradle plugin 1.5 -> 2.0; Compile/Target Android SDK level 25 -> 29; Min Android SDK level 11 -> 14; Android build tools 23.0.3 -> 29.0.3
* Switched from deprecated `compile` to `api` in build.gradle
* Fixed spelling mistake `dialod_edit_color_root.xml`
* Removed application declaration from manifest to prevent transitive changes
* Added missing items to .gitignore
* Standard Android Studio source code formatting
* Minor refactoring inside `onInterceptTouchEvent` of ScrollViews
* Removed redundant `minSizePx` variable from HuePicker and OpacityPicker
* Moved content from mipmap-xxxhdpi folder to mipmap to avoid related crashes
* Renamed OrientedSeekBar `orientation` attribute to `cp_orientation` to avoid conflicts with `androidx.gridlayout` library

# Features

* Hue bar - Adjust hue using a slider
* Saturation & Value Box - Select the color from the Saturation & Value Box (like in Photoshop)
* Alpha bar - Adjust the alpha using a slider
* "No color" option - Hidden by default, sets transparent color value
* Preview - You can see the current selected and previously picked colors side-by-side
* Edit each component individually - You can edit Hue, Saturation, Value, Red, Green and Blue components individually
* Fully customizable - By default, there are two themes(Light and Dark). But you can define your own theme to customize the whole ColorPicker
Expand All @@ -28,7 +51,7 @@ The library is posted on jcenter. So, just the following code should be enough t
Place this in your app module's build.gradle file:
```groovy
dependencies {
compile 'com.azeesoft.lib.colorpicker:colorpicker:1.0.8@aar'
implementation 'com.azeesoft.lib.colorpicker:colorpicker:1.1.0@aar'
}
```
If there is any error while building the project using the above mentioned step, add the following code in that build.gradle file and build again:
Expand Down Expand Up @@ -72,6 +95,7 @@ After successful build, you can use ColorPickerDialog as a part of your project.
* cp_showOpacityBar (boolean) : Show/Hide Opacity Bar
* cp_showHexaDecimalValue (boolean) : Show/Hide Hexadecimal Value
* cp_showColorComponentsInfo (boolean) : Show/Hide Color components information(HSV, RGB, Alpha)
* cp_showNoColorOption (boolean) : Show/Hide No Color button shortcut for transparent color value
* cp_backgroundColor (color) : Background color for the dialog
* cp_hexaDecimalTextColor (color) : Text color for the Hexadecimal value
* cp_colorComponentsTextColor (color) : Text color for the Color components information(HSV, RGB, Alpha)
Expand Down
45 changes: 30 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,43 @@ apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'

buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
}
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion 29
buildToolsVersion "29.0.3"

defaultConfig {
minSdkVersion 11
targetSdkVersion 23
versionCode 9
versionName "1.0.9"
minSdkVersion 14
targetSdkVersion 29
versionCode 10
versionName "1.1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

}

version = '1.0.9'
version = '1.1.0'
group = "com.azeesoft.lib.colorpicker"

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
api fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
api "androidx.appcompat:appcompat:1.1.0"
}

task sourcesJar(type: Jar) {
Expand All @@ -48,23 +57,29 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}

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

artifacts {
archives javadocJar
archives sourcesJar
}

bintray {
user = 'azeesoft'
user = 'azeesoft'
key = '3d45a2cb273fea293793d6f337b755bb2e121cfa'
pkg {
repo = 'maven'
name = 'com.azeesoft.lib.colorpicker'

version {
name = 'CP-1.0.9'
name = 'CP-1.1.0'
desc = "Added additional check for saving and loading last color"
released = new Date()
vcsTag = '1.0.9'
vcsTag = '1.1.0'
}

licenses = ['Apache-2.0']
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
android.useAndroidX=true
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed Mar 15 13:37:37 AEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-all.zip
160 changes: 160 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
#!/usr/bin/env bash

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
echo "$*"
}

die ( ) {
echo
echo "$*"
echo
exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
Loading