diff --git a/base/src/main/res/values-night/colors.xml b/base/src/main/res/values-night/colors.xml
index 959051a5..c36c3484 100644
--- a/base/src/main/res/values-night/colors.xml
+++ b/base/src/main/res/values-night/colors.xml
@@ -39,7 +39,6 @@
@color/blue
#333
#222
- @color/cardview_light_background
#222222
#282828
diff --git a/ui/src/main/java/de/mm20/launcher2/ui/legacy/view/LauncherIconView.kt b/ui/src/main/java/de/mm20/launcher2/ui/legacy/view/LauncherIconView.kt
index d2c3791f..8a6fb13b 100644
--- a/ui/src/main/java/de/mm20/launcher2/ui/legacy/view/LauncherIconView.kt
+++ b/ui/src/main/java/de/mm20/launcher2/ui/legacy/view/LauncherIconView.kt
@@ -5,16 +5,13 @@ import android.animation.ObjectAnimator
import android.content.Context
import android.graphics.*
import android.graphics.drawable.AdaptiveIconDrawable
-import android.os.Build
import android.util.AttributeSet
import android.view.HapticFeedbackConstants
import android.view.MotionEvent
import android.view.View
import android.view.ViewConfiguration
-import androidx.annotation.RequiresApi
import androidx.core.content.ContextCompat
import com.bartoszlipinski.viewpropertyobjectanimator.ViewPropertyObjectAnimator
-import de.mm20.launcher2.badges.Badge
import de.mm20.launcher2.icons.LauncherIcon
import de.mm20.launcher2.ktx.dp
import de.mm20.launcher2.ktx.toRectF
@@ -72,12 +69,6 @@ class LauncherIconView : View, KoinComponent {
invalidate()
}
- var badge: Badge? = null
- set(value) {
- field = value
- invalidate()
- }
-
private val iconObserver: (LauncherIcon) -> Unit = {
foregroundScale = it.foregroundScale
backgroundScale = it.backgroundScale
@@ -152,11 +143,6 @@ class LauncherIconView : View, KoinComponent {
isFilterBitmap = true
}
- private val badgePaint = Paint().apply {
- color = ContextCompat.getColor(context, R.color.badge)
- isAntiAlias = true
- }
-
private val badgeTextPaint = Paint().apply {
color = ContextCompat.getColor(context, R.color.badge_text)
isAntiAlias = true
@@ -442,53 +428,6 @@ class LauncherIconView : View, KoinComponent {
}
}
}
-
- val badgeSize = drawRect.width() * 0.30f
- badgeRect.left = drawRect.right - badgeSize
- badgeRect.top = drawRect.bottom - badgeSize
- badgeRect.right = drawRect.right.toFloat()
- badgeRect.bottom = drawRect.bottom.toFloat()
-
- val badge = badge ?: return
- val badgeNumber = badge.number
- val badgeProgress = badge.progress
- val badgeIcon = badge.icon ?: badge.iconRes?.let { ContextCompat.getDrawable(context, it) }
-
- badgePaint.color = icon?.badgeColor ?: 0
- canvas.drawOval(badgeRect, badgeShadowPaint)
- canvas.drawOval(badgeRect, badgePaint)
-
- badgeProgress?.let {
- canvas.drawArc(badgeRect, 270f, it * 360, true, badgeProgressPaint)
- }
- badgeIcon?.let {
- it.setBounds(
- (drawRect.right - badgeSize * 0.9f).toInt(),
- (drawRect.bottom - badgeSize * 0.9f).toInt(),
- (drawRect.right - badgeSize * 0.1f).toInt(),
- (drawRect.bottom - badgeSize * 0.1f).toInt()
- )
- it.setBounds(
- badgeRect.left.roundToInt(),
- badgeRect.top.roundToInt(),
- badgeRect.right.roundToInt(),
- badgeRect.bottom.roundToInt()
- )
- it.draw(canvas)
- return
- }
- badgeNumber?.takeIf { it in 1..99 }?.let {
- val text = it.toString()
- val textSize = (1f - 0.1f - text.length * 0.1f) * badgeSize
- badgeTextPaint.textSize = textSize
- badgeTextPaint.getTextBounds(text, 0, text.length, textBounds)
- canvas.drawText(
- it.toString(),
- badgeRect.centerX(),
- badgeRect.centerY() - textBounds.exactCenterY(),
- badgeTextPaint
- )
- }
}
private var longClicked = false