mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-03 18:41:47 +01:00
Removing kotlin extensions + adding jetbrains kotlin
also bumping up to kotlin 1.4.20 and using jsetbrains kotlin for parcelize (needed for mass migration) With this we can close #684 because we are TRULY finished
This commit is contained in:
parent
419e4832ea
commit
abea51c805
@ -11,12 +11,10 @@ import com.bluelinelabs.conductor.Controller
|
|||||||
import com.bluelinelabs.conductor.ControllerChangeHandler
|
import com.bluelinelabs.conductor.ControllerChangeHandler
|
||||||
import com.bluelinelabs.conductor.ControllerChangeType
|
import com.bluelinelabs.conductor.ControllerChangeType
|
||||||
import com.bluelinelabs.conductor.RestoreViewOnCreateController
|
import com.bluelinelabs.conductor.RestoreViewOnCreateController
|
||||||
import kotlinx.android.extensions.LayoutContainer
|
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
abstract class BaseController<VB : ViewBinding>(bundle: Bundle? = null) :
|
abstract class BaseController<VB : ViewBinding>(bundle: Bundle? = null) :
|
||||||
RestoreViewOnCreateController(bundle),
|
RestoreViewOnCreateController(bundle) {
|
||||||
LayoutContainer {
|
|
||||||
|
|
||||||
lateinit var binding: VB
|
lateinit var binding: VB
|
||||||
|
|
||||||
@ -46,9 +44,6 @@ abstract class BaseController<VB : ViewBinding>(bundle: Bundle? = null) :
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override val containerView: View?
|
|
||||||
get() = view
|
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup, savedViewState: Bundle?): View {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup, savedViewState: Bundle?): View {
|
||||||
binding = createBinding(inflater)
|
binding = createBinding(inflater)
|
||||||
return binding.root
|
return binding.root
|
||||||
|
@ -3,15 +3,10 @@ package eu.kanade.tachiyomi.ui.base.holder
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import eu.davidea.flexibleadapter.FlexibleAdapter
|
import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||||
import eu.davidea.viewholders.FlexibleViewHolder
|
import eu.davidea.viewholders.FlexibleViewHolder
|
||||||
import kotlinx.android.extensions.LayoutContainer
|
|
||||||
|
|
||||||
abstract class BaseFlexibleViewHolder(
|
abstract class BaseFlexibleViewHolder(
|
||||||
view: View,
|
view: View,
|
||||||
adapter: FlexibleAdapter<*>,
|
adapter: FlexibleAdapter<*>,
|
||||||
stickyHeader: Boolean = false
|
stickyHeader: Boolean = false
|
||||||
) :
|
) :
|
||||||
FlexibleViewHolder(view, adapter, stickyHeader), LayoutContainer {
|
FlexibleViewHolder(view, adapter, stickyHeader)
|
||||||
|
|
||||||
override val containerView: View?
|
|
||||||
get() = itemView
|
|
||||||
}
|
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
package eu.kanade.tachiyomi.ui.base.holder
|
package eu.kanade.tachiyomi.ui.base.holder
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import kotlinx.android.extensions.LayoutContainer
|
|
||||||
|
|
||||||
abstract class BaseViewHolder(view: View) : androidx.recyclerview.widget.RecyclerView.ViewHolder(view), LayoutContainer {
|
abstract class BaseViewHolder(view: View) : androidx.recyclerview.widget.RecyclerView.ViewHolder(view)
|
||||||
|
|
||||||
override val containerView: View?
|
|
||||||
get() = itemView
|
|
||||||
}
|
|
||||||
|
@ -9,7 +9,7 @@ import eu.davidea.flexibleadapter.items.IFlexible
|
|||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
import eu.kanade.tachiyomi.source.SourceManager
|
import eu.kanade.tachiyomi.source.SourceManager
|
||||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||||
import kotlinx.android.parcel.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
|
|
||||||
class MigrationSourceItem(val source: HttpSource, var sourceEnabled: Boolean) : AbstractFlexibleItem<MigrationSourceHolder>() {
|
class MigrationSourceItem(val source: HttpSource, var sourceEnabled: Boolean) : AbstractFlexibleItem<MigrationSourceHolder>() {
|
||||||
override fun getLayoutRes() = R.layout.migration_source_item
|
override fun getLayoutRes() = R.layout.migration_source_item
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id(Plugins.kotlinter.name) version Plugins.kotlinter.version
|
id(Plugins.kotlinter.name) version Plugins.kotlinter.version
|
||||||
id(Plugins.gradleVersions.name) version Plugins.gradleVersions.version
|
id(Plugins.gradleVersions.name) version Plugins.gradleVersions.version
|
||||||
|
id(Plugins.jetbrainsKotlin) version Versions.kotlin apply false
|
||||||
}
|
}
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
@ -25,7 +26,6 @@ buildscript {
|
|||||||
classpath(LegacyPluginClassPath.fireBaseCrashlytics)
|
classpath(LegacyPluginClassPath.fireBaseCrashlytics)
|
||||||
classpath(LegacyPluginClassPath.androidGradlePlugin)
|
classpath(LegacyPluginClassPath.androidGradlePlugin)
|
||||||
classpath(LegacyPluginClassPath.googleServices)
|
classpath(LegacyPluginClassPath.googleServices)
|
||||||
classpath(LegacyPluginClassPath.kotlinExtensions)
|
|
||||||
classpath(LegacyPluginClassPath.kotlinPlugin)
|
classpath(LegacyPluginClassPath.kotlinPlugin)
|
||||||
classpath(LegacyPluginClassPath.aboutLibraries)
|
classpath(LegacyPluginClassPath.aboutLibraries)
|
||||||
classpath(LegacyPluginClassPath.kotlinSerializations)
|
classpath(LegacyPluginClassPath.kotlinSerializations)
|
||||||
|
@ -53,7 +53,7 @@ object Versions {
|
|||||||
const val injekt = "65b0440"
|
const val injekt = "65b0440"
|
||||||
const val jsoup = "1.13.1"
|
const val jsoup = "1.13.1"
|
||||||
const val junit = "4.13"
|
const val junit = "4.13"
|
||||||
const val kotlin = "1.4.10"
|
const val kotlin = "1.4.20"
|
||||||
const val kotlinCoroutines = "1.3.9"
|
const val kotlinCoroutines = "1.3.9"
|
||||||
const val kotlinSerialization = "1.0.1"
|
const val kotlinSerialization = "1.0.1"
|
||||||
const val kotson = "2.5.0"
|
const val kotson = "2.5.0"
|
||||||
@ -98,7 +98,6 @@ object LegacyPluginClassPath {
|
|||||||
const val aboutLibraries = "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:${Versions.aboutLibraries}"
|
const val aboutLibraries = "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:${Versions.aboutLibraries}"
|
||||||
const val androidGradlePlugin = "com.android.tools.build:gradle:${Versions.androidGradlePlugin}"
|
const val androidGradlePlugin = "com.android.tools.build:gradle:${Versions.androidGradlePlugin}"
|
||||||
const val googleServices = "com.google.gms:google-services:${Versions.googleServices}"
|
const val googleServices = "com.google.gms:google-services:${Versions.googleServices}"
|
||||||
const val kotlinExtensions = "org.jetbrains.kotlin:kotlin-android-extensions:${Versions.kotlin}"
|
|
||||||
const val kotlinPlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
|
const val kotlinPlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
|
||||||
const val kotlinSerializations = "org.jetbrains.kotlin:kotlin-serialization:${Versions.kotlin}"
|
const val kotlinSerializations = "org.jetbrains.kotlin:kotlin-serialization:${Versions.kotlin}"
|
||||||
const val fireBaseCrashlytics = "com.google.firebase:firebase-crashlytics-gradle:2.3.0"
|
const val fireBaseCrashlytics = "com.google.firebase:firebase-crashlytics-gradle:2.3.0"
|
||||||
@ -120,8 +119,10 @@ object Plugins {
|
|||||||
const val firebaseCrashlytics = "com.google.firebase.crashlytics"
|
const val firebaseCrashlytics = "com.google.firebase.crashlytics"
|
||||||
const val googleServices = "com.google.gms.google-services"
|
const val googleServices = "com.google.gms.google-services"
|
||||||
const val kapt = "kapt"
|
const val kapt = "kapt"
|
||||||
|
const val kotlinParcelize = "kotlin-parcelize"
|
||||||
const val kotlinAndroid = "android"
|
const val kotlinAndroid = "android"
|
||||||
const val kotlinExtensions = "android.extensions"
|
const val kotlinExtensions = "android.extensions"
|
||||||
|
const val jetbrainsKotlin = "org.jetbrains.kotlin.android"
|
||||||
const val kotlinSerialization = "org.jetbrains.kotlin.plugin.serialization"
|
const val kotlinSerialization = "org.jetbrains.kotlin.plugin.serialization"
|
||||||
val gradleVersions = PluginClass("com.github.ben-manes.versions", Versions.gradleVersions)
|
val gradleVersions = PluginClass("com.github.ben-manes.versions", Versions.gradleVersions)
|
||||||
val ktLint = PluginClass("org.jlleitschuh.gradle.ktlint", Versions.ktlint)
|
val ktLint = PluginClass("org.jlleitschuh.gradle.ktlint", Versions.ktlint)
|
||||||
@ -144,7 +145,6 @@ object Configs {
|
|||||||
object BuildPluginsVersion {
|
object BuildPluginsVersion {
|
||||||
const val AGP = "com.android.tools.build:gradle:4.1.3"
|
const val AGP = "com.android.tools.build:gradle:4.1.3"
|
||||||
const val KOTLIN = "1.4.10"
|
const val KOTLIN = "1.4.10"
|
||||||
const val ANDROID_EXTENSIONS = "org.jetbrains.kotlin:kotlin-android-extensions:$KOTLIN"
|
|
||||||
const val KOTLIN_GRADLE = "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN"
|
const val KOTLIN_GRADLE = "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN"
|
||||||
const val KOTLINTER = "3.3.0"
|
const val KOTLINTER = "3.3.0"
|
||||||
const val GOOGLE_SERVICES = "com.google.gms:google-services:4.3.3"
|
const val GOOGLE_SERVICES = "com.google.gms:google-services:4.3.3"
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
<code_scheme name="Project" version="173">
|
<code_scheme name="Project" version="173">
|
||||||
<JetCodeStyleSettings>
|
<JetCodeStyleSettings>
|
||||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
|
||||||
<value>
|
|
||||||
<package name="kotlinx.android.synthetic" withSubpackages="true" static="false" />
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="2147483647" />
|
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="2147483647" />
|
||||||
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="2147483647" />
|
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="2147483647" />
|
||||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||||
|
Loading…
Reference in New Issue
Block a user