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:
Konrad Pozniak 2025-01-17 12:35:35 +01:00 committed by GitHub
commit 9e597800c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 2421 additions and 1127 deletions

View file

@ -20,7 +20,7 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.Build
import com.keylesspalace.tusky.components.systemnotifications.canEnablePushNotifications
import com.keylesspalace.tusky.components.systemnotifications.isUnifiedPushAvailable
import com.keylesspalace.tusky.components.systemnotifications.isUnifiedPushNotificationEnabledForAccount
import com.keylesspalace.tusky.components.systemnotifications.updateUnifiedPushSubscription
import com.keylesspalace.tusky.db.AccountManager
@ -45,7 +45,7 @@ class NotificationBlockStateBroadcastReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
if (Build.VERSION.SDK_INT < 28) return
if (!canEnablePushNotifications(context, accountManager)) return
if (!isUnifiedPushAvailable(context)) return
val nm = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager