Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Test Update Languages
Browse files Browse the repository at this point in the history
  • Loading branch information
CreativeCodeCat committed Nov 21, 2024
1 parent 044355a commit 54759a8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ import com.github.droidworksstudio.mlauncher.ui.compose.SettingsComposable.Setti
import com.github.droidworksstudio.mlauncher.ui.compose.SettingsComposable.SettingsItemFont
import com.github.droidworksstudio.mlauncher.ui.compose.SettingsComposable.SettingsSliderItem
import com.github.droidworksstudio.mlauncher.ui.compose.SettingsComposable.SettingsTextButton
import com.github.droidworksstudio.mlauncher.ui.compose.SettingsComposable.SettingsThreeButtonRow
import com.github.droidworksstudio.mlauncher.ui.compose.SettingsComposable.SettingsToggle
import com.github.droidworksstudio.mlauncher.ui.compose.SettingsComposable.SettingsTopView
import com.github.droidworksstudio.mlauncher.ui.compose.SettingsComposable.SettingsThreeButtonRow

class SettingsFragment : Fragment() {

Expand Down Expand Up @@ -122,7 +122,10 @@ class SettingsFragment : Fragment() {
binding.scrollView.setBackgroundColor(hex)
}

private fun <T> createTypefaceMap(context: Context, typeMappings: Map<T, Int>): Map<T, Typeface?> {
private fun <T> createTypefaceMap(
context: Context,
typeMappings: Map<T, Int>
): Map<T, Typeface?> {
return typeMappings.mapValues { (_, fontResId) ->
ResourcesCompat.getFont(context, fontResId)
}
Expand Down Expand Up @@ -166,7 +169,8 @@ class SettingsFragment : Fragment() {
Constants.Fonts.SourceCodePro to R.font.source_code_pro
)

val typefaceMapFonts: Map<Constants.Fonts, Typeface?> = createTypefaceMap(requireActivity(), typeMappings)
val typefaceMapFonts: Map<Constants.Fonts, Typeface?> =
createTypefaceMap(requireActivity(), typeMappings)



Expand Down Expand Up @@ -195,10 +199,10 @@ class SettingsFragment : Fragment() {
resetDefaultLauncher(requireContext())
}
SettingsTextButton(
stringResource(R.string.reorder_apps),
stringResource(R.string.favorite_apps),
fontSize = iconFs
) {
showReorderApps()
showFavoriteApps()
}
}
SettingsArea(
Expand Down Expand Up @@ -503,7 +507,7 @@ class SettingsFragment : Fragment() {
) { toggleShowBattery() }
},
{ _, onChange ->
if(prefs.showBattery) {
if (prefs.showBattery) {
SettingsToggle(
title = stringResource(R.string.show_battery_icon),
fontSize = iconFs,
Expand Down Expand Up @@ -917,10 +921,10 @@ class SettingsFragment : Fragment() {
)
}

private fun showReorderApps() {
private fun showFavoriteApps() {
viewModel.getHiddenApps()
findNavController().navigate(
R.id.action_settingsFragment_to_appListReorderFragment,
R.id.action_settingsFragment_to_appFavoriteFragment,
bundleOf("flag" to AppDrawerFlag.ReorderApps.toString())
)
}
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/navigation/nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
</fragment>

<fragment
android:id="@+id/appListReorderFragment"
android:id="@+id/appFavoriteFragment"
android:name="com.github.droidworksstudio.mlauncher.ui.FavoriteFragment"
android:label="app_list_fragment"
tools:layout="@layout/fragment_favorite"></fragment>
tools:layout="@layout/fragment_favorite" />

<fragment
android:id="@+id/settingsFragment"
Expand All @@ -62,8 +62,8 @@
app:popExitAnim="@anim/nav_default_pop_exit_anim" />

<action
android:id="@+id/action_settingsFragment_to_appListReorderFragment"
app:destination="@id/appListReorderFragment"
android:id="@+id/action_settingsFragment_to_appFavoriteFragment"
app:destination="@id/appFavoriteFragment"
app:enterAnim="@anim/nav_default_enter_anim"
app:exitAnim="@anim/nav_default_exit_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<!-- Home Strings -->
<string name="hidden_apps">Hidden Apps</string>
<string name="favorite_apps">Re-Order Apps</string>
<string name="favorite_apps">Favorite Apps</string>
<string name="set_as_default_launcher">Set as Default Launcher</string>
<string name="change_default_launcher">Change Default Launcher</string>

Expand Down

0 comments on commit 54759a8

Please sign in to comment.