Move all database queries off the ui thread & add a ViewModel for MainActivity (#4786)
- Move all database queries off the ui thread - this is a massive performance improvement - ViewModel for MainActivity - this makes MainActivity smaller and network requests won't be retried when rotating the screen - removes the Push Notification Migration feature. We had it long enough, all users who want push notifications should be migrated by now - AccountEntity is now immutable - converted BaseActivity to Kotlin - The header image of Accounts is now cached as well
This commit is contained in:
parent
d93ec6822b
commit
9e597800c9
47 changed files with 2421 additions and 1127 deletions
|
|
@ -43,6 +43,7 @@ import androidx.lifecycle.lifecycleScope
|
|||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import com.bumptech.glide.Glide
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.keylesspalace.tusky.BuildConfig.APPLICATION_ID
|
||||
import com.keylesspalace.tusky.components.viewthread.ViewThreadActivity
|
||||
import com.keylesspalace.tusky.databinding.ActivityViewMediaBinding
|
||||
|
|
@ -91,11 +92,9 @@ class ViewMediaActivity :
|
|||
if (isGranted) {
|
||||
downloadMedia()
|
||||
} else {
|
||||
showErrorDialog(
|
||||
binding.toolbar,
|
||||
R.string.error_media_download_permission,
|
||||
R.string.action_retry
|
||||
) { requestDownloadMedia() }
|
||||
Snackbar.make(binding.toolbar, getString(R.string.error_media_download_permission), Snackbar.LENGTH_SHORT)
|
||||
.setAction(R.string.action_retry) { requestDownloadMedia() }
|
||||
.show()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue