Skip to content

Commit

Permalink
Just a few bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
HeCodes2Much committed May 7, 2024
1 parent 32e45af commit b2f4127
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()

Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -172,7 +171,7 @@ class HomeFragment : Fragment(), OnItemClickedListener.OnAppsClickedListener,
appHelper.updateUI(binding.date,
preferenceHelper.homeDateAlignment,
preferenceHelper.dateColor,
preferenceHelper.timeTextSize,
preferenceHelper.dateTextSize,
preferenceHelper.showDate
)
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:layout_height="match_parent"
tools:context=".ui.activities.MainActivity">

<fragment
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment_content_main"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="0dp"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/content_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<fragment
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment_content_settings"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="0dp"
Expand Down
17 changes: 10 additions & 7 deletions app/src/main/res/layout/fragment_draw.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@
android:id="@+id/searchViewContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginVertical="16dp"
android:clickable="true"
android:focusable="true">
android:focusable="true"
android:orientation="horizontal"
tools:ignore="DuplicateClickableBoundsCheck">

<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/search_view1"
style="@style/TextDefaultStyle"
android:layout_width="match_parent"
android:layout_height="64dp"
android:hint="search"
android:textSize="@dimen/text_super_large"
android:textStyle="normal"
android:background="@android:color/transparent"
android:hint="@string/search"
android:inputType="text"
style="@style/TextDefaultStyle">
android:textSize="@dimen/text_super_large"
android:textStyle="normal">

</androidx.appcompat.widget.AppCompatEditText>

Expand All @@ -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" />

</androidx.constraintlayout.widget.ConstraintLayout>
3 changes: 1 addition & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<string name="draw_fragment_label">Draw Fragment</string>

<string name="battery_level">%s%%</string>
<string name="search">Search</string>

<string name="bottom_dialog_app_rename">Rename</string>
<string name="bottom_dialog_add_to_home">Add to Home Screen</string>
Expand Down Expand Up @@ -69,7 +70,6 @@
<string name="settings_manager_hidden">Hidden Apps</string>

<string name="settings_double_tap_lock">Double tap to lock</string>

<string name="settings_select_wallpaper">Select Wallpaper</string>

<string name="authentication_title">Authentication</string>
Expand All @@ -94,7 +94,6 @@
<!-- Small description inside Device Administrator Setting -->
<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>
<!-- TODO: Remove or change this placeholder text -->
<string-array name="alignment_options">
<item>Left</item>
<item>Center</item>
Expand Down

0 comments on commit b2f4127

Please sign in to comment.