Skip to content

Commit

Permalink
#18 setColorSeeds(int[] colors) not working
Browse files Browse the repository at this point in the history
  • Loading branch information
rtugeek committed Oct 31, 2017
1 parent 3217d2b commit 3749d42
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/misc.xml
.idea/**/uiDesigner.xml

# Gradle:
Expand Down
15 changes: 1 addition & 14 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.1'
buildToolsVersion '26.0.2'

defaultConfig {
applicationId "com.rtugeek.android.colorseekbardemo"
minSdkVersion 9
targetSdkVersion 23
versionCode 2
versionName "1.2.2"
versionCode 3
versionName "1.5.1"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
package com.rtugeek.android.colorseekbardemo;

import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Handler;
import android.support.v4.graphics.ColorUtils;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.SeekBar;
import android.widget.TextView;

import com.rtugeek.android.colorseekbar.ColorSeekBar;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
private ColorSeekBar mColorSeekBar;
private SharedPreferences sp;
private SharedPreferences.Editor spe;
private static final String TAG = "ColorSeekBar";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -32,7 +36,6 @@ protected void onCreate(Bundle savedInstanceState) {
final CheckBox showAlphaCheckBox = (CheckBox) findViewById(R.id.checkBox);
final SeekBar barHeightSeekBar = (SeekBar) findViewById(R.id.seekBar);
final SeekBar thumbHeightSeekBar = (SeekBar) findViewById(R.id.seekBar2);

// mColorSeekBar.setAlphaBarPosition(10);
// mColorSeekBar.setBarMargin(10);
// mColorSeekBar.setBarHeight(5);
Expand All @@ -43,7 +46,6 @@ protected void onCreate(Bundle savedInstanceState) {
mColorSeekBar.setMaxPosition(100);
mColorSeekBar.setShowAlphaBar(true);
mColorSeekBar.setThumbHeight(30);
mColorSeekBar.setColorSeeds(R.array.material_colors);

mColorSeekBar.setOnInitDoneListener(new ColorSeekBar.OnInitDoneListener() {
@Override
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@

<com.rtugeek.android.colorseekbar.ColorSeekBar
android:id="@+id/colorSlider"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/textView"
android:layout_margin="6dp"
app:isVertical="false"
app:colorSeeds="@array/material_colors" />

<CheckBox
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
6 changes: 3 additions & 3 deletions colorseekbar/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion '25.0.1'
buildToolsVersion '26.0.2'

defaultConfig {
minSdkVersion 9
targetSdkVersion 23
versionCode 3
versionName "1.4.3"
versionCode 4
versionName "1.5.1"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,8 @@ public void setColorSeeds(@ArrayRes int resId) {

public void setColorSeeds(int[] colors) {
mColorSeeds = colors;
init();
invalidate();
cacheColors();
setAlphaValue();
if (mOnColorChangeLister != null)
mOnColorChangeLister.onColorChangeListener(mColorBarPosition, mAlphaBarPosition, getColor());
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Mar 21 08:35:46 CST 2017
#Tue Oct 31 21:08:40 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

0 comments on commit 3749d42

Please sign in to comment.