From d5e539fd6479ace3acdc13530a94bd4daf497a80 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sat, 22 May 2021 19:24:40 +0200 Subject: [PATCH] cleanup MainActivity / last remnants of SavedToots (#2174) --- app/src/main/AndroidManifest.xml | 3 --- .../java/com/keylesspalace/tusky/MainActivity.kt | 13 +++---------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a4b29cf2..80b76b84 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -34,9 +34,6 @@ android:resource="@xml/share_shortcuts" /> - diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt b/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt index 5333d764..aea0211a 100644 --- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt @@ -44,7 +44,6 @@ import com.bumptech.glide.load.resource.bitmap.RoundedCorners import com.bumptech.glide.request.target.CustomTarget import com.bumptech.glide.request.target.FixedSizeDrawable import com.bumptech.glide.request.transition.Transition -import com.google.android.material.floatingactionbutton.FloatingActionButton import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout.OnTabSelectedListener import com.google.android.material.tabs.TabLayoutMediator @@ -61,7 +60,6 @@ import com.keylesspalace.tusky.components.scheduled.ScheduledTootActivity import com.keylesspalace.tusky.components.search.SearchActivity import com.keylesspalace.tusky.databinding.ActivityMainBinding import com.keylesspalace.tusky.db.AccountEntity -import com.keylesspalace.tusky.db.AppDatabase import com.keylesspalace.tusky.entity.Account import com.keylesspalace.tusky.fragment.SFragment import com.keylesspalace.tusky.interfaces.AccountSelectionListener @@ -101,9 +99,6 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje @Inject lateinit var conversationRepository: ConversationsRepository - @Inject - lateinit var appDb: AppDatabase - @Inject lateinit var draftHelper: DraftHelper @@ -134,10 +129,8 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje super.onCreate(savedInstanceState) val activeAccount = accountManager.activeAccount - if (activeAccount == null) { - // will be redirected to LoginActivity by BaseActivity - return - } + ?: return // will be redirected to LoginActivity by BaseActivity + var showNotificationTab = false if (intent != null) { /** there are two possibilities the accountId can be passed to MainActivity: @@ -753,7 +746,7 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje header.setActiveProfile(accountManager.activeAccount!!.id) } - override fun getActionButton(): FloatingActionButton? = binding.composeButton + override fun getActionButton() = binding.composeButton override fun androidInjector() = androidInjector