Replace TextDrawable with an implementation that supports tint
This commit is contained in:
@@ -46,7 +46,6 @@ dependencies {
|
||||
|
||||
implementation(libs.okhttp)
|
||||
implementation(libs.glide)
|
||||
implementation(libs.textdrawable)
|
||||
implementation(libs.jsoup)
|
||||
|
||||
implementation(libs.koin.android)
|
||||
|
||||
@@ -3,6 +3,7 @@ package de.mm20.launcher2.search.data
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.Typeface
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.net.Uri
|
||||
import android.util.Log
|
||||
@@ -10,11 +11,12 @@ import android.webkit.URLUtil
|
||||
import androidx.core.graphics.drawable.toBitmap
|
||||
import androidx.core.graphics.toColorInt
|
||||
import androidx.palette.graphics.Palette
|
||||
import com.amulyakhare.textdrawable.TextDrawable
|
||||
import com.bumptech.glide.Glide
|
||||
import de.mm20.launcher2.graphics.TextDrawable
|
||||
import de.mm20.launcher2.helper.NetworkUtils
|
||||
import de.mm20.launcher2.icons.LauncherIcon
|
||||
import de.mm20.launcher2.ktx.jsonObjectOf
|
||||
import de.mm20.launcher2.ktx.sp
|
||||
import de.mm20.launcher2.preferences.LauncherPreferences
|
||||
import de.mm20.launcher2.preferences.WebsiteProtocols
|
||||
import de.mm20.launcher2.websites.R
|
||||
@@ -67,7 +69,7 @@ class Website(
|
||||
|
||||
override fun getPlaceholderIcon(context: Context): LauncherIcon {
|
||||
val drawable = if (label.isNotEmpty()) {
|
||||
TextDrawable.builder().buildRect(label[0].toString(), 0)
|
||||
TextDrawable(label[0].toString(), typeface = Typeface.DEFAULT_BOLD, fontSize = 40 * context.sp)
|
||||
} else context.getDrawable(R.drawable.ic_website)!!
|
||||
return LauncherIcon(
|
||||
foreground = drawable,
|
||||
|
||||
Reference in New Issue
Block a user