Skip to content

Commit

Permalink
Fixed #30, #31.
Browse files Browse the repository at this point in the history
Update build tools.
  • Loading branch information
rtugeek@gmail.com committed Jun 29, 2019
1 parent 6b8f137 commit 90eae32
Show file tree
Hide file tree
Showing 16 changed files with 119 additions and 152 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Expand Up @@ -102,11 +102,7 @@ proguard/
captures/

# Intellij
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/libraries

.idea/*
# Keystore files
*.jks

Expand Down
29 changes: 0 additions & 29 deletions .idea/codeStyles/Project.xml

This file was deleted.

21 changes: 0 additions & 21 deletions .idea/gradle.xml

This file was deleted.

35 changes: 0 additions & 35 deletions .idea/misc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -36,7 +36,7 @@ Step 1. Add the JitPack repository in your root build.gradle at the end of repos
```
Step 2. Add the dependency
```
 compile 'com.github.rtugeek:colorseekbar:1.7.2'
 compile 'com.github.rtugeek:colorseekbar:1.7.4'
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
@@ -1,7 +1,7 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.2'
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.rtugeek.android.colorseekbardemo"
minSdkVersion 14
Expand Down
@@ -1,6 +1,7 @@
package com.rtugeek.android.colorseekbardemo;

import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
Expand Down Expand Up @@ -41,13 +42,15 @@ protected void onCreate(Bundle savedInstanceState) {
mColorSeekBar.setMaxPosition(100);
mColorSeekBar.setShowAlphaBar(true);
mColorSeekBar.setThumbHeight(30);
mColorSeekBar.setDisabledColor(Color.GRAY);

mColorSeekBar.setOnInitDoneListener(new ColorSeekBar.OnInitDoneListener() {
@Override
public void done() {
Log.i(TAG,"done!");
}
});

mColorSeekBar.setOnColorChangeListener(new ColorSeekBar.OnColorChangeListener() {
@Override
public void onColorChangeListener(int colorBarPosition, int alphaBarPosition, int color) {
Expand Down Expand Up @@ -111,6 +114,20 @@ public void onStopTrackingTouch(SeekBar seekBar) {
mColorSeekBar.setColor(sp.getInt("color", 0));
showAlphaCheckBox.setChecked(sp.getBoolean("showAlpha", false));


((CheckBox)findViewById(R.id.chk_enable)).setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mColorSeekBar.setEnabled(isChecked);
}
});

((CheckBox)findViewById(R.id.chk_show_thumb)).setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mColorSeekBar.setShowThumb(isChecked);
}
});
}


Expand Down
25 changes: 24 additions & 1 deletion app/src/main/res/layout/activity_main.xml
Expand Up @@ -31,14 +31,37 @@
android:layout_margin="6dp"
app:colorSeeds="@array/material_colors" />

<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="wrap_content">

<CheckBox
android:id="@+id/checkBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/colorSlider"
android:layout_centerHorizontal="true"
android:checked="false"
android:text="ShowAlphaBar" />
android:text="Show Alpha Bar" />

<CheckBox
android:id="@+id/chk_show_thumb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:checked="true"
android:text="Show Thumb" />

<CheckBox
android:id="@+id/chk_enable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:checked="true"
android:text="Enable" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.android.tools.build:gradle:3.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
11 changes: 6 additions & 5 deletions colorseekbar/build.gradle
@@ -1,13 +1,14 @@
apply plugin: 'com.android.library'
group='com.github.rtugeek'
android {
compileSdkVersion 27
buildToolsVersion '28.0.2'
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 27
targetSdkVersion 28
versionCode 7
versionName "1.7.2"
versionName "1.7.4"

}
buildTypes {
release {
Expand All @@ -22,5 +23,5 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-annotations:28.0.0'
}

0 comments on commit 90eae32

Please sign in to comment.