From 75c41b645a318eb86f5303f109021ed189f00a70 Mon Sep 17 00:00:00 2001 From: len Date: Sat, 23 Sep 2017 17:14:04 +0200 Subject: [PATCH] Target sdk 26. Dependency updates. --- app/build.gradle | 39 +++++++------------ .../tachiyomi/ui/catalogue/ProgressItem.kt | 4 +- .../ui/catalogue/filter/CheckboxItem.kt | 8 ++-- .../ui/catalogue/filter/GroupItem.kt | 10 ++--- .../ui/catalogue/filter/HeaderItem.kt | 6 +-- .../ui/catalogue/filter/SectionItems.kt | 24 ++++-------- .../ui/catalogue/filter/SelectItem.kt | 10 ++--- .../ui/catalogue/filter/SeparatorItem.kt | 6 +-- .../ui/catalogue/filter/SortGroup.kt | 6 +-- .../tachiyomi/ui/catalogue/filter/SortItem.kt | 9 ++--- .../tachiyomi/ui/catalogue/filter/TextItem.kt | 10 ++--- .../ui/catalogue/filter/TriStateItem.kt | 8 ++-- .../kanade/tachiyomi/ui/main/MainActivity.kt | 2 +- .../ui/manga/track/SetTrackChaptersDialog.kt | 4 +- .../ui/manga/track/SetTrackScoreDialog.kt | 4 +- .../tachiyomi/ui/recent_updates/DateItem.kt | 2 +- .../kanade/tachiyomi/util/ViewExtensions.kt | 2 +- .../tachiyomi/widget/SimpleNavigationView.kt | 14 +++---- app/src/main/res/menu/menu_navigation.xml | 4 -- 19 files changed, 67 insertions(+), 105 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9564168e1c..f682e58d0a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,14 +29,14 @@ ext { } android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" + compileSdkVersion 26 + buildToolsVersion "26.0.1" publishNonDefault true defaultConfig { applicationId "eu.kanade.tachiyomi" minSdkVersion 16 - targetSdkVersion 25 + targetSdkVersion 26 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" versionCode 26 versionName "0.6.3" @@ -102,12 +102,13 @@ dependencies { compile 'com.github.inorichi:junrar-android:634c1f5' // Android support library - final support_library_version = '25.4.0' + final support_library_version = '26.1.0' compile "com.android.support:support-v4:$support_library_version" compile "com.android.support:appcompat-v7:$support_library_version" compile "com.android.support:cardview-v7:$support_library_version" compile "com.android.support:design:$support_library_version" compile "com.android.support:recyclerview-v7:$support_library_version" + compile "com.android.support:preference-v7:$support_library_version" compile "com.android.support:support-annotations:$support_library_version" compile "com.android.support:customtabs:$support_library_version" @@ -117,13 +118,13 @@ dependencies { // ReactiveX compile 'io.reactivex:rxandroid:1.2.1' - compile 'io.reactivex:rxjava:1.3.0' + compile 'io.reactivex:rxjava:1.3.2' compile 'com.jakewharton.rxrelay:rxrelay:1.2.0' compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.2' compile 'com.github.pwittchen:reactivenetwork:0.7.0' // Network client - compile "com.squareup.okhttp3:okhttp:3.8.1" + compile "com.squareup.okhttp3:okhttp:3.9.0" compile 'com.squareup.okio:okio:1.13.0' // REST @@ -133,14 +134,14 @@ dependencies { compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version" // JSON - compile 'com.google.code.gson:gson:2.8.1' + compile 'com.google.code.gson:gson:2.8.2' compile 'com.github.salomonbrys.kotson:kotson:2.5.0' // YAML compile 'com.github.bmoliveira:snake-yaml:v1.18-android' // JavaScript engine - compile 'com.squareup.duktape:duktape-android:1.1.0' + compile 'com.squareup.duktape:duktape-android:1.2.0' // Disk compile 'com.jakewharton:disklrucache:2.0.2' @@ -151,7 +152,7 @@ dependencies { // Job scheduling compile 'com.evernote:android-job:1.1.11' - compile 'com.google.android.gms:play-services-gcm:11.0.1' + compile 'com.google.android.gms:play-services-gcm:11.4.0' // Changelog compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0' @@ -188,14 +189,16 @@ dependencies { compile 'eu.davidea:flexible-adapter:5.0.0-rc1' compile 'com.nononsenseapps:filepicker:2.5.2' compile 'com.github.amulyakhare:TextDrawable:558677e' - compile 'com.afollestad.material-dialogs:core:0.9.4.5' + compile('com.afollestad.material-dialogs:core:0.9.4.7') { + exclude group: "com.android.support", module: "support-v13" + } compile 'me.zhanghai.android.systemuihelper:library:1.0.0' compile 'com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.0.4' compile 'com.github.mthli:Slice:v1.2' // Conductor compile "com.bluelinelabs:conductor:2.1.4" - compile 'com.github.inorichi:conductor-support-preference:9e36460' + compile 'com.github.inorichi:conductor-support-preference:26.0.2' // RxBindings final rxbindings_version = '1.0.1' @@ -218,7 +221,7 @@ dependencies { } buildscript { - ext.kotlin_version = '1.1.4' + ext.kotlin_version = '1.1.50' repositories { mavenCentral() } @@ -231,18 +234,6 @@ repositories { mavenCentral() } -// Workaround to force a support lib version -configurations.all { - resolutionStrategy.eachDependency { details -> - def requested = details.requested - if (requested.group == 'com.android.support') { - if (!requested.name.startsWith("multidex")) { - details.useVersion '25.4.0' - } - } - } -} - // add support for placeholders in resource files //https://code.google.com/p/android/issues/detail?id=69224 def replacePlaceholdersInFile(basePath, fileName, placeholders) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/ProgressItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/ProgressItem.kt index 1f1d75b720..5c79c954fd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/ProgressItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/ProgressItem.kt @@ -45,8 +45,8 @@ class ProgressItem : AbstractFlexibleItem() { class Holder(view: View, adapter: FlexibleAdapter<*>) : FlexibleViewHolder(view, adapter) { - val progressBar = view.findViewById(R.id.progress_bar) as ProgressBar - val progressMessage = view.findViewById(R.id.progress_message) as TextView + val progressBar: ProgressBar = view.findViewById(R.id.progress_bar) + val progressMessage: TextView = view.findViewById(R.id.progress_message) } } \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/CheckboxItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/CheckboxItem.kt index d9bab855ea..0efe58620b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/CheckboxItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/CheckboxItem.kt @@ -32,10 +32,8 @@ open class CheckboxItem(val filter: Filter.CheckBox) : AbstractFlexibleItem) : FlexibleViewHolder(view, adapter) { - val check = itemView.findViewById(R.id.nav_view_item) as CheckBox + val check: CheckBox = itemView.findViewById(R.id.nav_view_item) } } \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/GroupItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/GroupItem.kt index c023ce5962..5e77f5a81e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/GroupItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/GroupItem.kt @@ -34,10 +34,8 @@ class GroupItem(val filter: Filter.Group<*>) : AbstractExpandableHeaderItem) : AbstractExpandableHeaderItem) : ExpandableViewHolder(view, adapter, true) { - val title = itemView.findViewById(R.id.title) as TextView - val icon = itemView.findViewById(R.id.expand_icon) as ImageView + val title: TextView = itemView.findViewById(R.id.title) + val icon: ImageView = itemView.findViewById(R.id.expand_icon) override fun shouldNotifyParentOnClick(): Boolean { return true diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/HeaderItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/HeaderItem.kt index a766121675..90218fff69 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/HeaderItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/HeaderItem.kt @@ -29,10 +29,8 @@ class HeaderItem(val filter: Filter.Header) : AbstractHeaderItem) : SelectItem(filter), ISection override fun equals(other: Any?): Boolean { if (this === other) return true - if (other is SelectSectionItem) { - return filter == other.filter - } - return false + if (javaClass != other?.javaClass) return false + return filter == (other as SelectSectionItem).filter } override fun hashCode(): Int { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SelectItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SelectItem.kt index ad840475e7..1db1470951 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SelectItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SelectItem.kt @@ -40,10 +40,8 @@ open class SelectItem(val filter: Filter.Select<*>) : AbstractFlexibleItem) : AbstractFlexibleItem) : FlexibleViewHolder(view, adapter) { - val text = itemView.findViewById(R.id.nav_view_item_text) as TextView - val spinner = itemView.findViewById(R.id.nav_view_item) as Spinner + val text: TextView = itemView.findViewById(R.id.nav_view_item_text) + val spinner: Spinner = itemView.findViewById(R.id.nav_view_item) } } \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SeparatorItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SeparatorItem.kt index 8420f2f7de..3291b33427 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SeparatorItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SeparatorItem.kt @@ -27,10 +27,8 @@ class SeparatorItem(val filter: Filter.Separator) : AbstractHeaderItem) : FlexibleViewHolder(view, adapter) { - val text = itemView.findViewById(R.id.nav_view_item) as CheckedTextView + val text: CheckedTextView = itemView.findViewById(R.id.nav_view_item) } } \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TextItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TextItem.kt index 9d4321dcb3..56813eb803 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TextItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TextItem.kt @@ -34,10 +34,8 @@ open class TextItem(val filter: Filter.Text) : AbstractFlexibleItem) : FlexibleViewHolder(view, adapter) { - val wrapper = itemView.findViewById(R.id.nav_view_item_wrapper) as TextInputLayout - val edit = itemView.findViewById(R.id.nav_view_item) as EditText + val wrapper: TextInputLayout = itemView.findViewById(R.id.nav_view_item_wrapper) + val edit: EditText = itemView.findViewById(R.id.nav_view_item) } } \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TriStateItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TriStateItem.kt index 0c834b3373..eacf255dab 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TriStateItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TriStateItem.kt @@ -51,10 +51,8 @@ open class TriStateItem(val filter: Filter.TriState) : AbstractFlexibleItem) : FlexibleViewHolder(view, adapter) { - val text = itemView.findViewById(TR.id.nav_view_item) as CheckedTextView + val text: CheckedTextView = itemView.findViewById(TR.id.nav_view_item) init { // Align with native checkbox diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 7db5474c41..9815477d16 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -99,7 +99,7 @@ class MainActivity : BaseActivity() { true } - val container = findViewById(R.id.controller_container) as ViewGroup + val container: ViewGroup = findViewById(R.id.controller_container) router = Conductor.attachRouter(this, container, savedInstanceState) if (!router.hasRootController()) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackChaptersDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackChaptersDialog.kt index 6b1bf0a227..249d965624 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackChaptersDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackChaptersDialog.kt @@ -43,7 +43,7 @@ class SetTrackChaptersDialog : DialogController val view = dialog.customView if (view != null) { // Remove focus to update selected number - val np = view.findViewById(R.id.chapters_picker) as NumberPicker + val np: NumberPicker = view.findViewById(R.id.chapters_picker) np.clearFocus() (targetController as? Listener)?.setChaptersRead(item, np.value) @@ -53,7 +53,7 @@ class SetTrackChaptersDialog : DialogController val view = dialog.customView if (view != null) { - val np = view.findViewById(R.id.chapters_picker) as NumberPicker + val np: NumberPicker = view.findViewById(R.id.chapters_picker) // Set initial value np.value = item.track?.last_chapter_read ?: 0 // Don't allow to go from 0 to 9999 diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackScoreDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackScoreDialog.kt index 80931940a3..44734f64b0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackScoreDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackScoreDialog.kt @@ -43,7 +43,7 @@ class SetTrackScoreDialog : DialogController val view = dialog.customView if (view != null) { // Remove focus to update selected number - val np = view.findViewById(R.id.score_picker) as NumberPicker + val np: NumberPicker = view.findViewById(R.id.score_picker) np.clearFocus() (targetController as? Listener)?.setScore(item, np.value) @@ -53,7 +53,7 @@ class SetTrackScoreDialog : DialogController val view = dialog.customView if (view != null) { - val np = view.findViewById(R.id.score_picker) as NumberPicker + val np: NumberPicker = view.findViewById(R.id.score_picker) val scores = item.service.getScoreList().toTypedArray() np.maxValue = scores.size - 1 np.displayedValues = scores diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/DateItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/DateItem.kt index de64e85b08..06bf3786c3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/DateItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/DateItem.kt @@ -41,7 +41,7 @@ class DateItem(val date: Date) : AbstractHeaderItem() { private val now = Date().time - val section_text = view.findViewById(R.id.section_text) as TextView + val section_text: TextView = view.findViewById(R.id.section_text) fun bind(item: DateItem) { section_text.text = DateUtils.getRelativeTimeSpanString(item.date.time, now, DateUtils.DAY_IN_MILLIS) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ViewExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/ViewExtensions.kt index 0bd1ce9a21..e3f6bbb018 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ViewExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/ViewExtensions.kt @@ -28,7 +28,7 @@ fun View.getCoordinates() = Point((left + right) / 2, (top + bottom) / 2) */ inline fun View.snack(message: String, length: Int = Snackbar.LENGTH_LONG, f: Snackbar.() -> Unit): Snackbar { val snack = Snackbar.make(this, message, length) - val textView = snack.view.findViewById(android.support.design.R.id.snackbar_text) as TextView + val textView: TextView = snack.view.findViewById(android.support.design.R.id.snackbar_text) textView.setTextColor(Color.WHITE) snack.f() snack.show() diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt index 40b1cfa010..8df9fd2526 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt @@ -104,7 +104,7 @@ open class SimpleNavigationView @JvmOverloads constructor( class RadioHolder(parent: ViewGroup, listener: View.OnClickListener?) : ClickableHolder(parent.inflate(TR.layout.navigation_view_radio), listener) { - val radio = itemView.findViewById(TR.id.nav_view_item) as RadioButton + val radio: RadioButton = itemView.findViewById(TR.id.nav_view_item) } /** @@ -113,7 +113,7 @@ open class SimpleNavigationView @JvmOverloads constructor( class CheckboxHolder(parent: ViewGroup, listener: View.OnClickListener?) : ClickableHolder(parent.inflate(TR.layout.navigation_view_checkbox), listener) { - val check = itemView.findViewById(TR.id.nav_view_item) as CheckBox + val check: CheckBox = itemView.findViewById(TR.id.nav_view_item) } /** @@ -122,21 +122,21 @@ open class SimpleNavigationView @JvmOverloads constructor( class MultiStateHolder(parent: ViewGroup, listener: View.OnClickListener?) : ClickableHolder(parent.inflate(TR.layout.navigation_view_checkedtext), listener) { - val text = itemView.findViewById(TR.id.nav_view_item) as CheckedTextView + val text: CheckedTextView = itemView.findViewById(TR.id.nav_view_item) } class SpinnerHolder(parent: ViewGroup, listener: OnClickListener? = null) : ClickableHolder(parent.inflate(TR.layout.navigation_view_spinner), listener) { - val text = itemView.findViewById(TR.id.nav_view_item_text) as TextView - val spinner = itemView.findViewById(TR.id.nav_view_item) as Spinner + val text: TextView = itemView.findViewById(TR.id.nav_view_item_text) + val spinner: Spinner = itemView.findViewById(TR.id.nav_view_item) } class EditTextHolder(parent: ViewGroup) : Holder(parent.inflate(TR.layout.navigation_view_text)) { - val wrapper = itemView.findViewById(TR.id.nav_view_item_wrapper) as TextInputLayout - val edit = itemView.findViewById(TR.id.nav_view_item) as EditText + val wrapper: TextInputLayout = itemView.findViewById(TR.id.nav_view_item_wrapper) + val edit: EditText = itemView.findViewById(TR.id.nav_view_item) } protected companion object { diff --git a/app/src/main/res/menu/menu_navigation.xml b/app/src/main/res/menu/menu_navigation.xml index 06e2bd68e1..3599d8ba60 100644 --- a/app/src/main/res/menu/menu_navigation.xml +++ b/app/src/main/res/menu/menu_navigation.xml @@ -19,10 +19,6 @@ android:id="@+id/nav_drawer_catalogues" android:icon="@drawable/ic_explore_black_24dp" android:title="@string/label_catalogues" /> -