diff --git a/README.md b/README.md index 316f071..322ff25 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ Current we already have three RatingBars : ![](images/screenshot.png) Icon made by [Freepik](http://www.freepik.com/) from www.flaticon.com -## What's New (v1.4.1) +## What's New (v1.4.2) +- Fix bug when the format of number is different in different country - Fix minimum stars not working in recyclerView bug - Implement minimum stars property - Add setStarWidth and setStarHeight API (unit is pixel) @@ -48,7 +49,7 @@ allprojects { } dependencies { - compile 'com.github.ome450901:SimpleRatingBar:1.4.1' + compile 'com.github.ome450901:SimpleRatingBar:1.4.2' } ``` diff --git a/build.gradle b/build.gradle index 75a18f7..98d12ef 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:3.1.2' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/example/build.gradle b/example/build.gradle index 6d7f1c4..98812de 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 26 - buildToolsVersion '26.0.2' + compileSdkVersion 27 + buildToolsVersion '27.0.3' defaultConfig { applicationId "com.willy.example" minSdkVersion 15 - targetSdkVersion 26 + targetSdkVersion 27 versionCode 1 versionName "1.0" @@ -23,14 +23,14 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + implementation fileTree(dir: 'libs', include: ['*.jar']) + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) - implementation 'com.android.support:appcompat-v7:26.1.0' + implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support.constraint:constraint-layout:1.0.2' - implementation 'com.android.support:recyclerview-v7:26.1.0' - implementation 'com.android.support:design:26.1.0' - testCompile 'junit:junit:4.12' - compile project(':library') + implementation 'com.android.support:recyclerview-v7:27.1.1' + implementation 'com.android.support:design:27.1.1' + androidTestImplementation 'junit:junit:4.12' + implementation project(':library') } diff --git a/example/src/main/java/com/willy/example/DemoFragment.java b/example/src/main/java/com/willy/example/DemoFragment.java index 7584b29..28684ee 100644 --- a/example/src/main/java/com/willy/example/DemoFragment.java +++ b/example/src/main/java/com/willy/example/DemoFragment.java @@ -30,7 +30,7 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { final BaseRatingBar baseRatingBar = (BaseRatingBar) view.findViewById(R.id.baseratingbar_main); final ScaleRatingBar scaleRatingBar = (ScaleRatingBar) view.findViewById(R.id.scaleRatingBar); final RotationRatingBar rotationRatingBar = (RotationRatingBar) view.findViewById(R.id.rotationratingbar_main); - + baseRatingBar.setClearRatingEnabled(false); baseRatingBar.setOnRatingChangeListener(new BaseRatingBar.OnRatingChangeListener() { @Override public void onRatingChange(BaseRatingBar ratingBar, float rating) { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4e91068..f2ea508 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Nov 20 09:17:27 CST 2017 +#Wed Apr 18 14:06:28 CST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip diff --git a/library/build.gradle b/library/build.gradle index 76e21d4..53749f0 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -3,12 +3,12 @@ apply plugin: 'com.github.dcendents.android-maven' group = 'com.github.ome450901' android { - compileSdkVersion 26 - buildToolsVersion '26.0.2' + compileSdkVersion 27 + buildToolsVersion '27.0.3' defaultConfig { minSdkVersion 15 - targetSdkVersion 26 + targetSdkVersion 27 versionCode 1 versionName "1.0" @@ -24,10 +24,10 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + implementation fileTree(dir: 'libs', include: ['*.jar']) + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) - implementation 'com.android.support:appcompat-v7:26.1.0' - testCompile 'junit:junit:4.12' + implementation 'com.android.support:appcompat-v7:27.1.1' + androidTestImplementation 'junit:junit:4.12' } diff --git a/library/src/main/AndroidManifest.xml b/library/src/main/AndroidManifest.xml index 9aa56a2..a27a3aa 100644 --- a/library/src/main/AndroidManifest.xml +++ b/library/src/main/AndroidManifest.xml @@ -1,13 +1,12 @@ - - + + diff --git a/library/src/main/java/com/willy/ratingbar/RatingBarUtils.java b/library/src/main/java/com/willy/ratingbar/RatingBarUtils.java index b6803cd..34d9b54 100644 --- a/library/src/main/java/com/willy/ratingbar/RatingBarUtils.java +++ b/library/src/main/java/com/willy/ratingbar/RatingBarUtils.java @@ -4,6 +4,7 @@ import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; +import java.util.Locale; /** * Created by willy on 2018/3/8. @@ -50,7 +51,7 @@ static float getValidMinimumStars(float minimumStars, int numStars, float stepSi static DecimalFormat getDecimalFormat() { if (mDecimalFormat == null) { - DecimalFormatSymbols symbols = new DecimalFormatSymbols(); + DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.ENGLISH); symbols.setDecimalSeparator('.'); mDecimalFormat = new DecimalFormat("#.##", symbols); }