LocaleSpoofFragment: Drop dependency upon kovenant

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2023-07-18 20:27:28 +05:30
parent 54824485fa
commit 9f084e901e

View File

@@ -20,19 +20,16 @@
package com.aurora.store.view.ui.spoof
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.aurora.store.R
import com.aurora.store.data.providers.SpoofProvider
import com.aurora.store.databinding.FragmentGenericRecyclerBinding
import com.aurora.store.util.Log
import com.aurora.extensions.toast
import com.aurora.store.view.epoxy.views.preference.LocaleViewModel_
import com.aurora.store.view.ui.commons.BaseFragment
import nl.komponents.kovenant.task
import nl.komponents.kovenant.ui.failUi
import nl.komponents.kovenant.ui.successUi
import java.util.*
@@ -43,6 +40,8 @@ class LocaleSpoofFragment : BaseFragment() {
private var locale: Locale = Locale.getDefault()
private val TAG = LocaleSpoofFragment::class.java.simpleName
companion object {
@JvmStatic
fun newInstance(): LocaleSpoofFragment {
@@ -76,12 +75,10 @@ class LocaleSpoofFragment : BaseFragment() {
if (spoofProvider.isLocaleSpoofEnabled())
locale = spoofProvider.getSpoofLocale()
task {
fetchAvailableLocales()
} successUi {
updateController(it)
} failUi {
Log.e("Could not get available locales")
try {
updateController(fetchAvailableLocales())
} catch (exception: Exception) {
Log.e(TAG, "Could not get available locales", exception)
}
}
@@ -120,4 +117,4 @@ class LocaleSpoofFragment : BaseFragment() {
requireContext().toast(R.string.spoof_apply)
spoofProvider.setSpoofLocale(locale)
}
}
}