From 17519faf6a948e90d386ae3bffc83bada2c7e08a Mon Sep 17 00:00:00 2001 From: "b.ergashev" Date: Sat, 1 Jun 2019 13:33:25 +0300 Subject: [PATCH 1/2] update all dependencies --- .idea/encodings.xml | 4 +++ .idea/gradle.xml | 3 +++ .idea/misc.xml | 12 +-------- .idea/modules.xml | 3 +++ .idea/vcs.xml | 6 +++++ app/build.gradle | 22 +++++++-------- app/src/main/AndroidManifest.xml | 1 - .../com/ebr163/fillableview/MainActivity.java | 11 ++++---- .../ebr163/fillableview/StartActivity.java | 13 --------- build.gradle | 17 +++++++----- gradle.properties | 4 ++- gradle/wrapper/gradle-wrapper.properties | 2 +- view/build.gradle | 27 +++++-------------- .../main/java/com/ebr163/view/FilledView.java | 3 ++- 14 files changed, 56 insertions(+), 72 deletions(-) create mode 100644 .idea/encodings.xml create mode 100644 .idea/vcs.xml delete mode 100644 app/src/main/java/com/ebr163/fillableview/StartActivity.java diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index d078c73..5ddf18e 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -3,6 +3,9 @@ - - - - - - - - - - - + diff --git a/.idea/modules.xml b/.idea/modules.xml index f76ebcb..a1e7c7c 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -3,7 +3,10 @@ + + + diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 053d068..675bc14 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,16 +1,18 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" + + compileSdkVersion project.ext.targetSdkVersion + buildToolsVersion project.ext.buildToolsVersion + defaultConfig { applicationId "com.ebr163.fillableview" minSdkVersion 14 - targetSdkVersion 25 + targetSdkVersion project.ext.targetSdkVersion versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } + buildTypes { release { minifyEnabled false @@ -20,13 +22,7 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - - compile project(":view") - compile 'com.android.support:appcompat-v7:25.2.0' - compile 'com.android.support.constraint:constraint-layout:1.0.1' - testCompile 'junit:junit:4.12' + implementation project(":view") + implementation "androidx.appcompat:appcompat:$project.ext.androidX" + implementation "com.android.support.constraint:constraint-layout:$project.ext.constrainLayout" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b730bd2..f3d1127 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -16,7 +16,6 @@ - \ No newline at end of file diff --git a/app/src/main/java/com/ebr163/fillableview/MainActivity.java b/app/src/main/java/com/ebr163/fillableview/MainActivity.java index 9c24522..bd320ba 100644 --- a/app/src/main/java/com/ebr163/fillableview/MainActivity.java +++ b/app/src/main/java/com/ebr163/fillableview/MainActivity.java @@ -2,7 +2,6 @@ import android.graphics.Color; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; @@ -10,6 +9,8 @@ import android.widget.Button; import android.widget.SeekBar; +import androidx.appcompat.app.AppCompatActivity; + import com.ebr163.view.FilledView; import java.util.Random; @@ -23,9 +24,9 @@ public class MainActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - filledViewLeft = (FilledView) findViewById(R.id.fillable_view_left); + filledViewLeft = findViewById(R.id.fillable_view_left); - Button changeColorButton = (Button) findViewById(R.id.changeColorBtn); + Button changeColorButton = findViewById(R.id.changeColorBtn); changeColorButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -34,7 +35,7 @@ public void onClick(View v) { } }); - Button changeTextButton = (Button) findViewById(R.id.changeTextBtn); + Button changeTextButton = findViewById(R.id.changeTextBtn); changeTextButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -43,7 +44,7 @@ public void onClick(View v) { } }); - SeekBar seekbar = (SeekBar) findViewById(R.id.seekBar); + SeekBar seekbar = findViewById(R.id.seekBar); filledViewLeft.setProgress(seekbar.getProgress() / 100F); seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override diff --git a/app/src/main/java/com/ebr163/fillableview/StartActivity.java b/app/src/main/java/com/ebr163/fillableview/StartActivity.java deleted file mode 100644 index d59c6f0..0000000 --- a/app/src/main/java/com/ebr163/fillableview/StartActivity.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.ebr163.fillableview; - -import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; - -public class StartActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_start); - } -} diff --git a/build.gradle b/build.gradle index 1ea4bd0..ea139af 100644 --- a/build.gradle +++ b/build.gradle @@ -1,21 +1,26 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { repositories { + google() jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.0' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files + classpath 'com.android.tools.build:gradle:3.4.1' } } allprojects { repositories { + google() jcenter() } + + project.ext { + targetSdkVersion = 28 + buildToolsVersion = "28.0.3" + androidX = "1.1.0-alpha05" + constrainLayout = "1.1.3" + } } task clean(type: Delete) { diff --git a/gradle.properties b/gradle.properties index aac7c9b..b02ce3f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,4 +14,6 @@ org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true +org.gradle.parallel=true +android.useAndroidX=true +android.enableJetifier=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fb28340..5fed461 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ 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-5.1.1-all.zip \ No newline at end of file diff --git a/view/build.gradle b/view/build.gradle index 3ff1f16..e890079 100644 --- a/view/build.gradle +++ b/view/build.gradle @@ -1,31 +1,18 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" + + compileSdkVersion project.ext.targetSdkVersion + buildToolsVersion project.ext.buildToolsVersion defaultConfig { minSdkVersion 14 - targetSdkVersion 25 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } + targetSdkVersion project.ext.targetSdkVersion + versionCode 2 + versionName "1.1" } } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - compile 'com.android.support:appcompat-v7:25.2.0' - testCompile 'junit:junit:4.12' + implementation "androidx.appcompat:appcompat:$project.ext.androidX" } diff --git a/view/src/main/java/com/ebr163/view/FilledView.java b/view/src/main/java/com/ebr163/view/FilledView.java index d086cd4..cf01862 100644 --- a/view/src/main/java/com/ebr163/view/FilledView.java +++ b/view/src/main/java/com/ebr163/view/FilledView.java @@ -9,10 +9,11 @@ import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Region; -import android.support.annotation.Nullable; import android.util.AttributeSet; import android.view.View; +import androidx.annotation.Nullable; + /** * Created by ergashev on 12.03.17. */ From 0769fe5b891044d9d74a94c69507edcba351b02f Mon Sep 17 00:00:00 2001 From: "b.ergashev" Date: Sat, 1 Jun 2019 18:02:04 +0300 Subject: [PATCH 2/2] fix https://github.com/pavel163/FilledView/issues/1 --- app/build.gradle | 2 +- .../fillableview/ExampleInstrumentedTest.java | 26 ----- app/src/main/AndroidManifest.xml | 4 +- .../com/ebr163/fillableview/MainActivity.java | 2 +- app/src/main/res/layout/activity_start.xml | 35 ------- .../ebr163/fillableview/ExampleUnitTest.java | 17 ---- build.gradle | 1 + view/build.gradle | 2 +- .../ebr163/view/ExampleInstrumentedTest.java | 26 ----- .../main/java/com/ebr163/view/FilledView.java | 94 ++++++++----------- .../java/com/ebr163/view/ExampleUnitTest.java | 17 ---- 11 files changed, 46 insertions(+), 180 deletions(-) delete mode 100644 app/src/androidTest/java/com/ebr163/fillableview/ExampleInstrumentedTest.java delete mode 100644 app/src/main/res/layout/activity_start.xml delete mode 100644 app/src/test/java/com/ebr163/fillableview/ExampleUnitTest.java delete mode 100644 view/src/androidTest/java/com/ebr163/view/ExampleInstrumentedTest.java delete mode 100644 view/src/test/java/com/ebr163/view/ExampleUnitTest.java diff --git a/app/build.gradle b/app/build.gradle index 675bc14..b22988c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,7 +7,7 @@ android { defaultConfig { applicationId "com.ebr163.fillableview" - minSdkVersion 14 + minSdkVersion project.ext.minSdkVersion targetSdkVersion project.ext.targetSdkVersion versionCode 1 versionName "1.0" diff --git a/app/src/androidTest/java/com/ebr163/fillableview/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/ebr163/fillableview/ExampleInstrumentedTest.java deleted file mode 100644 index 8a586c8..0000000 --- a/app/src/androidTest/java/com/ebr163/fillableview/ExampleInstrumentedTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.ebr163.fillableview; - -import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.junit.Assert.*; - -/** - * Instrumentation test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - @Test - public void useAppContext() throws Exception { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); - - assertEquals("com.ebr163.fillableview", appContext.getPackageName()); - } -} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f3d1127..ad6c36e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ + android:theme="@style/AppTheme" + tools:ignore="GoogleAppIndexingWarning"> diff --git a/app/src/main/java/com/ebr163/fillableview/MainActivity.java b/app/src/main/java/com/ebr163/fillableview/MainActivity.java index bd320ba..7995b96 100644 --- a/app/src/main/java/com/ebr163/fillableview/MainActivity.java +++ b/app/src/main/java/com/ebr163/fillableview/MainActivity.java @@ -17,7 +17,7 @@ public class MainActivity extends AppCompatActivity { - private Random rnd = new Random(); + private final Random rnd = new Random(); private FilledView filledViewLeft; @Override diff --git a/app/src/main/res/layout/activity_start.xml b/app/src/main/res/layout/activity_start.xml deleted file mode 100644 index 829c0da..0000000 --- a/app/src/main/res/layout/activity_start.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - -