From a4bfe080b1b52578efa2c43aff0e0c3be59e3674 Mon Sep 17 00:00:00 2001 From: Arjan Schrijver Date: Fri, 14 Jun 2024 22:54:48 +0200 Subject: [PATCH] Hide Permissions title when action bar is visible --- .../activities/welcome/WelcomeFragmentPermissions.java | 6 ++++++ app/src/main/res/layout/fragment_welcome_permissions.xml | 1 + 2 files changed, 7 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/welcome/WelcomeFragmentPermissions.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/welcome/WelcomeFragmentPermissions.java index 55d223323..c95b8cd20 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/welcome/WelcomeFragmentPermissions.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/welcome/WelcomeFragmentPermissions.java @@ -27,6 +27,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; @@ -66,6 +67,11 @@ public class WelcomeFragmentPermissions extends Fragment { requestAllPermissions(); }); + if (((AppCompatActivity)getActivity()).getSupportActionBar().isShowing()) { + // Hide title when the Action Bar is visible (i.e. when not in the first run flow) + view.findViewById(R.id.permissions_title).setVisibility(View.GONE); + } + // Initialize RecyclerView and data permissionsListView = view.findViewById(R.id.permissions_list); diff --git a/app/src/main/res/layout/fragment_welcome_permissions.xml b/app/src/main/res/layout/fragment_welcome_permissions.xml index 1e8e37d53..8a9b34ef6 100644 --- a/app/src/main/res/layout/fragment_welcome_permissions.xml +++ b/app/src/main/res/layout/fragment_welcome_permissions.xml @@ -7,6 +7,7 @@ android:padding="8dp">