Created
November 4, 2018 03:19
-
-
Save toastkidjp/225c5b76cb14d272c7d2e5d02019100d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 9356cb97b033cc8a45f29fd553949413a56db2de Mon Sep 17 00:00:00 2001 | |
From: Toast Kid <super_q1m@yahoo.co.jp> | |
Date: Sun, 4 Nov 2018 11:29:35 +0900 | |
Subject: [PATCH] Replace to AndroidX. | |
--- | |
app/build.gradle | 23 +++++++++---------- | |
.../toastkid/clock/ClockSettingsActivity.kt | 8 +++---- | |
.../jp/toastkid/clock/SettingPagerAdapter.kt | 6 ++--- | |
.../clock/libs/PrivacyPolicyLauncher.kt | 4 ++-- | |
.../java/jp/toastkid/clock/license/Adapter.kt | 2 +- | |
.../license/LicenseInformationFragment.kt | 6 ++--- | |
.../jp/toastkid/clock/license/ViewHolder.kt | 2 +- | |
.../clock/setting/PreferenceApplier.kt | 2 +- | |
.../setting/color/ColorSettingFragment.kt | 2 +- | |
.../clock/setting/time_zone/Adapter.kt | 4 ++-- | |
.../time_zone/TimeZoneSettingFragment.kt | 7 +++--- | |
.../clock/setting/time_zone/ViewHolder.kt | 2 +- | |
.../main/res/layout/activity_setting_top.xml | 12 +++++----- | |
.../layout/fragment_license_information.xml | 2 +- | |
.../main/res/layout/fragment_time_zone.xml | 6 ++--- | |
.../res/layout/item_license_information.xml | 4 ++-- | |
app/src/main/res/layout/item_time_zone.xml | 4 ++-- | |
build.gradle | 4 ++-- | |
gradle.properties | 2 ++ | |
19 files changed, 52 insertions(+), 50 deletions(-) | |
diff --git a/app/build.gradle b/app/build.gradle | |
index 91b6017..5fb6db0 100644 | |
--- a/app/build.gradle | |
+++ b/app/build.gradle | |
@@ -7,14 +7,14 @@ apply plugin: 'kotlin-android-extensions' | |
apply plugin: 'io.fabric' | |
android { | |
- compileSdkVersion 27 | |
+ compileSdkVersion 28 | |
defaultConfig { | |
applicationId "jp.toastkid.clock" | |
minSdkVersion 19 | |
- targetSdkVersion 27 | |
+ targetSdkVersion 28 | |
versionCode 1 | |
versionName "1.0" | |
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | |
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | |
} | |
buildTypes { | |
release { | |
@@ -28,13 +28,12 @@ dependencies { | |
implementation fileTree(dir: 'libs', include: ['*.jar']) | |
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" | |
- def supportLibVersion = '27.1.1' | |
- implementation "com.android.support:appcompat-v7:${supportLibVersion}" | |
- implementation "com.android.support:cardview-v7:${supportLibVersion}" | |
- implementation "com.android.support:customtabs:${supportLibVersion}" | |
- implementation "com.android.support:design:${supportLibVersion}" | |
- implementation "com.android.support:support-v4:${supportLibVersion}" | |
- implementation "com.android.support:support-vector-drawable:${supportLibVersion}" | |
+ def supportLibVersion = '1.0.0' | |
+ implementation "androidx.appcompat:appcompat:${supportLibVersion}" | |
+ implementation "androidx.cardview:cardview:${supportLibVersion}" | |
+ implementation "androidx.browser:browser:${supportLibVersion}" | |
+ implementation "com.android.support:design:28.0.0" | |
+ implementation "androidx.core:core:${supportLibVersion}" | |
implementation 'com.github.madrapps:pikolo:1.1.6' | |
implementation 'com.squareup.okio:okio:1.16.0' | |
@@ -43,8 +42,8 @@ dependencies { | |
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5' | |
testImplementation 'junit:junit:4.12' | |
- androidTestImplementation 'com.android.support.test:runner:1.0.2' | |
- androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' | |
+ androidTestImplementation 'androidx.test:runner:1.1.0' | |
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' | |
} | |
apply plugin: 'com.google.gms.google-services' | |
diff --git a/app/src/main/java/jp/toastkid/clock/ClockSettingsActivity.kt b/app/src/main/java/jp/toastkid/clock/ClockSettingsActivity.kt | |
index b2092c2..3c96a4b 100644 | |
--- a/app/src/main/java/jp/toastkid/clock/ClockSettingsActivity.kt | |
+++ b/app/src/main/java/jp/toastkid/clock/ClockSettingsActivity.kt | |
@@ -6,12 +6,12 @@ import android.graphics.Color | |
import android.net.Uri | |
import android.os.Bundle | |
import android.provider.Settings | |
-import android.support.design.widget.Snackbar | |
-import android.support.v4.graphics.drawable.DrawableCompat | |
-import android.support.v4.view.ViewPager | |
-import android.support.v7.app.AppCompatActivity | |
import android.view.Menu | |
import android.view.MenuItem | |
+import androidx.appcompat.app.AppCompatActivity | |
+import androidx.core.graphics.drawable.DrawableCompat | |
+import androidx.viewpager.widget.ViewPager | |
+import com.google.android.material.snackbar.Snackbar | |
import jp.toastkid.clock.appwidget.placement.AppWidgetPlacer | |
import jp.toastkid.clock.libs.PrivacyPolicyLauncher | |
import kotlinx.android.synthetic.main.activity_setting_top.* | |
diff --git a/app/src/main/java/jp/toastkid/clock/SettingPagerAdapter.kt b/app/src/main/java/jp/toastkid/clock/SettingPagerAdapter.kt | |
index 8879227..b88acbd 100644 | |
--- a/app/src/main/java/jp/toastkid/clock/SettingPagerAdapter.kt | |
+++ b/app/src/main/java/jp/toastkid/clock/SettingPagerAdapter.kt | |
@@ -1,8 +1,8 @@ | |
package jp.toastkid.clock | |
-import android.support.v4.app.Fragment | |
-import android.support.v4.app.FragmentManager | |
-import android.support.v4.app.FragmentPagerAdapter | |
+import androidx.fragment.app.Fragment | |
+import androidx.fragment.app.FragmentManager | |
+import androidx.fragment.app.FragmentPagerAdapter | |
import jp.toastkid.clock.libs.TitleProvider | |
import jp.toastkid.clock.license.LicenseInformationFragment | |
import jp.toastkid.clock.setting.color.ColorSettingFragment | |
diff --git a/app/src/main/java/jp/toastkid/clock/libs/PrivacyPolicyLauncher.kt b/app/src/main/java/jp/toastkid/clock/libs/PrivacyPolicyLauncher.kt | |
index bf785de..dd11c82 100644 | |
--- a/app/src/main/java/jp/toastkid/clock/libs/PrivacyPolicyLauncher.kt | |
+++ b/app/src/main/java/jp/toastkid/clock/libs/PrivacyPolicyLauncher.kt | |
@@ -2,8 +2,8 @@ package jp.toastkid.clock.libs | |
import android.content.Context | |
import android.net.Uri | |
-import android.support.customtabs.CustomTabsIntent | |
-import android.support.v4.content.ContextCompat | |
+import androidx.browser.customtabs.CustomTabsIntent | |
+import androidx.core.content.ContextCompat | |
import jp.toastkid.clock.R | |
/** | |
diff --git a/app/src/main/java/jp/toastkid/clock/license/Adapter.kt b/app/src/main/java/jp/toastkid/clock/license/Adapter.kt | |
index e266adb..36c4a25 100644 | |
--- a/app/src/main/java/jp/toastkid/clock/license/Adapter.kt | |
+++ b/app/src/main/java/jp/toastkid/clock/license/Adapter.kt | |
@@ -7,10 +7,10 @@ | |
*/ | |
package jp.toastkid.clock.license | |
-import android.support.v7.widget.RecyclerView | |
import android.view.LayoutInflater | |
import android.view.ViewGroup | |
import android.widget.TextView | |
+import androidx.recyclerview.widget.RecyclerView | |
import jp.toastkid.clock.R | |
/** | |
diff --git a/app/src/main/java/jp/toastkid/clock/license/LicenseInformationFragment.kt b/app/src/main/java/jp/toastkid/clock/license/LicenseInformationFragment.kt | |
index 9690aa2..2897ee1 100644 | |
--- a/app/src/main/java/jp/toastkid/clock/license/LicenseInformationFragment.kt | |
+++ b/app/src/main/java/jp/toastkid/clock/license/LicenseInformationFragment.kt | |
@@ -9,12 +9,12 @@ package jp.toastkid.clock.license | |
import android.content.res.AssetManager | |
import android.os.Bundle | |
-import android.support.v4.app.Fragment | |
-import android.support.v7.app.AlertDialog | |
-import android.support.v7.widget.LinearLayoutManager | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
+import androidx.appcompat.app.AlertDialog | |
+import androidx.fragment.app.Fragment | |
+import androidx.recyclerview.widget.LinearLayoutManager | |
import jp.toastkid.clock.R | |
import jp.toastkid.clock.libs.TitleProvider | |
import kotlinx.android.synthetic.main.fragment_license_information.* | |
diff --git a/app/src/main/java/jp/toastkid/clock/license/ViewHolder.kt b/app/src/main/java/jp/toastkid/clock/license/ViewHolder.kt | |
index 102eb65..d8f1e6a 100644 | |
--- a/app/src/main/java/jp/toastkid/clock/license/ViewHolder.kt | |
+++ b/app/src/main/java/jp/toastkid/clock/license/ViewHolder.kt | |
@@ -7,8 +7,8 @@ | |
*/ | |
package jp.toastkid.clock.license | |
-import android.support.v7.widget.RecyclerView | |
import android.view.View | |
+import androidx.recyclerview.widget.RecyclerView | |
/** | |
* @author toastkidjp | |
diff --git a/app/src/main/java/jp/toastkid/clock/setting/PreferenceApplier.kt b/app/src/main/java/jp/toastkid/clock/setting/PreferenceApplier.kt | |
index 775dec0..1a52735 100644 | |
--- a/app/src/main/java/jp/toastkid/clock/setting/PreferenceApplier.kt | |
+++ b/app/src/main/java/jp/toastkid/clock/setting/PreferenceApplier.kt | |
@@ -9,7 +9,7 @@ package jp.toastkid.clock.setting | |
import android.content.Context | |
import android.graphics.Color | |
-import android.support.annotation.ColorInt | |
+import androidx.annotation.ColorInt | |
import android.text.TextUtils | |
import java.util.* | |
diff --git a/app/src/main/java/jp/toastkid/clock/setting/color/ColorSettingFragment.kt b/app/src/main/java/jp/toastkid/clock/setting/color/ColorSettingFragment.kt | |
index 8bf2285..cfb0cb1 100644 | |
--- a/app/src/main/java/jp/toastkid/clock/setting/color/ColorSettingFragment.kt | |
+++ b/app/src/main/java/jp/toastkid/clock/setting/color/ColorSettingFragment.kt | |
@@ -8,7 +8,7 @@ | |
package jp.toastkid.clock.setting.color | |
import android.os.Bundle | |
-import android.support.v4.app.Fragment | |
+import androidx.fragment.app.Fragment | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
diff --git a/app/src/main/java/jp/toastkid/clock/setting/time_zone/Adapter.kt b/app/src/main/java/jp/toastkid/clock/setting/time_zone/Adapter.kt | |
index 08a802e..17cdaed 100644 | |
--- a/app/src/main/java/jp/toastkid/clock/setting/time_zone/Adapter.kt | |
+++ b/app/src/main/java/jp/toastkid/clock/setting/time_zone/Adapter.kt | |
@@ -7,11 +7,11 @@ | |
*/ | |
package jp.toastkid.clock.setting.time_zone | |
-import android.support.design.widget.Snackbar | |
-import android.support.v7.widget.RecyclerView | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
+import androidx.recyclerview.widget.RecyclerView | |
+import com.google.android.material.snackbar.Snackbar | |
import jp.toastkid.clock.R | |
import jp.toastkid.clock.setting.PreferenceApplier | |
import java.util.* | |
diff --git a/app/src/main/java/jp/toastkid/clock/setting/time_zone/TimeZoneSettingFragment.kt b/app/src/main/java/jp/toastkid/clock/setting/time_zone/TimeZoneSettingFragment.kt | |
index 93c7df7..ba44bc1 100644 | |
--- a/app/src/main/java/jp/toastkid/clock/setting/time_zone/TimeZoneSettingFragment.kt | |
+++ b/app/src/main/java/jp/toastkid/clock/setting/time_zone/TimeZoneSettingFragment.kt | |
@@ -8,14 +8,15 @@ | |
package jp.toastkid.clock.setting.time_zone | |
import android.os.Bundle | |
-import android.support.v4.app.Fragment | |
-import android.support.v7.widget.LinearLayoutManager | |
import android.text.Editable | |
import android.text.TextUtils | |
import android.text.TextWatcher | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
+import androidx.fragment.app.Fragment | |
+import androidx.recyclerview.widget.LinearLayoutManager | |
+import androidx.recyclerview.widget.RecyclerView | |
import jp.toastkid.clock.R | |
import jp.toastkid.clock.appwidget.RemoteViewsFactory | |
import jp.toastkid.clock.appwidget.SingleWidgetProvider | |
@@ -49,7 +50,7 @@ class TimeZoneSettingFragment : Fragment(), TitleProvider { | |
time_zones.adapter = adapter | |
time_zones.layoutManager = | |
- LinearLayoutManager(activityContext, LinearLayoutManager.VERTICAL, false) | |
+ LinearLayoutManager(activityContext, RecyclerView.VERTICAL, false) | |
filter.addTextChangedListener(object : TextWatcher { | |
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) = Unit | |
diff --git a/app/src/main/java/jp/toastkid/clock/setting/time_zone/ViewHolder.kt b/app/src/main/java/jp/toastkid/clock/setting/time_zone/ViewHolder.kt | |
index d4d4b0b..ea49c56 100644 | |
--- a/app/src/main/java/jp/toastkid/clock/setting/time_zone/ViewHolder.kt | |
+++ b/app/src/main/java/jp/toastkid/clock/setting/time_zone/ViewHolder.kt | |
@@ -7,9 +7,9 @@ | |
*/ | |
package jp.toastkid.clock.setting.time_zone | |
-import android.support.v7.widget.RecyclerView | |
import android.view.View | |
import android.widget.TextView | |
+import androidx.recyclerview.widget.RecyclerView | |
import jp.toastkid.clock.R | |
import jp.toastkid.clock.libs.OffsetConverter | |
diff --git a/app/src/main/res/layout/activity_setting_top.xml b/app/src/main/res/layout/activity_setting_top.xml | |
index 29b20d0..41e1ff8 100644 | |
--- a/app/src/main/res/layout/activity_setting_top.xml | |
+++ b/app/src/main/res/layout/activity_setting_top.xml | |
@@ -1,5 +1,5 @@ | |
<?xml version="1.0" encoding="utf-8"?> | |
-<android.support.design.widget.CoordinatorLayout | |
+<androidx.coordinatorlayout.widget.CoordinatorLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:orientation="vertical" | |
@@ -7,23 +7,23 @@ | |
android:layout_height="match_parent" | |
> | |
- <android.support.design.widget.AppBarLayout | |
+ <com.google.android.material.appbar.AppBarLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
> | |
- <android.support.v7.widget.Toolbar | |
+ <androidx.appcompat.widget.Toolbar | |
android:id="@+id/toolbar" | |
android:layout_width="match_parent" | |
android:layout_height="@dimen/toolbar_height" | |
app:layout_scrollFlags="scroll|enterAlways" | |
/> | |
- </android.support.design.widget.AppBarLayout> | |
+ </com.google.android.material.appbar.AppBarLayout> | |
- <android.support.v4.view.ViewPager | |
+ <androidx.viewpager.widget.ViewPager | |
android:id="@+id/container" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
app:layout_behavior="@string/appbar_scrolling_view_behavior" | |
/> | |
-</android.support.design.widget.CoordinatorLayout> | |
\ No newline at end of file | |
+</androidx.coordinatorlayout.widget.CoordinatorLayout> | |
\ No newline at end of file | |
diff --git a/app/src/main/res/layout/fragment_license_information.xml b/app/src/main/res/layout/fragment_license_information.xml | |
index 5ac4da1..2bff3b0 100644 | |
--- a/app/src/main/res/layout/fragment_license_information.xml | |
+++ b/app/src/main/res/layout/fragment_license_information.xml | |
@@ -5,7 +5,7 @@ | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
> | |
- <android.support.v7.widget.RecyclerView | |
+ <androidx.recyclerview.widget.RecyclerView | |
android:id="@+id/menu_licenses" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
diff --git a/app/src/main/res/layout/fragment_time_zone.xml b/app/src/main/res/layout/fragment_time_zone.xml | |
index 8a89a83..3459571 100644 | |
--- a/app/src/main/res/layout/fragment_time_zone.xml | |
+++ b/app/src/main/res/layout/fragment_time_zone.xml | |
@@ -8,7 +8,7 @@ | |
android:layout_height="match_parent" | |
> | |
- <android.support.v7.widget.CardView | |
+ <androidx.cardview.widget.CardView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="4dp" | |
@@ -61,9 +61,9 @@ | |
/> | |
</LinearLayout> | |
- </android.support.v7.widget.CardView> | |
+ </androidx.cardview.widget.CardView> | |
- <android.support.v7.widget.RecyclerView | |
+ <androidx.recyclerview.widget.RecyclerView | |
android:id="@+id/time_zones" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
diff --git a/app/src/main/res/layout/item_license_information.xml b/app/src/main/res/layout/item_license_information.xml | |
index 0fd1af3..aa568d9 100644 | |
--- a/app/src/main/res/layout/item_license_information.xml | |
+++ b/app/src/main/res/layout/item_license_information.xml | |
@@ -1,5 +1,5 @@ | |
<?xml version="1.0" encoding="utf-8"?> | |
-<android.support.v7.widget.CardView | |
+<androidx.cardview.widget.CardView | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
@@ -15,4 +15,4 @@ | |
android:layout_margin="8dp" | |
android:textSize="16sp" | |
/> | |
-</android.support.v7.widget.CardView> | |
\ No newline at end of file | |
+</androidx.cardview.widget.CardView> | |
\ No newline at end of file | |
diff --git a/app/src/main/res/layout/item_time_zone.xml b/app/src/main/res/layout/item_time_zone.xml | |
index e90ca9d..a676492 100644 | |
--- a/app/src/main/res/layout/item_time_zone.xml | |
+++ b/app/src/main/res/layout/item_time_zone.xml | |
@@ -1,5 +1,5 @@ | |
<?xml version="1.0" encoding="utf-8"?> | |
-<android.support.v7.widget.CardView | |
+<androidx.cardview.widget.CardView | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
@@ -35,4 +35,4 @@ | |
/> | |
</LinearLayout> | |
-</android.support.v7.widget.CardView> | |
\ No newline at end of file | |
+</androidx.cardview.widget.CardView> | |
\ No newline at end of file | |
diff --git a/build.gradle b/build.gradle | |
index c8e0e96..8c416c0 100644 | |
--- a/build.gradle | |
+++ b/build.gradle | |
@@ -1,14 +1,14 @@ | |
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
- ext.kotlin_version = '1.2.31' | |
+ ext.kotlin_version = '1.2.51' | |
repositories { | |
google() | |
jcenter() | |
maven { url 'https://maven.fabric.io/public' } | |
} | |
dependencies { | |
- classpath 'com.android.tools.build:gradle:3.1.3' | |
+ classpath 'com.android.tools.build:gradle:3.2.0' | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |
classpath 'com.google.gms:google-services:4.1.0' | |
classpath 'io.fabric.tools:gradle:1.25.4' | |
diff --git a/gradle.properties b/gradle.properties | |
index 743d692..8de5058 100644 | |
--- a/gradle.properties | |
+++ b/gradle.properties | |
@@ -6,6 +6,8 @@ | |
# http://www.gradle.org/docs/current/userguide/build_environment.html | |
# Specifies the JVM arguments used for the daemon process. | |
# The setting is particularly useful for tweaking memory settings. | |
+android.enableJetifier=true | |
+android.useAndroidX=true | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment