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

Updated to support AndroidX #109

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ range-seek-bar

# Introduction

Refactored to support AndroidX.

If you are coming from [the original repo](https://github.com/yahoo/android-range-seek-bar), it has a [new home](https://github.com/anothem/android-range-seek-bar) so if you're seeing this, you're probably in the right place.

This library provides a SeekBar similar to the default Android one, but with two thumb controls allowing a range to be selected.
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.12.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -17,5 +18,6 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=anothem
POM_DEVELOPER_NAME=Alex Florescu
android.useAndroidX=true
android.enableJetifier=true

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 @@
#Thu May 26 16:38:46 BST 2016
#Fri May 07 10:27:33 PDT 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
11 changes: 5 additions & 6 deletions rangeseekbar-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ repositories {
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 29

defaultConfig {
applicationId "org.florescu.android.rangeseekbar.sample"
minSdkVersion 15
targetSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
Expand All @@ -25,7 +24,7 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile project(':rangeseekbar')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation project(':rangeseekbar')
}
20 changes: 10 additions & 10 deletions rangeseekbar/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
buildscript {
repositories {
mavenCentral()
google()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:4.1.3'
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 29

defaultConfig {
minSdkVersion 15
targetSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
Expand All @@ -35,13 +35,13 @@ dependencies {
mavenCentral()
}

compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-annotations:23.4.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.annotation:annotation:1.2.0'

// Robolectric
testCompile 'org.robolectric:robolectric:3.1-rc1'
testCompile "org.mockito:mockito-core:2.0.53-beta"
testImplementation 'org.robolectric:robolectric:3.1-rc1'
testImplementation "org.mockito:mockito-core:2.0.53-beta"
}

apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.ColorRes;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
import android.widget.ImageView;

import androidx.annotation.ColorRes;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatImageView;

import org.florescu.android.util.BitmapUtil;
import org.florescu.android.util.PixelUtil;
Expand All @@ -58,7 +59,7 @@
* @author Alex Florescu ([email protected])
* @author Michael Keppler ([email protected])
*/
public class RangeSeekBar<T extends Number> extends ImageView {
public class RangeSeekBar<T extends Number> extends AppCompatImageView {
/**
* Default color of a {@link RangeSeekBar}, #FF33B5E5. This is also known as "Ice Cream Sandwich" blue.
*/
Expand Down