Skip to content

Commit e08ad43

Browse files
Gitbot-ActionsCreativeCodeCat
authored andcommitted
chore(changelog): Update CHANGELOG.md
1 parent 282c869 commit e08ad43

File tree

18 files changed

+493
-223
lines changed

18 files changed

+493
-223
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ All notable changes to this project will be documented in this file. See [conven
1212

1313
- Custom Themes, Accent Color Toggle, - ([d18ad18](https://github.com/DroidWorksStudio/mLauncher/commit/d18ad18c6735ef40ac0e6a6b7bf3bbd473efc291))
1414

15+
### Language Support:
16+
17+
- Updated Language Files. ([#646](https://github.com/DroidWorksStudio/mLauncher/issues/646)) - ([dc2ab98](https://github.com/DroidWorksStudio/mLauncher/commit/dc2ab98cc2657a1a7e3e3dcea981eed26b1c2476))
18+
1519
### Refactoring:
1620

1721
- Moved around the settings - ([8ea6649](https://github.com/DroidWorksStudio/mLauncher/commit/8ea6649cd6d25a6e17f96e4e4c0219fc50655798))

app/src/main/java/com/github/droidworksstudio/common/ContextExtensions.kt

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import android.view.WindowManager
3131
import android.widget.Toast
3232
import androidx.annotation.ColorRes
3333
import androidx.annotation.DrawableRes
34+
import androidx.biometric.BiometricManager
3435
import androidx.core.content.ContextCompat
3536
import androidx.core.graphics.drawable.IconCompat
3637
import androidx.core.graphics.drawable.toBitmap
@@ -98,20 +99,16 @@ fun Context.createIconWithResourceCompat(
9899
@DrawableRes adaptiveIconForegroundId: Int,
99100
@DrawableRes adaptiveIconBackgroundId: Int
100101
): IconCompat {
101-
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
102-
val adaptiveIconDrawable = AdaptiveIconDrawable(
103-
ContextCompat.getDrawable(this, adaptiveIconBackgroundId),
104-
ContextCompat.getDrawable(this, adaptiveIconForegroundId)
102+
val adaptiveIconDrawable = AdaptiveIconDrawable(
103+
ContextCompat.getDrawable(this, adaptiveIconBackgroundId),
104+
ContextCompat.getDrawable(this, adaptiveIconForegroundId)
105+
)
106+
107+
return IconCompat.createWithAdaptiveBitmap(
108+
adaptiveIconDrawable.toBitmap(
109+
config = Bitmap.Config.ARGB_8888
105110
)
106-
107-
IconCompat.createWithAdaptiveBitmap(
108-
adaptiveIconDrawable.toBitmap(
109-
config = Bitmap.Config.ARGB_8888
110-
)
111-
)
112-
} else {
113-
IconCompat.createWithResource(this, vectorIconId)
114-
}
111+
)
115112
}
116113

117114
fun Context.currentLanguage() = ConfigurationCompat.getLocales(resources.configuration)[0]?.language
@@ -358,6 +355,16 @@ fun Context.getAppNameFromPackageName(packageName: String): String? {
358355
}
359356
}
360357

358+
fun Context.isBiometricEnabled(): Boolean {
359+
val biometricManager = BiometricManager.from(this)
360+
361+
return when (biometricManager.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_STRONG or BiometricManager.Authenticators.DEVICE_CREDENTIAL)) {
362+
BiometricManager.BIOMETRIC_SUCCESS -> true
363+
else -> false
364+
}
365+
}
366+
367+
361368
fun Context.openAccessibilitySettings() {
362369
val intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS)
363370
val cs = ComponentName(this.packageName, ActionService::class.java.name).flattenToString()

app/src/main/java/com/github/droidworksstudio/mlauncher/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class MainActivity : AppCompatActivity() {
122122

123123
initClickListeners()
124124
initObservers(viewModel)
125-
viewModel.getAppList(includeHiddenApps = prefs.hiddenAppsDisplayed)
125+
viewModel.getAppList(includeHiddenApps = true)
126126
setupOrientation()
127127

128128
window.addFlags(FLAG_LAYOUT_NO_LIMITS)

app/src/main/java/com/github/droidworksstudio/mlauncher/data/Constants.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ object Constants {
133133
// Function to get a string from a context (for non-Composable use)
134134
fun getString(context: Context): String {
135135
return when (this) {
136-
System -> context.getString(R.string.lang_system)
136+
System -> context.getString(R.string.system_default)
137137
Arabic -> context.getString(R.string.lang_arabic)
138138
Dutch -> context.getString(R.string.lang_dutch)
139139
English -> context.getString(R.string.lang_english)
@@ -157,7 +157,7 @@ object Constants {
157157
@Composable
158158
override fun string(): String {
159159
return when (this) {
160-
System -> stringResource(R.string.lang_system)
160+
System -> stringResource(R.string.system_default)
161161
Arabic -> stringResource(R.string.lang_arabic)
162162
Dutch -> stringResource(R.string.lang_dutch)
163163
English -> stringResource(R.string.lang_english)
@@ -318,7 +318,7 @@ object Constants {
318318
// Function to get a string from a context (for non-Composable use)
319319
fun getString(context: Context): String {
320320
return when (this) {
321-
System -> context.getString(R.string.lang_system)
321+
System -> context.getString(R.string.system_default)
322322
Dark -> context.getString(R.string.dark)
323323
Light -> context.getString(R.string.light)
324324
}
@@ -328,7 +328,7 @@ object Constants {
328328
@Composable
329329
override fun string(): String {
330330
return when (this) {
331-
System -> stringResource(R.string.lang_system)
331+
System -> stringResource(R.string.system_default)
332332
Dark -> stringResource(R.string.dark)
333333
Light -> stringResource(R.string.light)
334334
}
@@ -376,7 +376,7 @@ object Constants {
376376
@Composable
377377
override fun string(): String {
378378
return when (this) {
379-
System -> stringResource(R.string.settings_font_system)
379+
System -> stringResource(R.string.system_default)
380380
Bitter -> stringResource(R.string.settings_font_bitter)
381381
Dotness -> stringResource(R.string.settings_font_dotness)
382382
DroidSans -> stringResource(R.string.settings_font_droidsans)

app/src/main/java/com/github/droidworksstudio/mlauncher/data/Migration.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ class Migration(val context: Context) {
1313
171 to listOf(
1414
"APP_DARK_COLORS",
1515
"APP_LIGHT_COLORS",
16-
"HOME_FOLLOW_ACCENT"
16+
"HOME_FOLLOW_ACCENT",
17+
"ALL_APPS_TEXT"
1718
), // Version 171 Removes these from Prefs
1819
// Add more versions and preferences to remove here
1920
)

app/src/main/java/com/github/droidworksstudio/mlauncher/data/Prefs.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ private const val CLICK_CLOCK = "CLICK_CLOCK"
7676
private const val CLICK_USAGE = "CLICK_USAGE"
7777
private const val CLICK_DATE = "CLICK_DATE"
7878
private const val DOUBLE_TAP = "DOUBLE_TAP"
79-
private const val ALL_APPS_TEXT = "ALL_APPS_TEXT"
8079
private const val APP_SIZE_TEXT = "APP_SIZE_TEXT"
8180
private const val CLOCK_SIZE_TEXT = "CLOCK_SIZE_TEXT"
8281
private const val DATE_SIZE_TEXT = "DATE_SIZE_TEXT"
@@ -288,10 +287,6 @@ class Prefs(val context: Context) {
288287
get() = prefs.getBoolean(SETTINGS_LOCKED, false)
289288
set(value) = prefs.edit().putBoolean(SETTINGS_LOCKED, value).apply()
290289

291-
var useAllAppsText: Boolean
292-
get() = prefs.getBoolean(ALL_APPS_TEXT, true)
293-
set(value) = prefs.edit().putBoolean(ALL_APPS_TEXT, value).apply()
294-
295290
var shortSwipeUpAction: Constants.Action
296291
get() = loadAction(SWIPE_UP_ACTION, Constants.Action.ShowAppList)
297292
set(value) = storeAction(SWIPE_UP_ACTION, value)
@@ -413,10 +408,6 @@ class Prefs(val context: Context) {
413408
get() = prefs.getStringSet(HIDDEN_APPS, mutableSetOf()) as MutableSet<String>
414409
set(value) = prefs.edit().putStringSet(HIDDEN_APPS, value).apply()
415410

416-
var hiddenAppsDisplayed: Boolean
417-
get() = prefs.getBoolean(HIDDEN_APPS_DISPLAYED, false)
418-
set(value) = prefs.edit().putBoolean(HIDDEN_APPS_DISPLAYED, value).apply()
419-
420411
/**
421412
* By the number in home app list, get the list item.
422413
* TODO why not just save it as a list?

app/src/main/java/com/github/droidworksstudio/mlauncher/ui/AppDrawerAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class AppDrawerAdapter(
212212
// set show/hide icon
213213
if (flag == AppDrawerFlag.HiddenApps) {
214214
appHide.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.visibility, 0, 0)
215-
appHide.text = context.getString(R.string.unhide)
215+
appHide.text = context.getString(R.string.show)
216216
} else {
217217
appHide.setCompoundDrawablesWithIntrinsicBounds(
218218
0,

app/src/main/java/com/github/droidworksstudio/mlauncher/ui/AppDrawerFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class AppDrawerFragment : Fragment() {
141141
binding.recyclerView.addOnScrollListener(getRecyclerViewOnScrollListener())
142142

143143
when (flag) {
144-
AppDrawerFlag.LaunchApp -> if (prefs.useAllAppsText) binding.search.queryHint =
144+
AppDrawerFlag.LaunchApp -> binding.search.queryHint =
145145
applyTextColor(getString(R.string.show_apps), prefs.appColor)
146146

147147
AppDrawerFlag.HiddenApps -> binding.search.queryHint =

app/src/main/java/com/github/droidworksstudio/mlauncher/ui/HomeFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class HomeFragment : Fragment(), View.OnClickListener, View.OnLongClickListener
257257
if (prefs.homeLocked) return true
258258

259259
val n = view.id
260-
showAppList(AppDrawerFlag.SetHomeApp, includeHiddenApps = prefs.hiddenAppsDisplayed, n)
260+
showAppList(AppDrawerFlag.SetHomeApp, includeHiddenApps = true, n)
261261
return true
262262
}
263263

@@ -482,7 +482,7 @@ class HomeFragment : Fragment(), View.OnClickListener, View.OnLongClickListener
482482
}
483483
}
484484

485-
private fun showLongPressToast() = showShortToast("Long press to select app")
485+
private fun showLongPressToast() = showShortToast(getString(R.string.long_press_to_select_app))
486486

487487
private fun textOnClick(view: View) = onClick(view)
488488

app/src/main/java/com/github/droidworksstudio/mlauncher/ui/SettingsFragment.kt

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ class SettingsFragment : Fragment() {
113113
titleFontSize = titleFontSize,
114114
descriptionFontSize = descriptionFontSize,
115115
iconSize = iconSize,
116-
onClick = { showFeaturesSettings() },
116+
onClick = {
117+
showFeaturesSettings()
118+
},
117119
)
118120

119121
SettingsHomeItem(
@@ -123,7 +125,21 @@ class SettingsFragment : Fragment() {
123125
titleFontSize = titleFontSize,
124126
descriptionFontSize = descriptionFontSize,
125127
iconSize = iconSize,
126-
onClick = { showLookFeelSettings() },
128+
onClick = {
129+
showLookFeelSettings()
130+
},
131+
)
132+
133+
SettingsHomeItem(
134+
title = stringResource(R.string.settings_gestures_title),
135+
description = stringResource(R.string.settings_gestures_description),
136+
imageVector = ImageVector.vectorResource(id = R.drawable.ic_gestures),
137+
titleFontSize = titleFontSize,
138+
descriptionFontSize = descriptionFontSize,
139+
iconSize = iconSize,
140+
onClick = {
141+
showGesturesSettings()
142+
},
127143
)
128144

129145
SettingsHomeItem(
@@ -132,7 +148,9 @@ class SettingsFragment : Fragment() {
132148
titleFontSize = titleFontSize,
133149
descriptionFontSize = descriptionFontSize,
134150
iconSize = iconSize,
135-
onClick = { showFavoriteApps() },
151+
onClick = {
152+
showFavoriteApps()
153+
},
136154
)
137155

138156
SettingsHomeItem(
@@ -141,7 +159,9 @@ class SettingsFragment : Fragment() {
141159
titleFontSize = titleFontSize,
142160
descriptionFontSize = descriptionFontSize,
143161
iconSize = iconSize,
144-
onClick = { showHiddenApps() },
162+
onClick = {
163+
showHiddenApps()
164+
},
145165
)
146166

147167
SettingsHomeItem(
@@ -150,7 +170,9 @@ class SettingsFragment : Fragment() {
150170
titleFontSize = titleFontSize,
151171
descriptionFontSize = descriptionFontSize,
152172
iconSize = iconSize,
153-
onClick = { showAdvancedSettings() },
173+
onClick = {
174+
showAdvancedSettings()
175+
},
154176
)
155177
}
156178
}
@@ -269,6 +291,12 @@ class SettingsFragment : Fragment() {
269291
)
270292
}
271293

294+
private fun showGesturesSettings() {
295+
findNavController().navigate(
296+
R.id.action_settingsFragment_to_settingsGesturesFragment,
297+
)
298+
}
299+
272300
private fun showHiddenApps() {
273301
viewModel.getHiddenApps()
274302
findNavController().navigate(

0 commit comments

Comments
 (0)