mirror of
https://github.com/He4eT/yamf_launcher.git
synced 2026-05-04 17:37:25 +00:00
Updated gradle and added customization to Shortcut Spacing
This commit is contained in:
parent
b47fa4b48c
commit
e453742ce8
6 changed files with 57 additions and 1 deletions
|
|
@ -297,6 +297,8 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
||||||
uiUtils.setShortcutsSize(binding.homeView)
|
uiUtils.setShortcutsSize(binding.homeView)
|
||||||
uiUtils.setSearchSize(searchView)
|
uiUtils.setSearchSize(searchView)
|
||||||
|
|
||||||
|
uiUtils.setShortcutsSpacing(binding.homeView)
|
||||||
|
|
||||||
uiUtils.setStatusBar(window)
|
uiUtils.setStatusBar(window)
|
||||||
|
|
||||||
leftSwipeActivity = gestureUtils.getSwipeInfo(launcherApps, "left")
|
leftSwipeActivity = gestureUtils.getSwipeInfo(launcherApps, "left")
|
||||||
|
|
@ -413,6 +415,10 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
||||||
uiUtils.setSearchSize(searchView)
|
uiUtils.setSearchSize(searchView)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"shortcutWeight" -> {
|
||||||
|
uiUtils.setShortcutsSpacing(binding.homeView)
|
||||||
|
}
|
||||||
|
|
||||||
"barVisibility" -> {
|
"barVisibility" -> {
|
||||||
uiUtils.setStatusBar(window)
|
uiUtils.setStatusBar(window)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,10 @@ class SharedPreferenceManager (private val context: Context) {
|
||||||
return preferences.getString("shortcutSize", "medium")
|
return preferences.getString("shortcutSize", "medium")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getShortcutWeight(): Float? {
|
||||||
|
return preferences.getString("shortcutWeight", "0.09")?.toFloat()
|
||||||
|
}
|
||||||
|
|
||||||
fun isBatteryEnabled(): Boolean {
|
fun isBatteryEnabled(): Boolean {
|
||||||
return preferences.getBoolean("batteryEnabled", false)
|
return preferences.getBoolean("batteryEnabled", false)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -316,4 +316,23 @@ class UIUtils(context: Context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setShortcutsSpacing(shortcuts: LinearLayout) {
|
||||||
|
val shortcutWeight = sharedPreferenceManager.getShortcutWeight()
|
||||||
|
shortcuts.children.forEach {
|
||||||
|
if (it is TextView) {
|
||||||
|
setShortcutSpacing(it, shortcutWeight)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setShortcutSpacing(shortcut: TextView, shortcutWeight: Float?) {
|
||||||
|
val layoutParams = shortcut.layoutParams as LinearLayout.LayoutParams
|
||||||
|
|
||||||
|
if (shortcutWeight != null) {
|
||||||
|
layoutParams.weight = shortcutWeight
|
||||||
|
}
|
||||||
|
|
||||||
|
shortcut.layoutParams = layoutParams
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -105,6 +105,24 @@
|
||||||
<item>extra</item>
|
<item>extra</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="shortcut_spacing_options">
|
||||||
|
<item>Small</item>
|
||||||
|
<item>Medium</item>
|
||||||
|
<item>Large</item>
|
||||||
|
<item>Extra Large</item>
|
||||||
|
<item>Huge</item>
|
||||||
|
<item>Extra Huge</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="shortcut_spacing_values">
|
||||||
|
<item>0.06</item>
|
||||||
|
<item>0.09</item>
|
||||||
|
<item>0.12</item>
|
||||||
|
<item>0.15</item>
|
||||||
|
<item>0.18</item>
|
||||||
|
<item>0.21</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
<!--Weather-->
|
<!--Weather-->
|
||||||
<string-array name="temp_units">
|
<string-array name="temp_units">
|
||||||
<item>°C</item>
|
<item>°C</item>
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,15 @@
|
||||||
app:key="shortcutSize"
|
app:key="shortcutSize"
|
||||||
app:title="Shortcut Size"
|
app:title="Shortcut Size"
|
||||||
app:useSimpleSummaryProvider="true" />
|
app:useSimpleSummaryProvider="true" />
|
||||||
|
<ListPreference
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:defaultValue="0.09"
|
||||||
|
app:entries="@array/shortcut_spacing_options"
|
||||||
|
app:entryValues="@array/shortcut_spacing_values"
|
||||||
|
app:key="shortcutWeight"
|
||||||
|
app:title="Shortcut Spacing"
|
||||||
|
app:useSimpleSummaryProvider="true" />
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application") version "8.5.2" apply false
|
id("com.android.application") version "8.6.0" apply false
|
||||||
id("org.jetbrains.kotlin.android") version "1.9.22" apply false
|
id("org.jetbrains.kotlin.android") version "1.9.22" apply false
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue