Just a few bug fixes.

This commit is contained in:
HeCodes2Much
2024-05-07 09:27:15 +01:00
parent 32e45af513
commit b2f4127c9b
7 changed files with 25 additions and 18 deletions

View File

@@ -80,9 +80,12 @@ class MainActivity : AppCompatActivity() {
} }
private fun setupNavController() { 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) appBarConfiguration = AppBarConfiguration(navController.graph)
//setupActionBarWithNavController(navController, appBarConfiguration)
} }
private fun setupViewPagerAdapter() { private fun setupViewPagerAdapter() {

View File

@@ -4,8 +4,8 @@ import android.os.Bundle
import android.view.WindowManager import android.view.WindowManager
import androidx.activity.viewModels import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.NavController
import androidx.navigation.findNavController import androidx.navigation.findNavController
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.AppBarConfiguration import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.navigateUp import androidx.navigation.ui.navigateUp
import com.github.droidworksstudio.launcher.R import com.github.droidworksstudio.launcher.R
@@ -22,7 +22,6 @@ class SettingsActivity : AppCompatActivity() {
private lateinit var binding: ActivitySettingsBinding private lateinit var binding: ActivitySettingsBinding
private lateinit var appBarConfiguration: AppBarConfiguration private lateinit var appBarConfiguration: AppBarConfiguration
private lateinit var navController: NavController
private val preferenceViewModel: PreferenceViewModel by viewModels() private val preferenceViewModel: PreferenceViewModel by viewModels()
@@ -38,7 +37,11 @@ class SettingsActivity : AppCompatActivity() {
binding = ActivitySettingsBinding.inflate(layoutInflater) binding = ActivitySettingsBinding.inflate(layoutInflater)
setContentView(binding.root) 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) appBarConfiguration = AppBarConfiguration(navController.graph)
initializeDependencies() initializeDependencies()

View File

@@ -159,7 +159,6 @@ class HomeFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener,
preferenceViewModel.showTimeLiveData.observe(viewLifecycleOwner) { preferenceViewModel.showTimeLiveData.observe(viewLifecycleOwner) {
Log.d("Tag", "ShowTime Home: $it") Log.d("Tag", "ShowTime Home: $it")
//updateViewVisibility(binding.clock, showTime)
appHelper.updateUI(binding.clock, appHelper.updateUI(binding.clock,
preferenceHelper.homeTimeAlignment, preferenceHelper.homeTimeAlignment,
preferenceHelper.timeColor, preferenceHelper.timeColor,
@@ -172,7 +171,7 @@ class HomeFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener,
appHelper.updateUI(binding.date, appHelper.updateUI(binding.date,
preferenceHelper.homeDateAlignment, preferenceHelper.homeDateAlignment,
preferenceHelper.dateColor, preferenceHelper.dateColor,
preferenceHelper.timeTextSize, preferenceHelper.dateTextSize,
preferenceHelper.showDate preferenceHelper.showDate
) )
} }

View File

@@ -6,7 +6,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.activities.MainActivity"> tools:context=".ui.activities.MainActivity">
<fragment <androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment_content_main" android:id="@+id/nav_host_fragment_content_main"
android:name="androidx.navigation.fragment.NavHostFragment" android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="0dp" android:layout_width="0dp"

View File

@@ -5,7 +5,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"> app:layout_behavior="@string/appbar_scrolling_view_behavior">
<fragment <androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment_content_settings" android:id="@+id/nav_host_fragment_content_settings"
android:name="androidx.navigation.fragment.NavHostFragment" android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="0dp" android:layout_width="0dp"

View File

@@ -18,21 +18,22 @@
android:id="@+id/searchViewContainer" android:id="@+id/searchViewContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginVertical="16dp" android:layout_marginVertical="16dp"
android:clickable="true" android:clickable="true"
android:focusable="true"> android:focusable="true"
android:orientation="horizontal"
tools:ignore="DuplicateClickableBoundsCheck">
<androidx.appcompat.widget.AppCompatEditText <androidx.appcompat.widget.AppCompatEditText
android:id="@+id/search_view1" android:id="@+id/search_view1"
style="@style/TextDefaultStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="64dp" android:layout_height="64dp"
android:hint="search"
android:textSize="@dimen/text_super_large"
android:textStyle="normal"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:hint="@string/search"
android:inputType="text" android:inputType="text"
style="@style/TextDefaultStyle"> android:textSize="@dimen/text_super_large"
android:textStyle="normal">
</androidx.appcompat.widget.AppCompatEditText> </androidx.appcompat.widget.AppCompatEditText>
@@ -57,10 +58,12 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.FloatingActionButton" style="@style/Widget.MaterialComponents.FloatingActionButton"
android:clickable="true" android:clickable="true"
android:focusable="true"
app:backgroundTint="@color/search_button_background" app:backgroundTint="@color/search_button_background"
android:src="?android:attr/actionModeWebSearchDrawable" android:src="?android:attr/actionModeWebSearchDrawable"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
android:layout_margin="32dp" /> android:layout_margin="32dp"
tools:ignore="ContentDescription" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -6,6 +6,7 @@
<string name="draw_fragment_label">Draw Fragment</string> <string name="draw_fragment_label">Draw Fragment</string>
<string name="battery_level">%s%%</string> <string name="battery_level">%s%%</string>
<string name="search">Search</string>
<string name="bottom_dialog_app_rename">Rename</string> <string name="bottom_dialog_app_rename">Rename</string>
<string name="bottom_dialog_add_to_home">Add to Home Screen</string> <string name="bottom_dialog_add_to_home">Add to Home Screen</string>
@@ -69,7 +70,6 @@
<string name="settings_manager_hidden">Hidden Apps</string> <string name="settings_manager_hidden">Hidden Apps</string>
<string name="settings_double_tap_lock">Double tap to lock</string> <string name="settings_double_tap_lock">Double tap to lock</string>
<string name="settings_select_wallpaper">Select Wallpaper</string> <string name="settings_select_wallpaper">Select Wallpaper</string>
<string name="authentication_title">Authentication</string> <string name="authentication_title">Authentication</string>
@@ -94,7 +94,6 @@
<!-- Small description inside Device Administrator Setting --> <!-- Small description inside Device Administrator Setting -->
<string name="receiver_desc">Allows to lock the screen</string> <string name="receiver_desc">Allows to lock the screen</string>
<string name="admin_permission_message">Aster launcher promises to use lock screen permission responsibly.Aster launcher does not collect or share any data.</string> <string name="admin_permission_message">Aster launcher promises to use lock screen permission responsibly.Aster launcher does not collect or share any data.</string>
<!-- TODO: Remove or change this placeholder text -->
<string-array name="alignment_options"> <string-array name="alignment_options">
<item>Left</item> <item>Left</item>
<item>Center</item> <item>Center</item>