update Kotlin to 1.4.10 and fix some warnigs (#1963)

This commit is contained in:
Konrad Pozniak 2020-10-25 18:36:00 +01:00 committed by GitHub
commit 6d27d822ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 74 additions and 94 deletions

View file

@ -7,7 +7,6 @@ import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import androidx.paging.PagedList
import androidx.paging.PagedListAdapter
import androidx.recyclerview.widget.DividerItemDecoration
@ -61,11 +60,11 @@ abstract class SearchFragment<T> : Fragment(),
}
private fun subscribeObservables() {
data.observe(viewLifecycleOwner, Observer {
data.observe(viewLifecycleOwner) {
adapter.submitList(it)
})
}
networkStateRefresh.observe(viewLifecycleOwner, Observer {
networkStateRefresh.observe(viewLifecycleOwner) {
searchProgressBar.visible(it == NetworkState.LOADING)
@ -73,17 +72,16 @@ abstract class SearchFragment<T> : Fragment(),
showError()
}
checkNoData()
}
})
networkState.observe(viewLifecycleOwner, Observer {
networkState.observe(viewLifecycleOwner) {
progressBarBottom.visible(it == NetworkState.LOADING)
if (it.status == Status.FAILED) {
showError()
}
})
}
}
private fun checkNoData() {

View file

@ -26,8 +26,6 @@ import android.net.Uri
import android.os.Environment
import android.util.Log
import android.view.View
import android.widget.CheckBox
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.PopupMenu
@ -376,9 +374,10 @@ class SearchStatusesFragment : SearchFragment<Pair<Status, StatusViewData.Concre
private fun onMute(accountId: String, accountUsername: String) {
showMuteAccountDialog(
this.requireActivity(),
accountUsername,
{ notifications -> viewModel.muteAccount(accountId, notifications) }
)
accountUsername
) { notifications ->
viewModel.muteAccount(accountId, notifications)
}
}
private fun accountIsInMentions(account: AccountEntity?, mentions: Array<Mention>): Boolean {