From 141fd441f02303e7e18ef04c5a791feac3255443 Mon Sep 17 00:00:00 2001 From: Carlos M Date: Tue, 4 Jun 2019 17:00:04 +0100 Subject: [PATCH] Updates to androidX and removes manifest allowBackup. --- .../java/com/carlosmuvi/sample/MainActivity.java | 14 ++++++++------ library/build.gradle | 1 + library/src/main/AndroidManifest.xml | 10 ++-------- .../segmentedprogressbar/SegmentedProgressBar.kt | 2 +- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/com/carlosmuvi/sample/MainActivity.java b/app/src/main/java/com/carlosmuvi/sample/MainActivity.java index 5b63535..de6e398 100644 --- a/app/src/main/java/com/carlosmuvi/sample/MainActivity.java +++ b/app/src/main/java/com/carlosmuvi/sample/MainActivity.java @@ -1,9 +1,11 @@ package com.carlosmuvi.sample; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; + +import androidx.appcompat.app.AppCompatActivity; + import com.carlosmuvi.segmentedprogressbar.SegmentedProgressBar; public class MainActivity extends AppCompatActivity { @@ -20,10 +22,10 @@ public class MainActivity extends AppCompatActivity { initSegmentedProgressBar(); - startButton = (Button) findViewById(R.id.button); - pauseResumeButton = (Button) findViewById(R.id.button3); - resetButton = (Button) findViewById(R.id.button2); - startWithoutAnimationButton = (Button) findViewById(R.id.button4); + startButton = findViewById(R.id.button); + pauseResumeButton = findViewById(R.id.button3); + resetButton = findViewById(R.id.button2); + startWithoutAnimationButton = findViewById(R.id.button4); startButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -54,7 +56,7 @@ public class MainActivity extends AppCompatActivity { } private void initSegmentedProgressBar() { - segmentedProgressBar = (SegmentedProgressBar) findViewById(R.id.segmented_progressbar); + segmentedProgressBar = findViewById(R.id.segmented_progressbar); //set filled segments directly segmentedProgressBar.setCompletedSegments(1); diff --git a/library/build.gradle b/library/build.gradle index 1ca9f16..7ad20f1 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -24,6 +24,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'com.android.support:support-annotations:28.0.0' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" testImplementation 'junit:junit:4.12' diff --git a/library/src/main/AndroidManifest.xml b/library/src/main/AndroidManifest.xml index e3cefa0..c601701 100644 --- a/library/src/main/AndroidManifest.xml +++ b/library/src/main/AndroidManifest.xml @@ -1,11 +1,5 @@ - + - - - + diff --git a/library/src/main/java/com/carlosmuvi/segmentedprogressbar/SegmentedProgressBar.kt b/library/src/main/java/com/carlosmuvi/segmentedprogressbar/SegmentedProgressBar.kt index d3cf5e4..cc1f58d 100644 --- a/library/src/main/java/com/carlosmuvi/segmentedprogressbar/SegmentedProgressBar.kt +++ b/library/src/main/java/com/carlosmuvi/segmentedprogressbar/SegmentedProgressBar.kt @@ -4,9 +4,9 @@ import android.content.Context import android.graphics.Canvas import android.graphics.Paint import android.graphics.Path -import android.support.annotation.ColorInt import android.util.AttributeSet import android.view.View +import androidx.annotation.ColorInt /** * Created by carlosmuvi on 02/09/16.