More deps updates

This commit is contained in:
Philipp Heckel 2022-11-18 19:54:32 -05:00
parent 51dfd8edba
commit 73c6047280
6 changed files with 9 additions and 8 deletions

View file

@ -59,6 +59,9 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs += [
'-Xjvm-default=all-compatibility' // https://stackoverflow.com/a/71234042/1440785
]
}
}
@ -67,8 +70,8 @@ dependencies {
implementation "androidx.appcompat:appcompat:1.4.2"
implementation "androidx.core:core-ktx:1.9.0"
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
implementation "androidx.activity:activity-ktx:1.4.0"
implementation "androidx.fragment:fragment-ktx:1.4.1"
implementation "androidx.activity:activity-ktx:1.6.1"
implementation "androidx.fragment:fragment-ktx:1.5.4"
implementation "androidx.work:work-runtime-ktx:2.7.1"
implementation 'androidx.preference:preference-ktx:1.2.0'

View file

@ -24,7 +24,6 @@ object DownloadManager {
DownloadType.ATTACHMENT -> enqueueAttachment(context, notificationId, userAction)
DownloadType.ICON -> enqueueIcon(context, notificationId)
DownloadType.BOTH -> enqueueAttachmentAndIcon(context, notificationId, userAction)
else -> Log.w(DownloadManager.TAG, "This should never happen. No download type given")
}
}

View file

@ -21,7 +21,7 @@ class DetailViewModel(private val repository: Repository) : ViewModel() {
class DetailViewModelFactory(private val repository: Repository) : ViewModelProvider.Factory {
@Suppress("UNCHECKED_CAST")
override fun <T : ViewModel?> create(modelClass: Class<T>) =
override fun <T : ViewModel> create(modelClass: Class<T>): T =
with(modelClass){
when {
isAssignableFrom(DetailViewModel::class.java) -> DetailViewModel(repository) as T

View file

@ -51,7 +51,7 @@ class SubscriptionsViewModel(private val repository: Repository) : ViewModel() {
class SubscriptionsViewModelFactory(private val repository: Repository) : ViewModelProvider.Factory {
@Suppress("UNCHECKED_CAST")
override fun <T : ViewModel?> create(modelClass: Class<T>) =
override fun <T : ViewModel> create(modelClass: Class<T>): T =
with(modelClass){
when {
isAssignableFrom(SubscriptionsViewModel::class.java) -> SubscriptionsViewModel(repository) as T

View file

@ -587,10 +587,9 @@ class SettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.OnPrefere
throw Exception("Unexpected response ${response.code}")
}
val body = response.body?.string()?.trim()
if (body == null || body.isEmpty()) throw Exception("Return body is empty")
if (body.isNullOrEmpty()) throw Exception("Return body is empty")
Log.d(TAG, "Logs uploaded successfully: $body")
val resp = gson.fromJson(body.toString(), NopasteResponse::class.java)
val context = context ?: return@launch
requireActivity().runOnUiThread {
val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val clip = ClipData.newPlainText("logs URL", resp.url)

View file

@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.6.21'
repositories {
google()
jcenter()