Remove unused stuff
This commit is contained in:
parent
189ea7dbb5
commit
4b5cd4ed0d
@ -105,9 +105,6 @@ dependencies {
|
||||
implementation(libs.coil.core)
|
||||
implementation(libs.coil.svg)
|
||||
|
||||
implementation(libs.lottie.core)
|
||||
|
||||
|
||||
implementation(libs.bundles.materialdialogs)
|
||||
|
||||
implementation(libs.draglinearlayout)
|
||||
|
||||
@ -43,7 +43,6 @@ dependencies {
|
||||
|
||||
implementation(libs.androidx.palette)
|
||||
|
||||
implementation(libs.lottie.core)
|
||||
implementation(libs.bundles.materialdialogs)
|
||||
|
||||
implementation(project(":ktx"))
|
||||
|
||||
@ -31,13 +31,6 @@ val OpenSourceLicenses = arrayOf(
|
||||
licenseText = R.raw.license_apache_2,
|
||||
url = "https://material.io/develop/android/"
|
||||
),
|
||||
OpenSourceLibrary(
|
||||
name = "Lottie",
|
||||
description = "Lottie is a library for Android, iOS, Web, and Windows that parses Adobe After Effects animations exported as json with Bodymovin and renders them natively on mobile and on the web.",
|
||||
licenseName = R.string.apache_license_name,
|
||||
licenseText = R.raw.license_apache_2,
|
||||
url = "https://airbnb.io/lottie/"
|
||||
),
|
||||
OpenSourceLibrary(
|
||||
name = "OkHttp",
|
||||
description = "An HTTP & HTTP/2 client for Android and Java applications",
|
||||
|
||||
@ -1,135 +0,0 @@
|
||||
package de.mm20.launcher2.view
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.*
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.Icon
|
||||
import android.renderscript.Allocation
|
||||
import android.renderscript.Element
|
||||
import android.renderscript.RenderScript
|
||||
import android.renderscript.ScriptIntrinsicBlur
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import com.airbnb.lottie.LottieDrawable
|
||||
import com.airbnb.lottie.LottieProperty
|
||||
import com.airbnb.lottie.model.KeyPath
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
class ElevationImageView : androidx.appcompat.widget.AppCompatImageView {
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleRes: Int) : super(context, attrs, defStyleRes)
|
||||
|
||||
|
||||
private val secondCanvas = Canvas()
|
||||
private var shadowBitmap: Bitmap? = null
|
||||
private var inAllocation: Allocation? = null
|
||||
private lateinit var renderScript : RenderScript
|
||||
private lateinit var blur : ScriptIntrinsicBlur
|
||||
|
||||
val shadowPaint = Paint().also {
|
||||
it.xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_OVER)
|
||||
it.colorFilter = PorterDuffColorFilter(Color.BLACK, PorterDuff.Mode.SRC_ATOP)
|
||||
it.alpha = 66
|
||||
setLayerType(View.LAYER_TYPE_SOFTWARE, null)
|
||||
}
|
||||
|
||||
val clearPaint = Paint().also {
|
||||
it.color = Color.TRANSPARENT
|
||||
it.xfermode = PorterDuffXfermode(PorterDuff.Mode.CLEAR)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
blur.destroy()
|
||||
renderScript.destroy()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
renderScript = RenderScript.create(context)
|
||||
blur = ScriptIntrinsicBlur.create(renderScript, Element.U8_4(renderScript))
|
||||
}
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
secondCanvas.drawRect(0f, 0f, secondCanvas.width.toFloat(), secondCanvas.height.toFloat(), clearPaint)
|
||||
|
||||
if (drawable == null) {
|
||||
return // couldn't resolve the URI
|
||||
}
|
||||
|
||||
val drawableWidth = drawable.intrinsicWidth
|
||||
val drawableHeight = drawable.intrinsicHeight
|
||||
|
||||
if (drawableWidth == 0 || drawableHeight == 0) {
|
||||
return // nothing to draw (empty bounds)
|
||||
}
|
||||
|
||||
if (shadowBitmap?.width != width || shadowBitmap?.height != height) {
|
||||
shadowBitmap?.recycle()
|
||||
inAllocation?.destroy()
|
||||
if (z > 0f && width > 0 && height > 0) {
|
||||
shadowBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888).also {
|
||||
secondCanvas.setBitmap(it)
|
||||
}
|
||||
inAllocation = shadowBitmap?.let { Allocation.createFromBitmap(renderScript, it) }
|
||||
}
|
||||
}
|
||||
|
||||
val saveCount = canvas.saveCount
|
||||
val saveCount2 = secondCanvas.saveCount
|
||||
canvas.save()
|
||||
secondCanvas.save()
|
||||
|
||||
|
||||
canvas.translate(paddingLeft.toFloat(), paddingTop.toFloat())
|
||||
secondCanvas.translate(paddingLeft.toFloat(), paddingTop.toFloat() + getShadowTranslation())
|
||||
|
||||
if (!imageMatrix.isIdentity) {
|
||||
canvas.concat(imageMatrix)
|
||||
secondCanvas.concat(imageMatrix)
|
||||
}
|
||||
|
||||
|
||||
drawable.draw(canvas)
|
||||
drawable.draw(secondCanvas)
|
||||
shadowBitmap = shadowBitmap?.let { blurBitmap(it) }
|
||||
canvas.restoreToCount(saveCount)
|
||||
secondCanvas.restoreToCount(saveCount2)
|
||||
shadowBitmap?.let { canvas.drawBitmap(it, 0f, 0f, shadowPaint) }
|
||||
}
|
||||
|
||||
private fun blurBitmap(bitmap: Bitmap): Bitmap {
|
||||
val alloc = inAllocation ?: return bitmap
|
||||
if (z == 0f) return bitmap
|
||||
alloc.copyFrom(bitmap)
|
||||
blur.setRadius(max(0f, min(getShadowBlurRadius(), 25f)))
|
||||
blur.setInput(alloc)
|
||||
blur.forEach(alloc)
|
||||
alloc.copyTo(bitmap)
|
||||
return bitmap
|
||||
}
|
||||
|
||||
override fun setColorFilter(cf: ColorFilter?) {
|
||||
super.setColorFilter(cf)
|
||||
val drawable = drawable
|
||||
if (drawable is LottieDrawable) {
|
||||
drawable.addValueCallback(KeyPath("**"), LottieProperty.COLOR_FILTER) {
|
||||
cf
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun getShadowTranslation(): Float {
|
||||
return z * 0.5f
|
||||
}
|
||||
|
||||
private fun getShadowBlurRadius(): Float {
|
||||
return z * 0.5f
|
||||
}
|
||||
}
|
||||
@ -262,14 +262,6 @@ dependencyResolutionManagement {
|
||||
.to("com.google.android.material", "compose-theme-adapter")
|
||||
.version("1.1.1")
|
||||
|
||||
version("lottie", "4.2.2")
|
||||
alias("lottie.core")
|
||||
.to("com.airbnb.android", "lottie")
|
||||
.versionRef("lottie")
|
||||
alias("lottie.compose")
|
||||
.to("com.airbnb.android", "lottie-compose")
|
||||
.versionRef("lottie")
|
||||
|
||||
alias("okhttp")
|
||||
.to("com.squareup.okhttp3", "okhttp")
|
||||
.version("4.9.1")
|
||||
|
||||
@ -67,8 +67,6 @@ dependencies {
|
||||
|
||||
implementation(libs.composecolorpicker)
|
||||
|
||||
implementation(libs.lottie.compose)
|
||||
|
||||
// Legacy dependencies
|
||||
implementation(libs.androidx.transition)
|
||||
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
package de.mm20.launcher2.ui.component
|
||||
/*
|
||||
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.requiredSize
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.material3.LocalContentAlpha
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.airbnb.lottie.compose.LottieAnimation
|
||||
import com.airbnb.lottie.compose.LottieAnimationSpec
|
||||
import com.airbnb.lottie.compose.LottieAnimationState
|
||||
import com.airbnb.lottie.compose.rememberLottieAnimationState
|
||||
|
||||
@Composable
|
||||
fun LottieIcon(
|
||||
spec: LottieAnimationSpec,
|
||||
modifier: Modifier = Modifier,
|
||||
animationState: LottieAnimationState = rememberLottieAnimationState(autoPlay = true),
|
||||
) {
|
||||
LottieAnimation(
|
||||
spec = spec,
|
||||
modifier = modifier.alpha(LocalContentAlpha.current).requiredSize(24.dp),
|
||||
animationState = animationState
|
||||
)
|
||||
}*/
|
||||
@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/musicCompactMeta"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="108dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:foreground="?android:selectableItemBackgroundBorderless"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/musicCompactTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="marquee"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
|
||||
android:textColor="@color/text_color_primary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/musicCompactArtist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="marquee"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
android:textColor="@color/text_color_secondary" />
|
||||
</LinearLayout>
|
||||
|
||||
<de.mm20.launcher2.view.ElevationImageView
|
||||
android:id="@+id/musicCompactNext"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:clickable="true"
|
||||
android:elevation="@dimen/card_elevation"
|
||||
android:focusable="true"
|
||||
android:foreground="?android:selectableItemBackgroundBorderless"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/ic_skip_next_anim" />
|
||||
|
||||
<de.mm20.launcher2.view.ElevationImageView
|
||||
android:id="@+id/musicCompactPlay"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginEnd="64dp"
|
||||
android:clickable="true"
|
||||
android:elevation="@dimen/card_elevation"
|
||||
android:focusable="true"
|
||||
android:foreground="?android:selectableItemBackgroundBorderless"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/ic_pause" />
|
||||
</merge>
|
||||
@ -1,74 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/searchEdit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@null"
|
||||
android:hint="@string/edit_text_search_hint"
|
||||
android:imeOptions="actionSearch"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="text"
|
||||
android:shadowColor="#000"
|
||||
android:shadowDx="1"
|
||||
android:shadowDy="1"
|
||||
android:textAppearance="?textAppearanceBodyLarge"
|
||||
app:layout_constraintEnd_toStartOf="@+id/overflowMenu"
|
||||
app:layout_constraintStart_toEndOf="@+id/searchIcon"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<de.mm20.launcher2.view.ElevationImageView
|
||||
android:id="@+id/overflowMenu"
|
||||
style="?iconStyle"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:foreground="?selectableItemBackgroundBorderless"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/ic_more_vert"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<de.mm20.launcher2.view.ElevationImageView
|
||||
android:id="@+id/searchIcon"
|
||||
style="?iconStyle"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/ic_search"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<de.mm20.launcher2.ui.legacy.component.WebSearchView
|
||||
android:id="@+id/webSearchView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/searchIcon" />
|
||||
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/searchProgressBar"
|
||||
style="?android:progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@+id/searchIcon" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</merge>
|
||||
Loading…
x
Reference in New Issue
Block a user