diff --git a/app/src/main/java/com/github/droidworksstudio/launcher/ui/drawer/DrawFragment.kt b/app/src/main/java/com/github/droidworksstudio/launcher/ui/drawer/DrawFragment.kt index 0d5d0808..3f21a371 100644 --- a/app/src/main/java/com/github/droidworksstudio/launcher/ui/drawer/DrawFragment.kt +++ b/app/src/main/java/com/github/droidworksstudio/launcher/ui/drawer/DrawFragment.kt @@ -4,9 +4,6 @@ import android.annotation.SuppressLint import android.content.Context import android.os.Build import android.os.Bundle -import android.text.Spannable -import android.text.SpannableString -import android.text.style.ForegroundColorSpan import android.util.Log import android.view.LayoutInflater import android.view.View @@ -110,16 +107,6 @@ class DrawFragment : Fragment(), private fun observeDrawerApps() { viewModel.compareInstalledAppInfo() - val searchAppsHint = getString(R.string.search) - val coloredHint = SpannableString(searchAppsHint) - coloredHint.setSpan( - ForegroundColorSpan(preferenceHelper.appColor), - 0, - searchAppsHint.length, - Spannable.SPAN_EXCLUSIVE_EXCLUSIVE - ) - binding.searchViewText.queryHint = coloredHint - @Suppress("DEPRECATION") viewLifecycleOwner.lifecycleScope.launchWhenCreated { viewModel.drawApps.collect { diff --git a/app/src/main/java/com/github/droidworksstudio/launcher/ui/favorite/FavoriteFragment.kt b/app/src/main/java/com/github/droidworksstudio/launcher/ui/favorite/FavoriteFragment.kt index 320304be..eeb80e51 100644 --- a/app/src/main/java/com/github/droidworksstudio/launcher/ui/favorite/FavoriteFragment.kt +++ b/app/src/main/java/com/github/droidworksstudio/launcher/ui/favorite/FavoriteFragment.kt @@ -106,9 +106,8 @@ class FavoriteFragment : Fragment(), } } + @RequiresApi(Build.VERSION_CODES.R) private fun observeFavorite() { - binding.topTextView.setTextColor(preferenceHelper.appColor) - viewModel.compareInstalledAppInfo() viewLifecycleOwner.lifecycleScope.launch { viewModel.favoriteApps.collect { diff --git a/app/src/main/java/com/github/droidworksstudio/launcher/ui/favorite/FavoriteViewHolder.kt b/app/src/main/java/com/github/droidworksstudio/launcher/ui/favorite/FavoriteViewHolder.kt index 0a27bbd7..706940d6 100644 --- a/app/src/main/java/com/github/droidworksstudio/launcher/ui/favorite/FavoriteViewHolder.kt +++ b/app/src/main/java/com/github/droidworksstudio/launcher/ui/favorite/FavoriteViewHolder.kt @@ -1,11 +1,6 @@ package com.github.droidworksstudio.launcher.ui.favorite import android.annotation.SuppressLint -import android.graphics.BlendMode -import android.graphics.BlendModeColorFilter -import android.graphics.PorterDuff -import android.graphics.PorterDuffColorFilter -import android.os.Build import android.util.Log import android.view.MotionEvent import android.view.View @@ -62,27 +57,6 @@ class FavoriteViewHolder( preferenceHelper.appTextSize.toInt() * 3 appFavoriteLeftIcon.visibility = View.VISIBLE } - - - // Create a BlendModeColorFilter with the specified color and blend mode - val blendModeColorFilter = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - BlendModeColorFilter( - preferenceHelper.appColor, - BlendMode.SRC_IN - ) - } else { - PorterDuffColorFilter( - preferenceHelper.appColor, - PorterDuff.Mode.SRC_IN - ) - } - - // Get the current drawable set as the background - val drawable = appFavoriteDragIcon.background.mutate() - // Apply a color filter to change its color - drawable.colorFilter = blendModeColorFilter - // Set the modified drawable back as the background - appFavoriteDragIcon.background = drawable } itemView.setOnClickListener { diff --git a/app/src/main/java/com/github/droidworksstudio/launcher/ui/hidden/HiddenViewHolder.kt b/app/src/main/java/com/github/droidworksstudio/launcher/ui/hidden/HiddenViewHolder.kt index 51edba2e..742429b5 100644 --- a/app/src/main/java/com/github/droidworksstudio/launcher/ui/hidden/HiddenViewHolder.kt +++ b/app/src/main/java/com/github/droidworksstudio/launcher/ui/hidden/HiddenViewHolder.kt @@ -2,6 +2,7 @@ package com.github.droidworksstudio.launcher.ui.hidden import android.util.Log import android.view.View +import androidx.appcompat.widget.LinearLayoutCompat import androidx.recyclerview.widget.RecyclerView import com.github.droidworksstudio.launcher.data.entities.AppInfo import com.github.droidworksstudio.launcher.databinding.ItemHiddenBinding @@ -17,7 +18,17 @@ class HiddenViewHolder( RecyclerView.ViewHolder(binding.root) { fun bind(appInfo: AppInfo) { binding.apply { + // Get the current LayoutParams of appFavoriteName + val layoutParams = appHiddenName.layoutParams as LinearLayoutCompat.LayoutParams + + // Set the margins + layoutParams.topMargin = preferenceHelper.homeAppPadding.toInt() + layoutParams.bottomMargin = preferenceHelper.homeAppPadding.toInt() + + appHiddenName.layoutParams = layoutParams appHiddenName.text = appInfo.appName + appHiddenName.setTextColor(preferenceHelper.appColor) + appHiddenName.textSize = preferenceHelper.appTextSize Log.d("Tag", "Draw Adapter: ${appInfo.appName}") if (preferenceHelper.showAppIcon) {