Feat: Added app dot icons.

Signed-off-by: HeCodes2Much <wayne6324@gmail.com>
This commit is contained in:
HeCodes2Much
2024-08-26 17:05:46 +01:00
parent b11d909318
commit 34f32ffffe
11 changed files with 329 additions and 166 deletions

View File

@@ -183,6 +183,7 @@ dependencies {
implementation(libs.acra.core)
implementation(libs.acra.dialog)
implementation(libs.acra.mail)
implementation(libs.androidx.palette.ktx)
//noinspection KaptUsageInsteadOfKsp
kapt(libs.room.compiler)

View File

@@ -87,6 +87,10 @@ class PreferenceHelper @Inject constructor(@ApplicationContext context: Context)
get() = prefs.getBoolean(Constants.SHOW_APP_ICON, false)
set(value) = prefs.edit().putBoolean(Constants.SHOW_APP_ICON, value).apply()
var showAppIconAsDots: Boolean
get() = prefs.getBoolean(Constants.SHOW_APP_ICON_DOTS, true)
set(value) = prefs.edit().putBoolean(Constants.SHOW_APP_ICON_DOTS, value).apply()
var locationDenied: Boolean
get() = prefs.getBoolean(Constants.LOCATION_DENIED, false)
set(value) = prefs.edit().putBoolean(Constants.LOCATION_DENIED, value).apply()

View File

@@ -2,16 +2,25 @@ package com.github.droidworksstudio.launcher.ui.home
import android.annotation.SuppressLint
import android.content.pm.PackageManager
import android.util.Log
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.view.Gravity
import android.view.View
import androidx.appcompat.widget.LinearLayoutCompat
import androidx.core.content.ContextCompat
import androidx.core.graphics.ColorUtils
import androidx.core.graphics.drawable.DrawableCompat
import androidx.palette.graphics.Palette
import androidx.recyclerview.widget.RecyclerView
import com.github.droidworksstudio.launcher.R
import com.github.droidworksstudio.launcher.data.entities.AppInfo
import com.github.droidworksstudio.launcher.databinding.ItemHomeBinding
import com.github.droidworksstudio.launcher.helper.PreferenceHelper
import com.github.droidworksstudio.launcher.listener.OnItemClickedListener
import javax.inject.Inject
import kotlin.math.min
class HomeViewHolder @Inject constructor(
private val binding: ItemHomeBinding,
@@ -22,46 +31,60 @@ class HomeViewHolder @Inject constructor(
@SuppressLint("ClickableViewAccessibility")
fun bind(appInfo: AppInfo) {
binding.apply {
// Get the current LayoutParams of appHomeName
val layoutParams = appHomeName.layoutParams as LinearLayoutCompat.LayoutParams
// Set the margins
layoutParams.topMargin = preferenceHelper.homeAppPadding.toInt()
layoutParams.bottomMargin = preferenceHelper.homeAppPadding.toInt()
appHomeName.layoutParams = layoutParams
// Update appHomeName properties
appHomeName.text = appInfo.appName
appHomeName.setTextColor(preferenceHelper.appColor)
appHomeName.textSize = preferenceHelper.appTextSize
appHomeName.gravity = preferenceHelper.homeAppAlignment
Log.d("Tag", "Home Adapter Color: ${preferenceHelper.appColor}")
if (preferenceHelper.showAppIcon) {
val pm: PackageManager = binding.root.context.packageManager
val appIcon = pm.getApplicationIcon(appInfo.packageName)
when (preferenceHelper.homeAppAlignment) {
Gravity.START -> {
appHomeLeftIcon.setImageDrawable(appIcon)
appHomeLeftIcon.layoutParams.width =
preferenceHelper.appTextSize.toInt() * 3
appHomeLeftIcon.layoutParams.height =
preferenceHelper.appTextSize.toInt() * 3
appHomeLeftIcon.visibility = View.VISIBLE
}
Gravity.END -> {
appHomeRightIcon.setImageDrawable(appIcon)
appHomeRightIcon.layoutParams.width =
preferenceHelper.appTextSize.toInt() * 3
appHomeRightIcon.layoutParams.height =
preferenceHelper.appTextSize.toInt() * 3
appHomeRightIcon.visibility = View.VISIBLE
if (preferenceHelper.showAppIconAsDots) {
val appNewIcon: Drawable = ContextCompat.getDrawable(itemView.context, R.drawable.app_dot_icon)!!
val bitmap = drawableToBitmap(appIcon)
val dominantColor = getDominantColor(bitmap)
val recoloredDrawable = recolorDrawable(appNewIcon, dominantColor)
val appIconSize = (preferenceHelper.appTextSize * 1.1f).toInt()
appHomeDotsIcon.setImageDrawable(recoloredDrawable)
appHomeDotsIcon.layoutParams.width = appIconSize
appHomeDotsIcon.layoutParams.height = appIconSize
appHomeDotsIcon.visibility = View.VISIBLE
} else {
val appIconSize = (preferenceHelper.appTextSize * 2f).toInt()
when (preferenceHelper.homeAppAlignment) {
Gravity.START -> {
appHomeLeftIcon.setImageDrawable(appIcon)
appHomeLeftIcon.layoutParams.width = appIconSize
appHomeLeftIcon.layoutParams.height = appIconSize
appHomeLeftIcon.visibility = View.VISIBLE
}
Gravity.END -> {
appHomeRightIcon.setImageDrawable(appIcon)
appHomeRightIcon.layoutParams.width = appIconSize
appHomeRightIcon.layoutParams.height = appIconSize
appHomeRightIcon.visibility = View.VISIBLE
}
else -> {
appHomeLeftIcon.visibility = View.GONE
appHomeRightIcon.visibility = View.GONE
}
}
}
} else {
// Hide icons if app icon is not shown
appHomeLeftIcon.visibility = View.GONE
appHomeRightIcon.visibility = View.GONE
appHomeDotsIcon.visibility = View.GONE
}
}
itemView.setOnClickListener {
onAppClickedListener.onAppClicked(appInfo)
}
@@ -71,4 +94,77 @@ class HomeViewHolder @Inject constructor(
true
}
}
private fun drawableToBitmap(drawable: Drawable): Bitmap {
if (drawable is BitmapDrawable) {
return drawable.bitmap
}
val width = drawable.intrinsicWidth.coerceAtLeast(1)
val height = drawable.intrinsicHeight.coerceAtLeast(1)
val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)
val canvas = Canvas(bitmap)
drawable.setBounds(0, 0, canvas.width, canvas.height)
drawable.draw(canvas)
return bitmap
}
private fun getDominantColor(bitmap: Bitmap): Int {
// Scale the bitmap to a manageable size
val scaledBitmap = Bitmap.createScaledBitmap(
bitmap,
min(bitmap.width / 4, 1280),
min(bitmap.height / 4, 1280),
true
)
// Generate a palette from the scaled bitmap
val palette = Palette.from(scaledBitmap)
.maximumColorCount(128)
.generate()
// Extract the colors from the palette
val colors = palette.swatches.map { it.rgb }
// Combine the colors into a single color
return increaseColorVibrancy(combineColors(colors))
}
private fun combineColors(colors: List<Int>): Int {
if (colors.isEmpty()) return Color.DKGRAY
var red = 0
var green = 0
var blue = 0
// Calculate the average color values
for (color in colors) {
red += Color.red(color)
green += Color.green(color)
blue += Color.blue(color)
}
val count = colors.size
return Color.rgb(red / count, green / count, blue / count)
}
private fun increaseColorVibrancy(color: Int): Int {
// Convert RGB to HSL
val hsl = FloatArray(3)
ColorUtils.colorToHSL(color, hsl)
// Increase the saturation
hsl[1] = (hsl[1] * 15f).coerceIn(0f, 1f)
// Convert HSL back to RGB
return ColorUtils.HSLToColor(hsl)
}
private fun recolorDrawable(drawable: Drawable, color: Int): Drawable {
val wrappedDrawable = DrawableCompat.wrap(drawable)
DrawableCompat.setTint(wrappedDrawable, color)
return wrappedDrawable
}
}

View File

@@ -19,7 +19,6 @@ import androidx.navigation.NavController
import androidx.navigation.fragment.findNavController
import com.github.droidworksstudio.common.getAppNameFromPackageName
import com.github.droidworksstudio.common.resetDefaultLauncher
import com.github.droidworksstudio.launcher.utils.Constants
import com.github.droidworksstudio.launcher.R
import com.github.droidworksstudio.launcher.adapter.font.FontAdapter
import com.github.droidworksstudio.launcher.databinding.FragmentSettingsBinding
@@ -33,6 +32,7 @@ import com.github.droidworksstudio.launcher.ui.bottomsheetdialog.AlignmentBottom
import com.github.droidworksstudio.launcher.ui.bottomsheetdialog.ColorBottomSheetDialogFragment
import com.github.droidworksstudio.launcher.ui.bottomsheetdialog.PaddingBottomSheetDialogFragment
import com.github.droidworksstudio.launcher.ui.bottomsheetdialog.TextBottomSheetDialogFragment
import com.github.droidworksstudio.launcher.utils.Constants
import com.github.droidworksstudio.launcher.viewmodel.PreferenceViewModel
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import dagger.hilt.android.AndroidEntryPoint
@@ -137,6 +137,7 @@ class SettingsFragment : Fragment(),
binding.batterySwitchCompat.isChecked = preferenceHelper.showBattery
binding.dailyWordSwitchCompat.isChecked = preferenceHelper.showDailyWord
binding.appIconsSwitchCompat.isChecked = preferenceHelper.showAppIcon
binding.appIconDotsSwitchCompat.isChecked = preferenceHelper.showAppIconAsDots
binding.automaticKeyboardSwitchCompat.isChecked = preferenceHelper.automaticKeyboard
binding.automaticOpenAppSwitchCompat.isChecked = preferenceHelper.automaticOpenApp
binding.lockSettingsSwitchCompat.isChecked = preferenceHelper.settingsLock
@@ -236,6 +237,14 @@ class SettingsFragment : Fragment(),
binding.appIconsSwitchCompat.setOnCheckedChangeListener { _, isChecked ->
preferenceViewModel.setShowAppIcons(isChecked)
// Disable and gray out the other setting if appIconsSwitchCompat is checked
binding.appIconDotsSwitchCompat.isEnabled = isChecked
binding.appIconDotsSwitchCompat.isChecked = false
}
binding.appIconDotsSwitchCompat.setOnCheckedChangeListener { _, isChecked ->
preferenceViewModel.setShowAppIconDots(isChecked)
}
binding.automaticKeyboardSwitchCompat.setOnCheckedChangeListener { _, isChecked ->

View File

@@ -53,6 +53,7 @@ object Constants {
const val APP_TEXT_PADDING = "APP_TEXT_PADDING"
const val SHOW_APP_ICON = "SHOW_APP_ICON"
const val SHOW_APP_ICON_DOTS = "SHOW_APP_ICON_DOTS"
const val AUTOMATIC_KEYBOARD = "AUTOMATIC_KEYBOARD"
const val AUTOMATIC_OPEN_APP = "AUTOMATIC_OPEN_APP"

View File

@@ -2,8 +2,8 @@ package com.github.droidworksstudio.launcher.viewmodel
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.github.droidworksstudio.launcher.utils.Constants
import com.github.droidworksstudio.launcher.helper.PreferenceHelper
import com.github.droidworksstudio.launcher.utils.Constants
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject
@@ -22,6 +22,7 @@ class PreferenceViewModel @Inject constructor(
private val showWeatherWidgetSunSetRiseLiveData: MutableLiveData<Boolean> = MutableLiveData()
private val showBatteryWidgetLiveData: MutableLiveData<Boolean> = MutableLiveData()
private val showAppIconLiveData: MutableLiveData<Boolean> = MutableLiveData()
private val showAppIconAsDotsLiveData: MutableLiveData<Boolean> = MutableLiveData()
private val homeAppAlignmentLiveData: MutableLiveData<Int> = MutableLiveData()
private val homeDateAlignmentLiveData: MutableLiveData<Int> = MutableLiveData()
private val homeTimeAlignmentLiveData: MutableLiveData<Int> = MutableLiveData()
@@ -88,6 +89,11 @@ class PreferenceViewModel @Inject constructor(
showAppIconLiveData.postValue(preferenceHelper.showAppIcon)
}
fun setShowAppIconDots(showAppIconAsDots: Boolean) {
preferenceHelper.showAppIconAsDots = showAppIconAsDots
showAppIconAsDotsLiveData.postValue(preferenceHelper.showAppIconAsDots)
}
fun setDailyWordColor(dailyWordColor: Int) {
preferenceHelper.dailyWordColor = dailyWordColor
dailyWordColorLiveData.postValue(preferenceHelper.dailyWordColor)

View File

@@ -0,0 +1,16 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="50dp"
android:height="50dp"
android:autoMirrored="true"
android:viewportWidth="50"
android:viewportHeight="50">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M47.693,25.859c-0.314,1.046 -0.837,2.616 -1.57,3.872c-1.988,3.453 -5.546,5.755 -9.313,5.755c-4.081,0 -7.929,-1.807 -10.755,-3.586c-2.114,-1.331 -4.197,-1.9 -6.088,-1.9c-3.164,0 -5.787,1.596 -7.097,3.889c-2.198,3.767 0,9.627 3.977,11.93C19.004,47.085 22.02,48 24.655,48c7.595,0 16.171,-4.758 19.899,-11.362C46.542,33.289 47.589,29.522 47.693,25.859L47.693,25.859z" />
<path
android:fillColor="#FFFFFFFF"
android:pathData="M15.825,6C14.134,6 12.426,6.387 11,7.137C5.348,10.134 2.077,17.853 2,25c-0.041,3.837 0.757,7.657 2.475,10.8c1.884,3.558 4.5,6.383 7.534,8.372c-0.733,-0.733 -1.779,-2.093 -2.511,-3.349c-1.988,-3.558 -1.779,-7.639 0,-10.988c1.884,-3.558 5.479,-5.955 8.409,-7.525c7.011,-3.663 6.802,-8.79 5.128,-12.453C21.827,7.24 18.853,6 15.825,6L15.825,6z" />
<path
android:fillColor="#FFFFFFFF"
android:pathData="M24.671,2c-3.977,0.105 -7.744,1.046 -10.883,2.825c1.046,-0.419 2.721,-0.733 4.186,-0.733c0.103,-0.003 0.205,-0.004 0.307,-0.004c3.958,0 7.487,1.969 9.425,5.132C29.799,12.569 30,16.651 30,20c0,7.953 4.299,10 8.485,10c4.5,0 8.515,-4.769 8.515,-9.268C46.895,10.999 34.927,2 24.671,2L24.671,2z" />
</vector>

View File

@@ -8,14 +8,14 @@
<FrameLayout
android:id="@+id/touchArea"
android:layout_marginVertical="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:layout_marginVertical="20dp" />
<com.github.droidworksstudio.launcher.view.GestureNestedScrollView
android:id="@+id/nestScrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/nestScrollView"
android:clipChildren="false"
android:clipToPadding="false"
android:fadingEdgeLength="48dp"
@@ -33,33 +33,33 @@
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextDefaultStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginTop="48dp"
android:text="@string/settings_name"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle" />
android:textSize="@dimen/text_super_large" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/version_info"
style="@style/TextDefaultStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginTop="18dp"
android:text="@string/settings_version"
android:textSize="@dimen/text_large"
style="@style/TextDefaultStyle" />
android:textSize="@dimen/text_large" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/set_launcher_selector"
style="@style/TextDefaultStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginTop="18dp"
android:text="@string/action_settings_default"
android:textSize="@dimen/text_large"
style="@style/TextDefaultStyle" />
android:textSize="@dimen/text_large" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -68,12 +68,12 @@
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextDefaultStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="@string/settings_title_app_manager"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle" />
android:textSize="@dimen/text_super_large" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -84,6 +84,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/favorite_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -92,8 +93,7 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -128,12 +128,12 @@
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextDefaultStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="@string/settings_title_home_behavior_preferences"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle" />
android:textSize="@dimen/text_super_large" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -144,6 +144,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/automaticKeyboard_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -152,8 +153,7 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/automaticKeyboard_switchCompat"
@@ -176,6 +176,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/automaticOpenApp_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -184,8 +185,7 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/automaticOpenApp_switchCompat"
@@ -208,6 +208,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/lockSettings_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -216,8 +217,7 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/lockSettings_switchCompat"
@@ -240,12 +240,12 @@
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextDefaultStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="@string/settings_title_home_display_preferences"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle" />
android:textSize="@dimen/text_super_large" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -256,6 +256,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/statue_bar_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -264,8 +265,7 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/statue_bar_switchCompat"
@@ -288,6 +288,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/date_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
@@ -296,8 +297,7 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/date_switchCompat"
@@ -320,6 +320,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/time_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -328,8 +329,7 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/time_switchCompat"
@@ -352,6 +352,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/battery_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -360,8 +361,7 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/battery_switchCompat"
@@ -384,6 +384,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/dailyWord_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -392,8 +393,7 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/dailyWord_switchCompat"
@@ -416,6 +416,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/appIcons_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -424,8 +425,7 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/appIcons_switchCompat"
@@ -439,6 +439,38 @@
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:orientation="horizontal"
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/appIconDots_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="left|center"
android:text="@string/settings_display_app_icon_dots"
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/appIconDots_switchCompat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleX="0.7"
android:scaleY="0.8"
android:thumb="@drawable/shape_switch_thumb"
app:track="@drawable/selector_switch"
tools:ignore="TouchTargetSizeCheck" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
@@ -448,12 +480,12 @@
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextDefaultStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="@string/settings_title_home_appearance_preferences"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle" />
android:textSize="@dimen/text_super_large" />
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/select_appearance_text_size"
@@ -465,6 +497,7 @@
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -473,8 +506,7 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -488,6 +520,7 @@
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -496,8 +529,7 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -576,6 +608,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/miscellaneous_launcherFonts_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -584,18 +617,17 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/miscellaneous_launcherFonts_control"
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center"
android:text="@string/settings_font_system"
android:textSize="@dimen/text_large"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -614,12 +646,12 @@
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextDefaultStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="@string/settings_title_gestures"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle" />
android:textSize="@dimen/text_super_large" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -631,6 +663,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/gestures_double_tap_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -639,18 +672,17 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/gestures_double_tap_control"
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center"
android:text="@string/settings_double_tap"
android:textSize="@dimen/text_large"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -664,6 +696,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/gestures_swipe_up_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -672,18 +705,17 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/gestures_swipe_up_control"
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center"
android:text="@string/settings_swipe_up"
android:textSize="@dimen/text_large"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -697,6 +729,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/gestures_swipe_down_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -705,18 +738,17 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/gestures_swipe_down_control"
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center"
android:text="@string/settings_swipe_down"
android:textSize="@dimen/text_large"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -730,6 +762,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/gestures_swipe_left_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -738,18 +771,17 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/gestures_swipe_left_control"
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center"
android:text="@string/settings_swipe_left"
android:textSize="@dimen/text_large"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -763,6 +795,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/gestures_swipe_right_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -771,18 +804,17 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/gestures_swipe_right_control"
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center"
android:text="@string/settings_swipe_right"
android:textSize="@dimen/text_large"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -803,12 +835,12 @@
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextDefaultStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="@string/settings_title_miscellaneous"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle" />
android:textSize="@dimen/text_super_large" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -820,6 +852,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/miscellaneous_searchEngine_text"
style="@style/TextDefaultStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -828,18 +861,17 @@
android:textSize="@dimen/text_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/miscellaneous_searchEngine_control"
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center"
android:text="@string/search"
android:textSize="@dimen/text_large"
tools:ignore="RtlHardcoded"
style="@style/TextDefaultStyle" />
tools:ignore="RtlHardcoded" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -860,12 +892,12 @@
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextDefaultStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="@string/settings_title_backups"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle" />
android:textSize="@dimen/text_super_large" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -875,31 +907,31 @@
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/backup_view"
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="10dp"
android:text="@string/settings_backups_backup"
android:textSize="@dimen/text_large"
android:layout_marginVertical="10dp"
style="@style/TextDefaultStyle" />
android:textSize="@dimen/text_large" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/clear_view"
android:text="@string/settings_backups_clear"
android:textSize="@dimen/text_large"
android:layout_marginVertical="10dp"
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/restore_view"
android:text="@string/settings_backups_restore"
android:textSize="@dimen/text_large"
android:layout_marginVertical="10dp"
style="@style/TextDefaultStyle" />
android:text="@string/settings_backups_clear"
android:textSize="@dimen/text_large" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/restore_view"
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="10dp"
android:text="@string/settings_backups_restore"
android:textSize="@dimen/text_large" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -920,50 +952,50 @@
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextDefaultStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="@string/settings_title_others"
android:textSize="@dimen/text_super_large"
style="@style/TextDefaultStyle" />
android:textSize="@dimen/text_super_large" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginHorizontal="20dp"
android:layout_marginVertical="10dp"
android:layout_weight="4"
android:gravity="center"
android:orientation="horizontal"
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/share_view"
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:text="@string/settings_others_share"
android:textSize="@dimen/text_large"
android:layout_marginHorizontal="10dp"
style="@style/TextDefaultStyle" />
android:textSize="@dimen/text_large" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/github_view"
android:text="@string/settings_others_github"
android:textSize="@dimen/text_large"
android:layout_marginHorizontal="10dp"
style="@style/TextDefaultStyle" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/feedback_view"
android:text="@string/settings_others_feedback"
android:textSize="@dimen/text_large"
android:layout_marginHorizontal="10dp"
style="@style/TextDefaultStyle" />
android:text="@string/settings_others_github"
android:textSize="@dimen/text_large" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/feedback_view"
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:text="@string/settings_others_feedback"
android:textSize="@dimen/text_large" />
</androidx.appcompat.widget.LinearLayoutCompat>

View File

@@ -2,51 +2,46 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
android:layout_height="wrap_content">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
tools:ignore="MissingConstraints">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/appHomeDots_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:layout_marginEnd="10dp"
android:visibility="gone" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/appHomeLeft_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/linear_layout"/>
android:layout_marginEnd="10dp"
android:visibility="gone" />
<androidx.appcompat.widget.LinearLayoutCompat
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/appHome_name"
style="@style/TextDefaultStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/appHome_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="24sp"
style="@style/TextDefaultStyle"
android:gravity="center"/>
</androidx.appcompat.widget.LinearLayoutCompat>
android:gravity="center"
android:textSize="24sp" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/appHomeRight_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/linear_layout"/>
android:layout_marginStart="10dp"
android:visibility="gone" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -51,6 +51,7 @@
<string name="settings_display_battery">Show Battery</string>
<string name="settings_display_daily_word">Show Daily Word</string>
<string name="settings_display_app_icons">Show App Icons</string>
<string name="settings_display_app_icon_dots">Show App Icons As Dots</string>
<string name="settings_display_automatic_keyboard">Auto Show Keyboard</string>
<string name="settings_display_auto_open_apps">Auto Open Last App</string>
<string name="settings_display_lock_settings">Lock Settings</string>

View File

@@ -20,6 +20,7 @@ biometric = "1.2.0-alpha05"
color-chooser = "0.7.3"
composeAndroid = "1.6.8"
acra = "5.11.3"
paletteKtx = "1.0.0"
[libraries]
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
@@ -58,6 +59,7 @@ androidx-ui-android = { group = "androidx.compose.ui", name = "ui-android", vers
acra-core = { group = "ch.acra", name = "acra-core", version.ref = "acra" }
acra-dialog = { group = "ch.acra", name = "acra-dialog", version.ref = "acra" }
acra-mail = { group = "ch.acra", name = "acra-mail", version.ref = "acra" }
androidx-palette-ktx = { group = "androidx.palette", name = "palette-ktx", version.ref = "paletteKtx" }
[plugins]