upgrade dependencies
This commit is contained in:
parent
ea0bbffbc5
commit
4bf3038c47
|
@ -47,27 +47,27 @@ tasks {
|
|||
}
|
||||
|
||||
ktlint {
|
||||
version.set("0.37.1")
|
||||
version.set("0.38.1")
|
||||
disabledRules.set(setOf("import-ordering"))
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
val lifecycleVersion = "2.3.0-alpha04"
|
||||
val roomVersion = "2.3.0-alpha01"
|
||||
val okHttpVersion = "4.7.2"
|
||||
val lifecycleVersion = "2.3.0-alpha07"
|
||||
val roomVersion = "2.3.0-alpha02"
|
||||
val okHttpVersion = "4.8.1"
|
||||
val retrofitVersion = "2.9.0"
|
||||
val moshiVersion = "1.9.2"
|
||||
val daggerVersion = "2.27"
|
||||
val moshiVersion = "1.10.0"
|
||||
val daggerVersion = "2.28.3"
|
||||
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.0")
|
||||
|
||||
implementation("androidx.core:core:1.3.1")
|
||||
implementation("androidx.appcompat:appcompat:1.3.0-alpha01")
|
||||
implementation("androidx.activity:activity-ktx:1.2.0-alpha07")
|
||||
implementation("androidx.fragment:fragment-ktx:1.3.0-alpha07")
|
||||
implementation("androidx.core:core-ktx:1.5.0-alpha02")
|
||||
implementation("androidx.appcompat:appcompat:1.3.0-alpha02")
|
||||
implementation("androidx.activity:activity-ktx:1.2.0-alpha08")
|
||||
implementation("androidx.fragment:fragment-ktx:1.3.0-alpha08")
|
||||
implementation("com.google.android.material:material:1.3.0-alpha02")
|
||||
implementation("androidx.constraintlayout:constraintlayout:1.1.3")
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.0.1")
|
||||
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
|
||||
implementation("androidx.recyclerview:recyclerview:1.2.0-alpha05")
|
||||
implementation("androidx.annotation:annotation:1.1.0")
|
||||
|
@ -77,7 +77,7 @@ dependencies {
|
|||
implementation("androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion")
|
||||
implementation("androidx.preference:preference:1.1.1")
|
||||
implementation("androidx.emoji:emoji-bundled:1.1.0")
|
||||
implementation("androidx.paging:paging-runtime-ktx:3.0.0-alpha04")
|
||||
implementation("androidx.paging:paging-runtime-ktx:3.0.0-alpha05")
|
||||
implementation("androidx.viewpager2:viewpager2:1.0.0")
|
||||
|
||||
implementation("androidx.room:room-ktx:$roomVersion")
|
||||
|
@ -101,7 +101,7 @@ dependencies {
|
|||
|
||||
implementation("me.relex:circleindicator:2.1.4")
|
||||
|
||||
implementation("io.coil-kt:coil:0.11.0")
|
||||
implementation("io.coil-kt:coil:1.0.0-rc2")
|
||||
|
||||
implementation("com.github.connyduck:sparkbutton:4.0.0")
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import at.connyduck.pixelcat.components.util.extension.hide
|
|||
import at.connyduck.pixelcat.components.util.extension.show
|
||||
import at.connyduck.pixelcat.databinding.ItemAccountSelectionBinding
|
||||
import at.connyduck.pixelcat.db.entitity.AccountEntity
|
||||
import coil.api.load
|
||||
import coil.load
|
||||
import coil.transform.RoundedCornersTransformation
|
||||
|
||||
class AccountSelectionAdapter(
|
||||
|
|
|
@ -28,7 +28,7 @@ import at.connyduck.pixelcat.R
|
|||
import at.connyduck.pixelcat.components.util.BindingHolder
|
||||
import at.connyduck.pixelcat.databinding.ItemComposeImageBinding
|
||||
import at.connyduck.sparkbutton.helpers.Utils
|
||||
import coil.api.load
|
||||
import coil.load
|
||||
import java.io.File
|
||||
|
||||
interface OnImageActionClickListener {
|
||||
|
|
|
@ -28,7 +28,7 @@ import at.connyduck.pixelcat.components.util.extension.visible
|
|||
import at.connyduck.pixelcat.databinding.ItemProfileHeaderBinding
|
||||
import at.connyduck.pixelcat.model.Account
|
||||
import at.connyduck.pixelcat.model.Relationship
|
||||
import coil.api.load
|
||||
import coil.load
|
||||
import coil.transform.RoundedCornersTransformation
|
||||
import java.text.NumberFormat
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import at.connyduck.pixelcat.components.util.extension.show
|
|||
import at.connyduck.pixelcat.databinding.ItemProfileImageBinding
|
||||
import at.connyduck.pixelcat.model.Attachment
|
||||
import at.connyduck.pixelcat.model.Status
|
||||
import coil.api.load
|
||||
import coil.load
|
||||
|
||||
class ProfileImageAdapter(
|
||||
private val imageSizePx: Int
|
||||
|
|
|
@ -25,7 +25,7 @@ import androidx.recyclerview.widget.RecyclerView
|
|||
import at.connyduck.pixelcat.components.util.BindingHolder
|
||||
import at.connyduck.pixelcat.databinding.ItemTimelineImageBinding
|
||||
import at.connyduck.pixelcat.model.Attachment
|
||||
import coil.api.load
|
||||
import coil.load
|
||||
|
||||
class TimelineImageAdapter : RecyclerView.Adapter<BindingHolder<ItemTimelineImageBinding>>() {
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import at.connyduck.pixelcat.components.util.BindingHolder
|
|||
import at.connyduck.pixelcat.components.util.extension.visible
|
||||
import at.connyduck.pixelcat.databinding.ItemStatusBinding
|
||||
import at.connyduck.pixelcat.db.entitity.StatusEntity
|
||||
import coil.api.load
|
||||
import coil.load
|
||||
import coil.transform.RoundedCornersTransformation
|
||||
import java.text.DateFormat
|
||||
import java.text.SimpleDateFormat
|
||||
|
@ -85,7 +85,7 @@ fun BindingHolder<ItemStatusBinding>.bind(status: StatusEntity, displayWidth: In
|
|||
} else {
|
||||
it.meta.small.height.toFloat() / it.meta.small.width.toFloat()
|
||||
}
|
||||
}.max()?.coerceAtMost(1f) ?: 1f
|
||||
}.maxOrNull()?.coerceAtMost(1f) ?: 1f
|
||||
|
||||
binding.postImages.layoutParams.height = (displayWidth * maxImageRatio).toInt()
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import at.connyduck.pixelcat.components.timeline.TimelineDiffUtil
|
|||
import at.connyduck.pixelcat.components.util.BindingHolder
|
||||
import at.connyduck.pixelcat.databinding.ItemReplyBinding
|
||||
import at.connyduck.pixelcat.db.entitity.StatusEntity
|
||||
import coil.api.load
|
||||
import coil.load
|
||||
import coil.transform.RoundedCornersTransformation
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
|
|
|
@ -32,19 +32,32 @@ internal class NetworkResponseCall<S : Any>(
|
|||
) : Call<NetworkResponse<S>> {
|
||||
|
||||
override fun enqueue(callback: Callback<NetworkResponse<S>>) {
|
||||
return delegate.enqueue(object : Callback<S> {
|
||||
override fun onResponse(call: Call<S>, response: Response<S>) {
|
||||
val body = response.body()
|
||||
return delegate.enqueue(
|
||||
object : Callback<S> {
|
||||
override fun onResponse(call: Call<S>, response: Response<S>) {
|
||||
val body = response.body()
|
||||
|
||||
val errorbody = response.errorBody()?.string()
|
||||
if (response.isSuccessful) {
|
||||
if (body != null) {
|
||||
callback.onResponse(
|
||||
this@NetworkResponseCall,
|
||||
Response.success(NetworkResponse.Success(body))
|
||||
)
|
||||
val errorbody = response.errorBody()?.string()
|
||||
if (response.isSuccessful) {
|
||||
if (body != null) {
|
||||
callback.onResponse(
|
||||
this@NetworkResponseCall,
|
||||
Response.success(NetworkResponse.Success(body))
|
||||
)
|
||||
} else {
|
||||
// Response is successful but the body is null
|
||||
callback.onResponse(
|
||||
this@NetworkResponseCall,
|
||||
Response.success(
|
||||
NetworkResponse.Failure(
|
||||
NetworkResponseError.ApiError(
|
||||
response.code()
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
// Response is successful but the body is null
|
||||
callback.onResponse(
|
||||
this@NetworkResponseCall,
|
||||
Response.success(
|
||||
|
@ -56,33 +69,22 @@ internal class NetworkResponseCall<S : Any>(
|
|||
)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
callback.onResponse(
|
||||
this@NetworkResponseCall,
|
||||
Response.success(
|
||||
NetworkResponse.Failure(
|
||||
NetworkResponseError.ApiError(
|
||||
response.code()
|
||||
)
|
||||
}
|
||||
|
||||
override fun onFailure(call: Call<S>, throwable: Throwable) {
|
||||
Log.d("NetworkResponseCall", "Network response failed", throwable)
|
||||
val networkResponse = when (throwable) {
|
||||
is IOException -> NetworkResponse.Failure(
|
||||
NetworkResponseError.NetworkError(
|
||||
throwable
|
||||
)
|
||||
)
|
||||
)
|
||||
else -> NetworkResponse.Failure(NetworkResponseError.UnknownError(throwable))
|
||||
}
|
||||
callback.onResponse(this@NetworkResponseCall, Response.success(networkResponse))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailure(call: Call<S>, throwable: Throwable) {
|
||||
Log.d("NetworkResponseCall", "Network response failed", throwable)
|
||||
val networkResponse = when (throwable) {
|
||||
is IOException -> NetworkResponse.Failure(
|
||||
NetworkResponseError.NetworkError(
|
||||
throwable
|
||||
)
|
||||
)
|
||||
else -> NetworkResponse.Failure(NetworkResponseError.UnknownError(throwable))
|
||||
}
|
||||
callback.onResponse(this@NetworkResponseCall, Response.success(networkResponse))
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
override fun isExecuted() = delegate.isExecuted
|
||||
|
|
|
@ -28,20 +28,24 @@ class FragmentViewBindingDelegate<T : ViewBinding>(
|
|||
private var binding: T? = null
|
||||
|
||||
init {
|
||||
fragment.lifecycle.addObserver(object : DefaultLifecycleObserver {
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
fragment.viewLifecycleOwnerLiveData.observe(
|
||||
fragment,
|
||||
{ t ->
|
||||
t?.lifecycle?.addObserver(object : DefaultLifecycleObserver {
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
binding = null
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
fragment.lifecycle.addObserver(
|
||||
object : DefaultLifecycleObserver {
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
fragment.viewLifecycleOwnerLiveData.observe(
|
||||
fragment,
|
||||
{ t ->
|
||||
t?.lifecycle?.addObserver(
|
||||
object : DefaultLifecycleObserver {
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
binding = null
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
override fun getValue(thisRef: Fragment, property: KProperty<*>): T {
|
||||
|
|
Loading…
Reference in New Issue