mirror of
https://github.com/He4eT/yamf_launcher.git
synced 2026-05-05 01:47:24 +00:00
Fixed the following issues:
- Screen rotation allowed in settings menu - Work profile drawable not changing color on home screen - Shortcut app menu title color - Dependency Info blob
This commit is contained in:
parent
4ff9c94981
commit
1798401de3
4 changed files with 52 additions and 33 deletions
|
|
@ -11,8 +11,13 @@ android {
|
||||||
applicationId = "eu.ottop.yamlauncher"
|
applicationId = "eu.ottop.yamlauncher"
|
||||||
minSdk = 31
|
minSdk = 31
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 1
|
versionCode = 2
|
||||||
versionName = "0.5-test"
|
versionName = "0.6-test"
|
||||||
|
}
|
||||||
|
|
||||||
|
dependenciesInfo {
|
||||||
|
includeInApk = false
|
||||||
|
includeInBundle = false
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,9 @@
|
||||||
<activity
|
<activity
|
||||||
android:name=".settings.SettingsActivity"
|
android:name=".settings.SettingsActivity"
|
||||||
android:theme="@style/SettingsTheme"
|
android:theme="@style/SettingsTheme"
|
||||||
android:exported="false" />
|
android:exported="false"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
tools:ignore="DiscouragedApi,LockedOrientationActivity"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
|
|
|
||||||
|
|
@ -105,10 +105,10 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
||||||
|
|
||||||
setMainVariables()
|
setMainVariables()
|
||||||
|
|
||||||
setPreferences()
|
|
||||||
|
|
||||||
setShortcuts()
|
setShortcuts()
|
||||||
|
|
||||||
|
setPreferences()
|
||||||
|
|
||||||
setHomeListeners()
|
setHomeListeners()
|
||||||
|
|
||||||
// Task to update the app menu every 5 seconds
|
// Task to update the app menu every 5 seconds
|
||||||
|
|
@ -159,25 +159,6 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this)
|
preferences = PreferenceManager.getDefaultSharedPreferences(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setPreferences() {
|
|
||||||
uiUtils.setBackground(window)
|
|
||||||
uiUtils.setTextColors(binding.homeView)
|
|
||||||
uiUtils.setSearchColors(searchView)
|
|
||||||
|
|
||||||
uiUtils.setClockAlignment(clock, dateText)
|
|
||||||
uiUtils.setSearchAlignment(searchView)
|
|
||||||
|
|
||||||
uiUtils.setClockSize(clock)
|
|
||||||
uiUtils.setDateSize(dateText)
|
|
||||||
uiUtils.setShortcutsSize(binding.homeView)
|
|
||||||
uiUtils.setSearchSize(searchView)
|
|
||||||
|
|
||||||
uiUtils.setStatusBar(window)
|
|
||||||
|
|
||||||
leftSwipeActivity = gestureUtils.getSwipeInfo(launcherApps, "left")
|
|
||||||
rightSwipeActivity = gestureUtils.getSwipeInfo(launcherApps, "right")
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setShortcuts() {
|
private fun setShortcuts() {
|
||||||
val shortcuts = arrayOf(R.id.app1, R.id.app2, R.id.app3, R.id.app4, R.id.app5, R.id.app6, R.id.app7, R.id.app8)
|
val shortcuts = arrayOf(R.id.app1, R.id.app2, R.id.app3, R.id.app4, R.id.app5, R.id.app6, R.id.app7, R.id.app8)
|
||||||
|
|
||||||
|
|
@ -194,7 +175,7 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
||||||
else {
|
else {
|
||||||
textView.visibility = View.VISIBLE
|
textView.visibility = View.VISIBLE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val savedView = sharedPreferenceManager.getShortcut(textView)
|
val savedView = sharedPreferenceManager.getShortcut(textView)
|
||||||
|
|
||||||
|
|
@ -283,6 +264,26 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setPreferences() {
|
||||||
|
uiUtils.setBackground(window)
|
||||||
|
uiUtils.setTextColors(binding.homeView)
|
||||||
|
uiUtils.setMenuItemColors(searchView)
|
||||||
|
uiUtils.setMenuItemColors(binding.menuTitle, "A9")
|
||||||
|
|
||||||
|
uiUtils.setClockAlignment(clock, dateText)
|
||||||
|
uiUtils.setSearchAlignment(searchView)
|
||||||
|
|
||||||
|
uiUtils.setClockSize(clock)
|
||||||
|
uiUtils.setDateSize(dateText)
|
||||||
|
uiUtils.setShortcutsSize(binding.homeView)
|
||||||
|
uiUtils.setSearchSize(searchView)
|
||||||
|
|
||||||
|
uiUtils.setStatusBar(window)
|
||||||
|
|
||||||
|
leftSwipeActivity = gestureUtils.getSwipeInfo(launcherApps, "left")
|
||||||
|
rightSwipeActivity = gestureUtils.getSwipeInfo(launcherApps, "right")
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
private fun setHomeListeners() {
|
private fun setHomeListeners() {
|
||||||
registerBatteryReceiver()
|
registerBatteryReceiver()
|
||||||
|
|
@ -331,7 +332,8 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
||||||
|
|
||||||
"textColor" -> {
|
"textColor" -> {
|
||||||
uiUtils.setTextColors(binding.homeView)
|
uiUtils.setTextColors(binding.homeView)
|
||||||
uiUtils.setSearchColors(searchView)
|
uiUtils.setMenuItemColors(searchView)
|
||||||
|
uiUtils.setMenuItemColors(binding.menuTitle, "A9")
|
||||||
}
|
}
|
||||||
|
|
||||||
"clockAlignment" -> {
|
"clockAlignment" -> {
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,15 @@ class UIUtils(context: Context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hasMethod(view, "setTextColor") -> {
|
hasMethod(view, "setTextColor") -> {
|
||||||
(view as? TextView)?.setTextColor(color)
|
(view as TextView).setTextColor(color)
|
||||||
|
view.compoundDrawables[0]?.colorFilter =
|
||||||
|
BlendModeColorFilter(sharedPreferenceManager.getTextColor(), BlendMode.SRC_ATOP)
|
||||||
|
view.compoundDrawables[2]?.colorFilter =
|
||||||
|
BlendModeColorFilter(sharedPreferenceManager.getTextColor(), BlendMode.SRC_ATOP)
|
||||||
|
|
||||||
|
}
|
||||||
|
view is TextView && view.compoundDrawables[0] != null -> {
|
||||||
|
println(view.text)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
view.setBackgroundColor(color)
|
view.setBackgroundColor(color)
|
||||||
|
|
@ -56,16 +64,18 @@ class UIUtils(context: Context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setSearchColors(searchView: TextInputEditText) {
|
fun setMenuItemColors(view: TextView, alphaHex: String = "FF") {
|
||||||
val viewTreeObserver = searchView.viewTreeObserver
|
val viewTreeObserver = view.viewTreeObserver
|
||||||
|
|
||||||
val globalLayoutListener = object : ViewTreeObserver.OnGlobalLayoutListener {
|
val globalLayoutListener = object : ViewTreeObserver.OnGlobalLayoutListener {
|
||||||
override fun onGlobalLayout() {
|
override fun onGlobalLayout() {
|
||||||
searchView.viewTreeObserver.removeOnGlobalLayoutListener(this)
|
view.viewTreeObserver.removeOnGlobalLayoutListener(this)
|
||||||
val color = sharedPreferenceManager.getTextColor()
|
val color = sharedPreferenceManager.getTextColor()
|
||||||
searchView.setTextColor(color)
|
view.setTextColor(setAlpha(color, alphaHex))
|
||||||
searchView.setHintTextColor(setAlpha(color, "A9"))
|
view.setHintTextColor(setAlpha(color, "A9"))
|
||||||
searchView.compoundDrawables[0].mutate().colorFilter = BlendModeColorFilter(color, BlendMode.SRC_ATOP)
|
if (view.compoundDrawables[0] != null) {
|
||||||
|
view.compoundDrawables[0].mutate().colorFilter = BlendModeColorFilter(color, BlendMode.SRC_ATOP)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue