chore: Convert images to WebP

Signed-off-by: keta1 <k@ketal.icu>
This commit is contained in:
keta1
2022-04-17 16:55:36 +08:00
parent 43150be67a
commit 4747ace53f
21 changed files with 5 additions and 15 deletions

View File

@@ -55,6 +55,7 @@ android {
getByName("debug") {
isShrinkResources = false
isMinifyEnabled = false
isCrunchPngs = false
proguardFiles("proguard-rules.pro")
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -22,8 +22,6 @@
package me.ketal.hook
import android.content.Context
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
@@ -37,12 +35,10 @@ import io.github.qauxv.base.annotation.UiItemAgentEntry
import io.github.qauxv.bridge.QQMessageFacade
import io.github.qauxv.dsl.FunctionEntryRouter
import io.github.qauxv.hook.CommonSwitchFunctionHook
import io.github.qauxv.ui.ResUtils
import io.github.qauxv.util.DexKit
import io.github.qauxv.util.Initiator
import xyz.nextalone.util.hookAfter
import xyz.nextalone.util.throwOrTrue
import xyz.nextalone.util.throwOrTrue
@FunctionHookEntry
@UiItemAgentEntry
@@ -59,13 +55,6 @@ object MultiActionHook : CommonSwitchFunctionHook(
override val uiItemLocation = FunctionEntryRouter.Locations.Auxiliary.CHAT_CATEGORY
private var baseChatPie: Any? = null
private var img: Bitmap? = null
private val recallBitmap: Bitmap?
get() {
if (img == null || img!!.isRecycled) img =
BitmapFactory.decodeStream(ResUtils.openAsset("recall.png"))
return img
}
public override fun initOnce() = throwOrTrue {
val m = DexKit.doFindMethod(DexKit.N_BASE_CHAT_PIE__createMulti)
@@ -77,7 +66,7 @@ object MultiActionHook : CommonSwitchFunctionHook(
val count = rootView.childCount
val enableTalkBack = rootView.getChildAt(0).contentDescription != null
if (rootView.findViewById<View?>(R.id.ketalRecallImageView) == null) rootView.addView(
create(context, recallBitmap, enableTalkBack),
create(context, R.drawable.ic_recall, enableTalkBack),
count - 1
)
setMargin(rootView)
@@ -146,13 +135,13 @@ object MultiActionHook : CommonSwitchFunctionHook(
return true
}
private fun create(context: Context, bitmap: Bitmap?, enableTalkBack: Boolean): ImageView {
private fun create(context: Context, resId: Int, enableTalkBack: Boolean): ImageView {
val imageView = ImageView(context)
if (enableTalkBack) {
imageView.contentDescription = "撤回"
}
imageView.setOnClickListener { recall() }
imageView.setImageBitmap(bitmap)
imageView.setImageResource(resId)
imageView.id = R.id.ketalRecallImageView
return imageView
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 921 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 891 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

View File

@@ -16,7 +16,7 @@ val verCode = Common.getBuildVersionCode(rootProject)
val verName = "1.2.2" + (Common.getGitHeadRefsSuffix(rootProject))
val androidTargetSdkVersion by extra(32)
val androidMinSdkVersion by extra(24)
val androidCompileSdkVersion by extra(32)
val androidCompileSdkVersion by extra(31)
val androidBuildToolsVersion by extra("32.0.0")
val androidCompileNdkVersion = Version.getNdkVersion(project)