From 37cfc5a1171331d9c69e420595eec7b530d82a9f Mon Sep 17 00:00:00 2001 From: Vivian Li <112584985+strawberrybread@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:47:26 -0400 Subject: [PATCH] actions: less warnings is more (fixes #3626) (#3637) Co-authored-by: dogi --- app/build.gradle | 4 ++-- .../planet/myplanet/ui/dashboard/DashboardActivity.kt | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e22816f477..ba26312c81 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 21 targetSdkVersion 34 - versionCode 1605 - versionName "0.16.5" + versionCode 1606 + versionName "0.16.6" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt index 1208ae6e48..45ca3f434f 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt @@ -18,9 +18,13 @@ import android.view.WindowManager import androidx.activity.OnBackPressedCallback import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat +import androidx.core.view.WindowCompat +import androidx.core.view.WindowInsetsCompat +import androidx.core.view.WindowInsetsControllerCompat import androidx.drawerlayout.widget.DrawerLayout import androidx.fragment.app.Fragment import com.google.android.material.bottomnavigation.BottomNavigationView +import com.google.android.material.navigation.NavigationBarView import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout.OnTabSelectedListener import com.mikepenz.materialdrawer.AccountHeader @@ -61,7 +65,7 @@ import org.ole.planet.myplanet.utilities.LocaleHelper import org.ole.planet.myplanet.utilities.Utilities import org.ole.planet.myplanet.utilities.Utilities.toast -class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, BottomNavigationView.OnNavigationItemSelectedListener { +class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, NavigationBarView.OnItemSelectedListener { private lateinit var activityDashboardBinding: ActivityDashboardBinding private var headerResult: AccountHeader? = null var user: RealmUserModel? = null @@ -115,7 +119,7 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, B openCallFragment(InactiveDashboardFragment(), "Dashboard") return } - navigationView.setOnNavigationItemSelectedListener(this) + navigationView.setOnItemSelectedListener(this) navigationView.visibility = if (UserProfileDbHandler(this).userModel?.isShowTopbar == true) { View.VISIBLE } else { @@ -129,7 +133,8 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, B result?.stickyFooter?.setPadding(0, 0, 0, 0) // moves logout button to the very bottom of the drawer. Without it, the "logout" button suspends a little. result?.actionBarDrawerToggle?.isDrawerIndicatorEnabled = true dl = result?.drawerLayout - window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN) + WindowCompat.setDecorFitsSystemWindows(window, false) + WindowInsetsControllerCompat(window, window.decorView).hide(WindowInsetsCompat.Type.statusBars()) result?.drawerLayout?.fitsSystemWindows = false topbarSetting() if (intent != null && intent.hasExtra("fragmentToOpen")) {