Skip to content

Commit

Permalink
v2.3 release: removed code duplicates and optimized seekbar sizing on…
Browse files Browse the repository at this point in the history
… small devices
  • Loading branch information
MrBIMC committed May 28, 2016
1 parent c4ae11b commit bc84ffc
Show file tree
Hide file tree
Showing 14 changed files with 439 additions and 591 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ As far as I checked, there are no cool implementations of SeekBarPreference. So

Add this to your module dependencies:
```groovy
compile 'com.pavelsikun:material-seekbar-preference:2.2.0+'
compile 'com.pavelsikun:material-seekbar-preference:2.3.0+'
````
Reference namespace on top of your layout file:
Expand Down Expand Up @@ -101,7 +101,7 @@ Either of way, View/Preference provides next methods to modify and manage it fro
public void setDialogStyle(int dialogStyle);

// AND for view-only(at least for now), there's a way to get a callback whenever value changes:
public void setOnValueSelectedListener(OnValueSelectedListener onValueSelectedListener);
public void setOnValueSelectedListener(PersistValueListener onValuePersisted);
```

As you can see, lib provides 4 universal custom attributes(msbp_minValue, msbp_maxValue, msbp_interval and msbp_measurementUnit).
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:2.1.0'
}
}

Expand Down
8 changes: 4 additions & 4 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 7
targetSdkVersion 23
versionCode 12
versionName "2.2.0"
versionCode 13
versionName "2.3.0"
}

lintOptions {
Expand All @@ -24,8 +24,8 @@ dependencies {
ext {
PUBLISH_GROUP_ID = 'com.pavelsikun'
PUBLISH_ARTIFACT_ID = 'material-seekbar-preference'
PUBLISH_VERSION = '2.2.0'
PUBLISH_VERSION = '2.3.0'
}

//apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
// ./gradlew clean build generateRelease
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CustomValueDialog {
private EditText customValueView;

private int minValue, maxValue, currentValue;
private OnValueSelectedListener onValueSelectedListener;
private PersistValueListener persistValueListener;

CustomValueDialog(Context context, int theme, int minValue, int maxValue, int currentValue) {
this.minValue = minValue;
Expand Down Expand Up @@ -77,8 +77,8 @@ private int fetchAccentColor(Context context) {
return color;
}

CustomValueDialog setOnValueSelectedListener(OnValueSelectedListener listener) {
onValueSelectedListener = listener;
CustomValueDialog setPersistValueListener(PersistValueListener listener) {
persistValueListener = listener;
return this;
}

Expand Down Expand Up @@ -108,8 +108,8 @@ else if (value < minValue) {
return;
}

if(onValueSelectedListener != null) {
onValueSelectedListener.onValueSelected(value);
if(persistValueListener != null) {
persistValueListener.persistInt(value);
dialog.dismiss();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* Created by Pavel Sikun on 21.05.16.
*/

public interface OnValueSelectedListener {
void onValueSelected(int value);
}
public interface PersistValueListener {
boolean persistInt(int value);
}
Loading

0 comments on commit bc84ffc

Please sign in to comment.