From b2f4127c9bcc31b0b2516f34052c3a84c98d962b Mon Sep 17 00:00:00 2001 From: HeCodes2Much Date: Tue, 7 May 2024 09:27:15 +0100 Subject: [PATCH] Just a few bug fixes. --- .../launcher/ui/activities/MainActivity.kt | 7 +++++-- .../launcher/ui/activities/SettingsActivity.kt | 9 ++++++--- .../launcher/ui/home/HomeFragment.kt | 3 +-- app/src/main/res/layout/activity_main.xml | 2 +- app/src/main/res/layout/content_settings.xml | 2 +- app/src/main/res/layout/fragment_draw.xml | 17 ++++++++++------- app/src/main/res/values/strings.xml | 3 +-- 7 files changed, 25 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/github/droidworksstudio/launcher/ui/activities/MainActivity.kt b/app/src/main/java/com/github/droidworksstudio/launcher/ui/activities/MainActivity.kt index e75e01ae..2ca3cca3 100644 --- a/app/src/main/java/com/github/droidworksstudio/launcher/ui/activities/MainActivity.kt +++ b/app/src/main/java/com/github/droidworksstudio/launcher/ui/activities/MainActivity.kt @@ -80,9 +80,12 @@ class MainActivity : AppCompatActivity() { } private fun setupNavController() { - navController = findNavController(R.id.nav_host_fragment_content_main) + // Find the NavHostFragment + val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment_content_main) as NavHostFragment + + // Retrieve the NavController + val navController = navHostFragment.navController appBarConfiguration = AppBarConfiguration(navController.graph) - //setupActionBarWithNavController(navController, appBarConfiguration) } private fun setupViewPagerAdapter() { diff --git a/app/src/main/java/com/github/droidworksstudio/launcher/ui/activities/SettingsActivity.kt b/app/src/main/java/com/github/droidworksstudio/launcher/ui/activities/SettingsActivity.kt index 36860a9d..ce676700 100644 --- a/app/src/main/java/com/github/droidworksstudio/launcher/ui/activities/SettingsActivity.kt +++ b/app/src/main/java/com/github/droidworksstudio/launcher/ui/activities/SettingsActivity.kt @@ -4,8 +4,8 @@ import android.os.Bundle import android.view.WindowManager import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity -import androidx.navigation.NavController import androidx.navigation.findNavController +import androidx.navigation.fragment.NavHostFragment import androidx.navigation.ui.AppBarConfiguration import androidx.navigation.ui.navigateUp import com.github.droidworksstudio.launcher.R @@ -22,7 +22,6 @@ class SettingsActivity : AppCompatActivity() { private lateinit var binding: ActivitySettingsBinding private lateinit var appBarConfiguration: AppBarConfiguration - private lateinit var navController: NavController private val preferenceViewModel: PreferenceViewModel by viewModels() @@ -38,7 +37,11 @@ class SettingsActivity : AppCompatActivity() { binding = ActivitySettingsBinding.inflate(layoutInflater) setContentView(binding.root) - navController = findNavController(R.id.nav_host_fragment_content_settings) + // Find the NavHostFragment + val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment_content_settings) as NavHostFragment + + // Retrieve the NavController + val navController = navHostFragment.navController appBarConfiguration = AppBarConfiguration(navController.graph) initializeDependencies() diff --git a/app/src/main/java/com/github/droidworksstudio/launcher/ui/home/HomeFragment.kt b/app/src/main/java/com/github/droidworksstudio/launcher/ui/home/HomeFragment.kt index 19cd3dec..08849bd2 100644 --- a/app/src/main/java/com/github/droidworksstudio/launcher/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/github/droidworksstudio/launcher/ui/home/HomeFragment.kt @@ -159,7 +159,6 @@ class HomeFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener, preferenceViewModel.showTimeLiveData.observe(viewLifecycleOwner) { Log.d("Tag", "ShowTime Home: $it") - //updateViewVisibility(binding.clock, showTime) appHelper.updateUI(binding.clock, preferenceHelper.homeTimeAlignment, preferenceHelper.timeColor, @@ -172,7 +171,7 @@ class HomeFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener, appHelper.updateUI(binding.date, preferenceHelper.homeDateAlignment, preferenceHelper.dateColor, - preferenceHelper.timeTextSize, + preferenceHelper.dateTextSize, preferenceHelper.showDate ) } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 53cc37bb..abf773ad 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" tools:context=".ui.activities.MainActivity"> - - + android:focusable="true" + android:orientation="horizontal" + tools:ignore="DuplicateClickableBoundsCheck"> + android:textSize="@dimen/text_super_large" + android:textStyle="normal"> @@ -57,10 +58,12 @@ android:layout_height="wrap_content" style="@style/Widget.MaterialComponents.FloatingActionButton" android:clickable="true" + android:focusable="true" app:backgroundTint="@color/search_button_background" android:src="?android:attr/actionModeWebSearchDrawable" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" - android:layout_margin="32dp" /> + android:layout_margin="32dp" + tools:ignore="ContentDescription" /> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ddd56705..d9257dc9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -6,6 +6,7 @@ Draw Fragment %s%% + Search Rename Add to Home Screen @@ -69,7 +70,6 @@ Hidden Apps Double tap to lock - Select Wallpaper Authentication @@ -94,7 +94,6 @@ Allows to lock the screen Aster launcher promises to use lock screen permission responsibly.Aster launcher does not collect or share any data. - Left Center