Update gradle, kotlin and other dependencies (#2291)
* update gradle, kotlin and other dependencies * fix new warnings * remove unused import * update Proguard rules * add explicit dependency on Gson to get the newest version * remove debug flag from proguard rules again * fix typo
This commit is contained in:
parent
a000228165
commit
1586817c3d
15 changed files with 56 additions and 34 deletions
|
@ -165,17 +165,16 @@ class EditProfileActivity : BaseActivity(), Injectable {
|
|||
}
|
||||
snackbar.show()
|
||||
}
|
||||
is Loading -> { }
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.obtainInstance()
|
||||
viewModel.instanceData.observe(this) { result ->
|
||||
when (result) {
|
||||
is Success -> {
|
||||
val instance = result.data
|
||||
if (instance?.maxBioChars != null && instance.maxBioChars > 0) {
|
||||
binding.noteEditTextLayout.counterMaxLength = instance.maxBioChars
|
||||
}
|
||||
if (result is Success) {
|
||||
val instance = result.data
|
||||
if (instance?.maxBioChars != null && instance.maxBioChars > 0) {
|
||||
binding.noteEditTextLayout.counterMaxLength = instance.maxBioChars
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -278,6 +277,7 @@ class EditProfileActivity : BaseActivity(), Injectable {
|
|||
permissions: Array<String>,
|
||||
grantResults: IntArray
|
||||
) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||
when (requestCode) {
|
||||
PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE -> {
|
||||
if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
|
|
|
@ -68,7 +68,9 @@ import com.keylesspalace.tusky.interfaces.LinkListener
|
|||
import com.keylesspalace.tusky.interfaces.ReselectableFragment
|
||||
import com.keylesspalace.tusky.settings.PrefKeys
|
||||
import com.keylesspalace.tusky.util.DefaultTextWatcher
|
||||
import com.keylesspalace.tusky.util.Error
|
||||
import com.keylesspalace.tusky.util.LinkHelper
|
||||
import com.keylesspalace.tusky.util.Loading
|
||||
import com.keylesspalace.tusky.util.Success
|
||||
import com.keylesspalace.tusky.util.ThemeUtils
|
||||
import com.keylesspalace.tusky.util.emojify
|
||||
|
@ -351,6 +353,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
|
|||
.setAction(R.string.action_retry) { viewModel.refresh() }
|
||||
.show()
|
||||
}
|
||||
is Loading -> { }
|
||||
}
|
||||
}
|
||||
viewModel.relationshipData.observe(this) {
|
||||
|
|
|
@ -52,6 +52,7 @@ import kotlinx.coroutines.launch
|
|||
import java.io.IOException
|
||||
import javax.inject.Inject
|
||||
|
||||
@OptIn(ExperimentalPagingApi::class)
|
||||
class ConversationsFragment : SFragment(), StatusActionListener, Injectable, ReselectableFragment {
|
||||
|
||||
@Inject
|
||||
|
@ -72,7 +73,6 @@ class ConversationsFragment : SFragment(), StatusActionListener, Injectable, Res
|
|||
return inflater.inflate(R.layout.fragment_timeline, container, false)
|
||||
}
|
||||
|
||||
@ExperimentalPagingApi
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(view.context)
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import androidx.paging.RemoteMediator
|
|||
import com.keylesspalace.tusky.db.AppDatabase
|
||||
import com.keylesspalace.tusky.network.MastodonApi
|
||||
|
||||
@ExperimentalPagingApi
|
||||
@OptIn(ExperimentalPagingApi::class)
|
||||
class ConversationsRemoteMediator(
|
||||
private val accountId: Long,
|
||||
private val api: MastodonApi,
|
||||
|
|
|
@ -37,7 +37,7 @@ class ConversationsViewModel @Inject constructor(
|
|||
private val api: MastodonApi
|
||||
) : RxAwareViewModel() {
|
||||
|
||||
@ExperimentalPagingApi
|
||||
@OptIn(ExperimentalPagingApi::class)
|
||||
val conversationFlow = Pager(
|
||||
config = PagingConfig(pageSize = 10, enablePlaceholders = false, initialLoadSize = 20),
|
||||
remoteMediator = ConversationsRemoteMediator(accountManager.activeAccount!!.id, api, database),
|
||||
|
|
|
@ -81,7 +81,7 @@ class ScheduledTootActivity : BaseActivity(), ScheduledTootActionListener, Injec
|
|||
}
|
||||
|
||||
adapter.addLoadStateListener { loadState ->
|
||||
if (loadState.refresh is Error) {
|
||||
if (loadState.refresh is LoadState.Error) {
|
||||
binding.progressBar.hide()
|
||||
binding.errorMessageView.setup(R.drawable.elephant_error, R.string.error_generic) {
|
||||
refreshStatuses()
|
||||
|
|
|
@ -33,7 +33,7 @@ import com.keylesspalace.tusky.util.dec
|
|||
import kotlinx.coroutines.rx3.await
|
||||
import retrofit2.HttpException
|
||||
|
||||
@ExperimentalPagingApi
|
||||
@OptIn(ExperimentalPagingApi::class)
|
||||
class CachedTimelineRemoteMediator(
|
||||
accountManager: AccountManager,
|
||||
private val api: MastodonApi,
|
||||
|
|
|
@ -63,7 +63,7 @@ class CachedTimelineViewModel @Inject constructor(
|
|||
private val gson: Gson
|
||||
) : TimelineViewModel(timelineCases, api, eventHub, accountManager, sharedPreferences, filterModel) {
|
||||
|
||||
@ExperimentalPagingApi
|
||||
@OptIn(ExperimentalPagingApi::class)
|
||||
override val statuses = Pager(
|
||||
config = PagingConfig(pageSize = LOAD_AT_ONCE),
|
||||
remoteMediator = CachedTimelineRemoteMediator(accountManager, api, db, gson),
|
||||
|
|
|
@ -26,7 +26,7 @@ import com.keylesspalace.tusky.util.toViewData
|
|||
import com.keylesspalace.tusky.viewdata.StatusViewData
|
||||
import retrofit2.HttpException
|
||||
|
||||
@ExperimentalPagingApi
|
||||
@OptIn(ExperimentalPagingApi::class)
|
||||
class NetworkTimelineRemoteMediator(
|
||||
private val accountManager: AccountManager,
|
||||
private val viewModel: NetworkTimelineViewModel
|
||||
|
|
|
@ -63,7 +63,7 @@ class NetworkTimelineViewModel @Inject constructor(
|
|||
|
||||
var nextKey: String? = null
|
||||
|
||||
@ExperimentalPagingApi
|
||||
@OptIn(ExperimentalPagingApi::class)
|
||||
override val statuses = Pager(
|
||||
config = PagingConfig(pageSize = LOAD_AT_ONCE),
|
||||
pagingSourceFactory = {
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:keep="@drawable/ic_local_24dp,@drawable/ic_hashtag" />
|
Loading…
Add table
Add a link
Reference in a new issue