From 4d819b2257eabb8f04efec8bcc7a9e9c82da0a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E7=A9=BA?= <70465933+YuKongA@users.noreply.github.com> Date: Mon, 30 Sep 2024 18:46:29 +0800 Subject: [PATCH] 1 --- .../lyric/hook/module/SystemUILyric.kt | 795 ------------------ .../lyric/hook/module/SystemUITest.kt | 220 ----- .../statusbar/lyric/tools/ActivityTools.kt | 185 ---- .../lyric/view/EdgeTransparentView.kt | 77 -- .../statusbar/lyric/view/LyricSwitchView.kt | 111 --- .../statusbar/lyric/view/LyricTextView.kt | 132 --- .../java/statusbar/lyric/view/TitleDialog.kt | 219 ----- .../kotlin/statusbar/lyric/config/Config.kt | 11 - .../lyric/hook/module/SystemUILyric.kt | 118 --- .../kotlin/statusbar/lyric/tools/BlurTools.kt | 4 - .../statusbar/lyric/tools/LyricViewTools.kt | 26 - .../kotlin/statusbar/lyric/tools/Tools.kt | 37 - app/src/main/res/drawable/ic_song.xml | 5 - app/src/main/res/values-zh-rCN/strings.xml | 95 --- app/src/main/res/values-zh-rTW/strings.xml | 95 --- app/src/main/res/values/strings.xml | 47 -- blockmiui | 1 - 17 files changed, 2178 deletions(-) delete mode 100644 app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt delete mode 100644 app/src/main/java/statusbar/lyric/hook/module/SystemUITest.kt delete mode 100644 app/src/main/java/statusbar/lyric/tools/ActivityTools.kt delete mode 100644 app/src/main/java/statusbar/lyric/view/EdgeTransparentView.kt delete mode 100644 app/src/main/java/statusbar/lyric/view/LyricSwitchView.kt delete mode 100644 app/src/main/java/statusbar/lyric/view/LyricTextView.kt delete mode 100644 app/src/main/java/statusbar/lyric/view/TitleDialog.kt delete mode 160000 blockmiui diff --git a/app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt b/app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt deleted file mode 100644 index ade7ae97..00000000 --- a/app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt +++ /dev/null @@ -1,795 +0,0 @@ -/* - * StatusBarLyric - * Copyright (C) 2021-2022 fkj@fkj233.cn - * https://github.com/577fkj/StatusBarLyric - * - * This software is free opensource software: you can redistribute it - * and/or modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either - * version 3 of the License, or any later version and our eula as published - * by 577fkj. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * and eula along with this software. If not, see - * - * . - */ - -package statusbar.lyric.hook.module - -import android.annotation.SuppressLint -import android.app.AndroidAppHelper -import android.content.BroadcastReceiver -import android.content.Context -import android.content.Intent -import android.content.IntentFilter -import android.content.res.Configuration -import android.graphics.Color -import android.graphics.LinearGradient -import android.graphics.Paint -import android.graphics.Point -import android.graphics.Shader -import android.graphics.Typeface -import android.graphics.drawable.GradientDrawable -import android.media.MediaMetadata -import android.os.Build -import android.util.DisplayMetrics -import android.util.TypedValue -import android.view.Gravity -import android.view.MotionEvent -import android.view.View -import android.view.ViewGroup -import android.widget.ImageView -import android.widget.LinearLayout -import android.widget.TextView -import cn.lyric.getter.api.data.ExtraData -import cn.lyric.getter.api.data.LyricData -import cn.lyric.getter.api.listener.LyricListener -import cn.lyric.getter.api.listener.LyricReceiver -import cn.lyric.getter.api.tools.Tools.base64ToDrawable -import cn.lyric.getter.api.tools.Tools.registerLyricListener -import com.github.kyuubiran.ezxhelper.ClassUtils.loadClassOrNull -import com.github.kyuubiran.ezxhelper.EzXHelper.moduleRes -import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook -import com.github.kyuubiran.ezxhelper.ObjectHelper.Companion.objectHelper -import com.github.kyuubiran.ezxhelper.finders.ConstructorFinder.`-Static`.constructorFinder -import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder -import de.robv.android.xposed.XC_MethodHook -import statusbar.lyric.BuildConfig -import statusbar.lyric.R -import statusbar.lyric.config.XposedOwnSP.config -import statusbar.lyric.hook.BaseHook -import statusbar.lyric.tools.BlurTools.cornerRadius -import statusbar.lyric.tools.BlurTools.setBackgroundBlur -import statusbar.lyric.tools.LogTools.log -import statusbar.lyric.tools.LyricViewTools -import statusbar.lyric.tools.LyricViewTools.hideView -import statusbar.lyric.tools.LyricViewTools.iconColorAnima -import statusbar.lyric.tools.LyricViewTools.showView -import statusbar.lyric.tools.LyricViewTools.textColorAnima -import statusbar.lyric.tools.Tools.goMainThread -import statusbar.lyric.tools.Tools.isHyperOS -import statusbar.lyric.tools.Tools.isLandscape -import statusbar.lyric.tools.Tools.isMIUI -import statusbar.lyric.tools.Tools.isNot -import statusbar.lyric.tools.Tools.isNotNull -import statusbar.lyric.tools.Tools.isNull -import statusbar.lyric.tools.Tools.isPad -import statusbar.lyric.tools.Tools.isTargetView -import statusbar.lyric.tools.Tools.observableChange -import statusbar.lyric.tools.Tools.shell -import statusbar.lyric.tools.Tools.togglePrompts -import statusbar.lyric.view.EdgeTransparentView -import statusbar.lyric.view.LyricSwitchView -import statusbar.lyric.view.TitleDialog -import java.io.File -import kotlin.math.abs -import kotlin.math.min - -class SystemUILyric : BaseHook() { - - private lateinit var hook: XC_MethodHook.Unhook - val context: Context by lazy { AndroidAppHelper.currentApplication() } - private var lastColor: Int by observableChange(Color.WHITE) { _, newValue -> - goMainThread { - if (config.lyricColor.isEmpty() && config.lyricGradientColor.isEmpty()) { - when (config.lyricColorScheme) { - 0 -> lyricView.setTextColor(newValue) - 1 -> lyricView.textColorAnima(newValue) - } - } - if (config.iconColor.isEmpty()) { - when (config.lyricColorScheme) { - 0 -> iconView.setColorFilter(newValue) - 1 -> iconView.iconColorAnima(lastColor, newValue) - } - } - } - "Change Color".log() - } - private var lastLyric: String = "" - private var title: String by observableChange("") { _, newValue -> - if (!config.titleShowWithSameLyric && lastLyric == newValue) return@observableChange - if (!isPlaying) return@observableChange - goMainThread { - titleDialog.apply { - if (newValue.isEmpty()) { - hideTitle() - } else { - showTitle(newValue.trim()) - } - } - } - } - private var lastBase64Icon: String by observableChange("") { _, newValue -> - goMainThread { - base64ToDrawable(newValue).isNotNull { - iconView.showView() - iconView.setImageBitmap(it) - }.isNot { - iconView.hideView() - } - "Change Icon".log() - } - } - private var canLoad: Boolean = true - private var isScreenLock: Boolean = false - private var iconSwitch: Boolean = config.iconSwitch - private var isPlaying: Boolean = false - private var isStop: Boolean = false - private var isHiding: Boolean = false - private var isRandomAnima: Boolean = false - val isReally by lazy { this@SystemUILyric::clockView.isInitialized } - - private var themeMode: Int by observableChange(0) { oldValue, _ -> - if (oldValue == 0) return@observableChange - "onConfigurationChanged".log() - canLoad = true - hideLyric() - } - private var theoreticalWidth: Int = 0 - private lateinit var point: Point - - - private val displayMetrics: DisplayMetrics by lazy { context.resources.displayMetrics } - private val displayWidth: Int by lazy { displayMetrics.widthPixels } - private val displayHeight: Int by lazy { displayMetrics.heightPixels } - - - private lateinit var clockView: TextView - private lateinit var targetView: ViewGroup - private lateinit var mNotificationIconArea: View - private lateinit var mCarrierLabel: View - private lateinit var mPadClockView: View - private val lyricView: LyricSwitchView by lazy { - object : LyricSwitchView(context) { - override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { - super.onSizeChanged(w, h, oldw, oldh) - if (config.lyricGradientColor.isNotEmpty()) { - config.lyricGradientColor.trim().split(",").map { Color.parseColor(it.trim()) }.let { colors -> - if (colors.isEmpty()) { - setTextColor(Color.WHITE) - } else if (colors.size < 2) { - setTextColor(colors[0]) - } else { - val textShader = LinearGradient(0f, 0f, width.toFloat(), 0f, colors.toIntArray(), null, Shader.TileMode.CLAMP) - setLinearGradient(textShader) - } - } - } - } - }.apply { - setTypeface(clockView.typeface) - setSingleLine(true) - setMaxLines(1) - } - } - private val iconView: ImageView by lazy { - ImageView(context).apply { - visibility = View.GONE - } - } - private val lyricLayout: LinearLayout by lazy { - LinearLayout(context).apply { - orientation = LinearLayout.HORIZONTAL - gravity = Gravity.CENTER - layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT) - addView(iconView) - addView(if (config.lyricBlurredEdges) { - EdgeTransparentView(context, config.lyricBlurredEdgesRadius.toFloat()).apply { - addView(lyricView) - } - } else { - lyricView - }) - visibility = View.GONE - } - } - private lateinit var mMIUINetworkSpeedView: TextView - private val titleDialog by lazy { - TitleDialog(context).apply { -// val location = IntArray(2) -// clockView.getLocationOnScreen(location) -// setX(location[0]) - } - } - - - //////////////////////////////Hook////////////////////////////////////// - @SuppressLint("DiscouragedApi") - override fun init() { - "Init Hook".log() - loadClassOrNull(config.textViewClassName).isNotNull { - hook = TextView::class.java.methodFinder().filterByName("onDraw").first().createHook { - after { hookParam -> - val view = (hookParam.thisObject as View) - if (view.isTargetView()) { - if (!canLoad) return@after - "Lyric Init".log() - clockView = view as TextView - targetView = (clockView.parent as LinearLayout).apply { - gravity = Gravity.CENTER - } - canLoad = false - lyricInit() - if (!togglePrompts) hook.unhook() - } - } - } - }.isNot { - moduleRes.getString(R.string.load_class_empty).log() - return - } - if (config.limitVisibilityChange) { - moduleRes.getString(R.string.limit_visibility_change).log() - View::class.java.methodFinder().filterByName("setVisibility").first().createHook { - before { hookParam -> - if (isPlaying && !isHiding) { - if (hookParam.args[0] == View.VISIBLE) { - val view = hookParam.thisObject as View - if (view.isTargetView() || (this@SystemUILyric::mNotificationIconArea.isInitialized && mNotificationIconArea == view) || (this@SystemUILyric::mCarrierLabel.isInitialized && mCarrierLabel == view) || (this@SystemUILyric::mMIUINetworkSpeedView.isInitialized && mMIUINetworkSpeedView == view) || (this@SystemUILyric::mPadClockView.isInitialized && mPadClockView == view)) { - hookParam.args[0] = View.GONE - } - } - } - } - } - } - if (config.titleSwitch) { - for (i in 0..10) { - val clazz = loadClassOrNull("com.android.systemui.statusbar.NotificationMediaManager$$i") - clazz.log() - if (clazz.isNotNull()) { - if (clazz!!.hasMethod("onMetadataChanged")) { - clazz.methodFinder().filterByName("onMetadataChanged").first().createHook { - after { hookParam -> - if (isStop || !isPlaying) return@after - val metadata = hookParam.args[0] as? MediaMetadata ?: return@after - title = metadata.getString(if (config.useBlueGetTitle) MediaMetadata.METADATA_KEY_ARTIST else MediaMetadata.METADATA_KEY_TITLE) - } - } - break - } - } - } - } - "${moduleRes.getString(R.string.lyric_color_scheme)}:${config.lyricColorScheme}".log() - when (config.lyricColorScheme) { - 0 -> { - loadClassOrNull("com.android.systemui.statusbar.phone.DarkIconDispatcherImpl").isNotNull { - it.methodFinder().filterByName("applyDarkIntensity").first().createHook { - after { hookParam -> - if (!isPlaying) return@after - val mIconTint = hookParam.thisObject.objectHelper().getObjectOrNullAs("mIconTint") - lastColor = mIconTint ?: Color.BLACK - } - } - } - } - - 1 -> { - loadClassOrNull("com.android.systemui.statusbar.phone.NotificationIconAreaController").isNotNull { - it.methodFinder().filterByName("onDarkChanged").first().createHook { - after { hookParam -> - if (!isPlaying) return@after - val isDark = (hookParam.args[1] as Float) == 1f - lastColor = if (isDark) Color.BLACK else Color.WHITE - } - } - } - } - } - if (config.hideNotificationIcon) { - moduleRes.getString(R.string.hide_notification_icon).log() - loadClassOrNull("com.android.systemui.statusbar.phone.NotificationIconAreaController").isNotNull { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - it.constructorFinder().first().createHook { - after { hookParam -> - hookParam.thisObject.objectHelper { - mNotificationIconArea = this.getObjectOrNullAs("mNotificationIconArea")!! - } - } - } - } else { - it.methodFinder().filterByName("initializeNotificationAreaViews").first().createHook { - after { hookParam -> - val clazz = hookParam.thisObject::class.java - if (clazz.simpleName == "NotificationIconAreaController") { - hookParam.thisObject.objectHelper { - mNotificationIconArea = this.getObjectOrNullAs("mNotificationIconArea")!! - } - } else { - mNotificationIconArea = clazz.superclass.getField("mNotificationIconArea").get(hookParam.thisObject) as View - } - } - } - } - } - } - if (config.hideCarrier && Build.VERSION.SDK_INT <= Build.VERSION_CODES.TIRAMISU) { - moduleRes.getString(R.string.hide_carrier).log() - loadClassOrNull("com.android.systemui.statusbar.phone.KeyguardStatusBarView").isNotNull { - it.methodFinder().filterByName("onFinishInflate").first().createHook { - after { hookParam -> - val clazz = hookParam.thisObject::class.java - if (clazz.simpleName == "KeyguardStatusBarView") { - hookParam.thisObject.objectHelper { - mCarrierLabel = this.getObjectOrNullAs("mCarrierLabel")!! - } - } else { - mCarrierLabel = clazz.superclass.getField("mCarrierLabel").get(hookParam.thisObject) as View - } - } - } - } - } - if (config.clickStatusBarToHideLyric || config.slideStatusBarCutSongs) { - loadClassOrNull("com.android.systemui.statusbar.phone.PhoneStatusBarView").isNotNull { - it.methodFinder().filterByName("onTouchEvent").first().createHook { - before { hookParam -> - val motionEvent = hookParam.args[0] as MotionEvent - when (motionEvent.action) { - MotionEvent.ACTION_DOWN -> { - point = Point(motionEvent.rawX.toInt(), motionEvent.rawY.toInt()) - } - - MotionEvent.ACTION_MOVE -> { - } - - MotionEvent.ACTION_UP -> { - val isMove = abs(point.y - motionEvent.rawY.toInt()) > 50 || abs(point.x - motionEvent.rawX.toInt()) > 50 - val isLongChick = motionEvent.eventTime - motionEvent.downTime > 500 - when (isMove) { - true -> { - if (config.slideStatusBarCutSongs && isPlaying) { - if (abs(point.y - motionEvent.rawY.toInt()) <= config.slideStatusBarCutSongsYRadius) { - val i = point.x - motionEvent.rawX.toInt() - if (abs(i) > config.slideStatusBarCutSongsXRadius) { - moduleRes.getString(R.string.slide_status_bar_cut_songs).log() - if (i > 0) { - shell("input keyevent 87", false) - } else { - shell("input keyevent 88", false) - } - hookParam.result = true - } - } - } - } - - false -> { - when (isLongChick) { - true -> { - if (config.longClickStatusBarStop) { - moduleRes.getString(R.string.long_click_status_bar_stop).log() - shell("input keyevent 85", false) - hookParam.result = true - } - } - - false -> { - if (config.clickStatusBarToHideLyric) { - val isClick = motionEvent.eventTime - motionEvent.downTime < 200 - if (isClick && isPlaying) { - moduleRes.getString(R.string.click_status_bar_to_hide_lyric).log() - isHiding.log() - if (isHiding) { - isHiding = false - hookParam.result = true - changeLyric(lastLyric, 0) - } else { - val x = motionEvent.x.toInt() - val y = motionEvent.y.toInt() - val left = lyricLayout.left - val top = lyricLayout.top - val right = lyricLayout.right - val bottom = lyricLayout.bottom - if (x in left..right && y in top..bottom) { - isHiding = true - hookParam.result = true - hideLyric() - } - } - } - } - } - } - } - } - } - } - } - } - } - } - SystemUISpecial() - } - - @SuppressLint("UnspecifiedRegisterReceiverFlag", "MissingPermission") - private fun lyricInit() { - val firstLoad = lyricLayout.parent.isNull() - goMainThread(1) { - runCatching { (lyricLayout.parent as ViewGroup).removeView(lyricLayout) } - if (config.viewIndex == 0) { - targetView.addView(lyricLayout, 0) - } else { - targetView.addView(lyricLayout) - } - if (config.lyricWidth == 0) { - lyricView.maxLyricWidth(targetView.width.toFloat()) - } else { - lyricView.maxLyricWidth(scaleWidth().toFloat() + config.lyricEndMargins + config.lyricStartMargins) - } - if (isHyperOS() && config.mHyperOSTexture) { - val blurRadio = config.mHyperOSTextureRadio - val cornerRadius = cornerRadius(config.mHyperOSTextureCorner.toFloat()) - val blendModes = arrayOf( - intArrayOf(106, Color.parseColor(config.mHyperOSTextureBgColor)), intArrayOf(3, Color.parseColor(config.mHyperOSTextureBgColor)) - ) - lyricLayout.setBackgroundBlur(blurRadio, cornerRadius, blendModes) - } - - themeMode = (context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) - } - - if (!firstLoad) return - val lyricReceiver = LyricReceiver(object : LyricListener() { - override fun onStop(lyricData: LyricData) { - if (!isReally) return - if (isHiding) isHiding = false - hideLyric() - } - - override fun onUpdate(lyricData: LyricData) { - if (!isReally) return - val lyric = lyricData.lyric - lastLyric = lyric - if (isHiding) return - changeIcon(lyricData.extraData) - changeLyric(lastLyric, lyricData.extraData.delay) - } - }) - registerLyricListener(context, BuildConfig.API_VERSION, lyricReceiver) - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - context.registerReceiver(UpdateConfig(), IntentFilter("updateConfig"), Context.RECEIVER_EXPORTED) - } else { - context.registerReceiver(UpdateConfig(), IntentFilter("updateConfig")) - } - if (config.hideLyricWhenLockScreen) { - val screenLockFilter = IntentFilter().apply { - addAction(Intent.ACTION_SCREEN_OFF) - addAction(Intent.ACTION_USER_PRESENT) - } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - context.registerReceiver(ScreenLockReceiver(), screenLockFilter, Context.RECEIVER_EXPORTED) - } else { - context.registerReceiver(ScreenLockReceiver(), screenLockFilter) - } - } - changeConfig(1) - } - - private fun changeLyric(lyric: String, delay: Int) { - if (isHiding || isScreenLock) return - "lyric:$lyric".log() - isStop = false - isPlaying = true - goMainThread { - if (!isPlaying && config.lyricColor.isEmpty()) { - lastColor = clockView.currentTextColor - } - lyricLayout.showView() - if (config.hideTime) clockView.hideView() - if (this::mNotificationIconArea.isInitialized) mNotificationIconArea.hideView() - if (this::mCarrierLabel.isInitialized) mCarrierLabel.hideView() - if (this::mMIUINetworkSpeedView.isInitialized) mMIUINetworkSpeedView.hideView() - if (this::mPadClockView.isInitialized) mPadClockView.hideView() - lyricView.apply { - width = getLyricWidth(getPaint(), lyric) - val i = width - theoreticalWidth - if (config.dynamicLyricSpeed && delay == 0) { - if (i > 0) { - val proportion = i * 1.0 / displayWidth - "proportion:$proportion".log() - val speed = 15 * proportion + 0.7 - "speed:$speed".log() - setScrollSpeed(speed.toFloat()) - } - } - if (delay > 0) { - if (i > 0) { - val d = delay * 1000.0 / 16.0 - setScrollSpeed(((i / d).toFloat())) - } - } - setText(lyric) - } - } - } - - private fun changeIcon(it: ExtraData) { - lyricView.iconWidth(iconView.width.toFloat()) - if (!iconSwitch) return - if (config.changeAllIcons.isNotEmpty()) { - lastBase64Icon = config.changeAllIcons - } else { - val customIcon = it.customIcon && it.base64Icon.isNotEmpty() - lastBase64Icon = if (customIcon) { - it.base64Icon - } else { - config.getDefaultIcon(it.packageName) - } - } - } - - private fun hideLyric(anim: Boolean = true) { - if (isStop) return - if (!isHiding && isPlaying) { - isPlaying = false - isStop = true - } - "isPlaying:$isPlaying".log() - "Hide Lyric".log() - goMainThread { - lyricLayout.hideView(anim) - clockView.showView() - if (config.titleSwitch) titleDialog.hideTitle() - if (this::mNotificationIconArea.isInitialized) mNotificationIconArea.showView() - if (this::mCarrierLabel.isInitialized) mCarrierLabel.showView() - if (this::mMIUINetworkSpeedView.isInitialized) mMIUINetworkSpeedView.showView() - if (this::mPadClockView.isInitialized) mPadClockView.showView() - } - } - - private fun changeConfig(delay: Long = 0L) { - "Change Config".log() - config.update() - goMainThread(delay) { - lyricView.apply { - setTextSize(TypedValue.COMPLEX_UNIT_SHIFT, if (config.lyricSize == 0) clockView.textSize else config.lyricSize.toFloat()) - setPadding(config.lyricStartMargins, config.lyricTopMargins, config.lyricEndMargins, config.lyricBottomMargins) - if (config.lyricGradientColor.isEmpty()) { - if (config.lyricColor.isEmpty()) { - when (config.lyricColorScheme) { - 0 -> setTextColor(clockView.currentTextColor) - 1 -> textColorAnima(clockView.currentTextColor) - } - } else { - setTextColor(Color.parseColor(config.lyricColor)) - } - } - if (config.lyricWidth == 0) { - maxLyricWidth(targetView.width.toFloat()) - } else { - maxLyricWidth(scaleWidth().toFloat() + config.lyricEndMargins + config.lyricStartMargins) - } - setLetterSpacings(config.lyricLetterSpacing / 100f) - strokeWidth(config.lyricStrokeWidth / 100f) - if (!config.dynamicLyricSpeed) setScrollSpeed(config.lyricSpeed.toFloat()) - if (config.lyricBackgroundColor.isNotEmpty()) { - if (config.lyricBackgroundColor.split(",").size < 2) { - if (config.lyricBackgroundRadius != 0) { - setBackgroundColor(Color.TRANSPARENT) - background = GradientDrawable().apply { - cornerRadius = config.lyricBackgroundRadius.toFloat() - setColor(Color.parseColor(config.lyricBackgroundColor)) - } - } else { - setBackgroundColor(Color.parseColor(config.lyricBackgroundColor)) - } - } else { - config.lyricBackgroundColor.trim().split(",").map { Color.parseColor(it.trim()) }.let { colors -> - val gradientDrawable = GradientDrawable( - GradientDrawable.Orientation.LEFT_RIGHT, colors.toIntArray() - ).apply { - if (config.lyricBackgroundRadius != 0) cornerRadius = config.lyricBackgroundRadius.toFloat() - } - background = gradientDrawable - } - } - } - - val animation = config.animation - val interpolator = config.interpolator - val duration = config.animationDuration - isRandomAnima = config.animation == "Random" - if (!isRandomAnima) { - inAnimation = LyricViewTools.switchViewInAnima(animation, interpolator, duration) - outAnimation = LyricViewTools.switchViewOutAnima(animation, duration) - } - runCatching { - val file = File("${context.filesDir.path}/font") - if (file.exists() && file.canRead()) { - setTypeface(Typeface.createFromFile(file)) - } - } - } - if (!config.iconSwitch) { - iconView.hideView() - iconSwitch = false - } else { - iconView.showView() - iconSwitch = true - iconView.apply { - layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT).apply { - setMargins(config.iconStartMargins, config.iconTopMargins, 0, config.iconBottomMargins) - if (config.iconSize == 0) { - width = clockView.height / 2 - height = clockView.height / 2 - } else { - width = config.iconSize - height = config.iconSize - } - } - if (config.iconColor.isEmpty()) { - when (config.lyricColorScheme) { - 0 -> setColorFilter(clockView.currentTextColor) - 1 -> iconColorAnima(lastColor, clockView.currentTextColor) - } - } else { - when (config.lyricColorScheme) { - 0 -> setColorFilter(Color.parseColor(config.iconColor)) - 1 -> iconColorAnima(lastColor, Color.parseColor(config.iconColor)) - } - } - if (config.iconBgColor.isEmpty()) { - setBackgroundColor(Color.TRANSPARENT) - } else { - setBackgroundColor(Color.parseColor(config.iconBgColor)) - } - } - } - if (this::mNotificationIconArea.isInitialized) if (config.hideNotificationIcon) mNotificationIconArea.hideView() else mNotificationIconArea.showView() - } - } - - private fun getLyricWidth(paint: Paint, text: String): Int { - "Get Lyric Width".log() - return if (config.lyricWidth == 0) { - theoreticalWidth = min(paint.measureText(text).toInt(), targetView.width) - theoreticalWidth - } else { - if (config.fixedLyricWidth) { - scaleWidth() - } else { - min(paint.measureText(text).toInt(), scaleWidth()) - } - } - } - - private fun scaleWidth(): Int { - "Scale Width".log() - return (config.lyricWidth / 100f * if (context.isLandscape()) displayHeight else displayWidth).toInt() - } - - private fun Class<*>.hasMethod(methodName: String): Boolean { - val methods = declaredMethods - for (method in methods) { - if (method.name == methodName) return true - } - return false - } - - inner class SystemUISpecial { - init { - if (isMIUI) { - for (i in 0..10) { - val clazz = loadClassOrNull("com.android.keyguard.wallpaper.MiuiKeyguardWallPaperManager\$$i") - if (clazz.isNotNull()) { - if (clazz!!.hasMethod("onWallpaperChanged")) { - clazz.methodFinder().filterByName("onWallpaperChanged").first().createHook { - after { - if (this@SystemUILyric::clockView.isInitialized) { - "onWallpaperChanged".log() - canLoad = true - hideLyric() - } - } - } - } - break - } - } - } - - if (togglePrompts) { - loadClassOrNull("com.android.systemui.SystemUIApplication").isNotNull { clazz -> - clazz.methodFinder().filterByName("onConfigurationChanged").first().createHook { - after { hookParam -> - "onConfigurationChanged".log() - val newConfig = hookParam.args[0] as Configuration - themeMode = newConfig.uiMode and Configuration.UI_MODE_NIGHT_MASK - } - } - if (isMIUI && config.mMiuiPadOptimize) { - clazz.methodFinder().filterByName("onCreate").first().createHook { - after { - if (isPad) { - loadClassOrNull("com.android.systemui.statusbar.phone.MiuiCollapsedStatusBarFragment").isNotNull { - if (it.hasMethod("initMiuiViewsOnViewCreated")) { - it.methodFinder().filterByName("initMiuiViewsOnViewCreated").first() - } else { - it.methodFinder().filterByName("onViewCreated").first() - }.let { method -> - method.createHook { - after { hookParam -> - hookParam.thisObject.objectHelper { - mPadClockView = this.getObjectOrNullAs("mPadClockView")!! - } - } - } - } - } - } - } - } - } - } - } - - if (isMIUI && config.mMIUIHideNetworkSpeed) { - moduleRes.getString(R.string.miui_hide_network_speed).log() - loadClassOrNull("com.android.systemui.statusbar.views.NetworkSpeedView").isNotNull { - it.constructorFinder().first().createHook { - after { hookParam -> - mMIUINetworkSpeedView = hookParam.thisObject as TextView - } - } - it.methodFinder().filterByName("setVisibilityByController").first().createHook { - before { hookParam -> - if (isPlaying) { - hookParam.args[0] = false - } - } - } - } - } - } - } - - inner class UpdateConfig : BroadcastReceiver() { - override fun onReceive(context: Context, intent: Intent) { - when (intent.getStringExtra("type")) { - "normal" -> { - if (!isReally) return - changeConfig() - } - - "change_font" -> {} - "reset_font" -> {} - } - } - } - - inner class ScreenLockReceiver : BroadcastReceiver() { - override fun onReceive(context: Context, intent: Intent) { - isScreenLock = intent.action == Intent.ACTION_SCREEN_OFF - if (isScreenLock) hideLyric(false) - } - } -} diff --git a/app/src/main/java/statusbar/lyric/hook/module/SystemUITest.kt b/app/src/main/java/statusbar/lyric/hook/module/SystemUITest.kt deleted file mode 100644 index 230f869e..00000000 --- a/app/src/main/java/statusbar/lyric/hook/module/SystemUITest.kt +++ /dev/null @@ -1,220 +0,0 @@ -/* - * StatusBarLyric - * Copyright (C) 2021-2022 fkj@fkj233.cn - * https://github.com/577fkj/StatusBarLyric - * - * This software is free opensource software: you can redistribute it - * and/or modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either - * version 3 of the License, or any later version and our eula as published - * by 577fkj. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * and eula along with this software. If not, see - * - * . - */ - -package statusbar.lyric.hook.module - -import android.annotation.SuppressLint -import android.app.Application -import android.content.BroadcastReceiver -import android.content.Context -import android.content.Intent -import android.content.IntentFilter -import android.graphics.Color -import android.os.Build -import android.view.Gravity -import android.view.View -import android.widget.LinearLayout -import android.widget.TextView -import com.github.kyuubiran.ezxhelper.EzXHelper.moduleRes -import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook -import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder -import de.robv.android.xposed.XC_MethodHook -import statusbar.lyric.R -import statusbar.lyric.config.XposedOwnSP.config -import statusbar.lyric.data.Data -import statusbar.lyric.hook.BaseHook -import statusbar.lyric.tools.ActivityTestTools.receiveClass -import statusbar.lyric.tools.LogTools.log -import statusbar.lyric.tools.LyricViewTools.hideView -import statusbar.lyric.tools.LyricViewTools.showView -import statusbar.lyric.tools.Tools.dispose -import statusbar.lyric.tools.Tools.goMainThread -import java.text.SimpleDateFormat -import java.time.LocalDateTime -import java.util.Locale - -class SystemUITest : BaseHook() { - private lateinit var hook: XC_MethodHook.Unhook - private var lastTime: Int = 0 - lateinit var context: Context - lateinit var lastView: TextView - val testTextView by lazy { - TextView(context).apply { - text = moduleRes.getString(R.string.app_name) - isSingleLine = true - gravity = Gravity.CENTER - setBackgroundColor(Color.WHITE) - setTextColor(Color.BLACK) - } - } - private val dataHashMap by lazy { HashMap() } - - - @SuppressLint("UnspecifiedRegisterReceiverFlag") - override fun init() { - var isLoad = false - Application::class.java.methodFinder().filterByName("attach").first().createHook { - after { - if (isLoad) return@after - isLoad = true - context = it.args[0] as Context - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - context.registerReceiver(TestReceiver(), IntentFilter("TestReceiver"), Context.RECEIVER_EXPORTED) - } else { - context.registerReceiver(TestReceiver(), IntentFilter("TestReceiver")) - } - moduleRes.getString(R.string.start_hooking_text_view).log() - hook() - - } - } - } - - private fun hook() { - hook = TextView::class.java.methodFinder().filterByName("onDraw").first().createHook { - after { hookParam -> - canHook { - val view = (hookParam.thisObject as TextView) - val className = hookParam.thisObject::class.java.name - val text = view.text.toString().dispose() - text.isTimeSame { - if (className.filterClassName()) { - view.filterView { - val parentView = (view.parent as LinearLayout) - val data = if (dataHashMap.size == 0) { - Data(className, view.id, parentView::class.java.name, parentView.id, false, 0, view.textSize) - } else { - var index = 0 - dataHashMap.values.forEach { data -> - if (data.textViewClassName == className && data.textViewId == view.id && data.parentViewClassName == parentView::class.java.name && data.parentViewId == parentView.id && data.textSize == view.textSize) { - index += 1 - } - } - Data(className, view.id, parentView::class.java.name, parentView.id, index != 0, index, view.textSize) - } - dataHashMap[view] = data - moduleRes.getString(R.string.first_filter).format(data, dataHashMap.size).log() - } - } - } - } - } - } - } - - private fun String.isTimeSame(callback: () -> Unit) { - val timeFormat = arrayOf(SimpleDateFormat("H:mm", Locale.getDefault()), SimpleDateFormat("h:mm", Locale.getDefault())) - val nowTime = System.currentTimeMillis() - timeFormat.forEach { - if (it.format(nowTime).toRegex().containsMatchIn(this)) { - callback() - return - } - } - if (config.relaxConditions) { - if (this.contains("周")) { - callback() - return - } - if (this.contains("月")) { - callback() - return - } - if (this.contains("日")) { - callback() - return - } - } - } - - private fun String.filterClassName(): Boolean { - if (config.relaxConditions) return true - val filterList = arrayListOf("controlcenter", "image", "keyguard") - filterList.forEach { - if (contains(it, true)) return false - } - return this != TextView::class.java.name - } - - @SuppressLint("DiscouragedApi") - private fun View.filterView(function: () -> Unit) { - if (this.parent is LinearLayout) { - val parentView = (this.parent as LinearLayout) - val id = context.resources.getIdentifier("clock_container", "id", context.packageName) - if (parentView.id != id) { - function() - } - } - } - - private fun canHook(callback: () -> Unit) { - val minutes = LocalDateTime.now().minute - if (lastTime == 0) { - lastTime = minutes - } else { - if (lastTime - minutes == -1) { - hook.unhook() - } - } - callback() - } - - inner class TestReceiver : BroadcastReceiver() { - override fun onReceive(context: Context, intent: Intent) { - when (intent.getStringExtra("Type")) { - "GetClass" -> { - if (dataHashMap.size == 0) { - moduleRes.getString(R.string.no_text_view).log() - context.receiveClass(arrayListOf()) - return - } else { - moduleRes.getString(R.string.send_text_view_class).format(dataHashMap).log() - context.receiveClass(ArrayList(dataHashMap.values)) - } - } - - "ShowView" -> { - val data = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - intent.getParcelableExtra("Data", Data::class.java) - } else { - @Suppress("DEPRECATION") intent.getParcelableExtra("Data") - }!! - goMainThread { - dataHashMap.forEach { (textview, da) -> - if (da.textViewClassName == data.textViewClassName && da.textViewId == data.textViewId && da.parentViewClassName == data.parentViewClassName && da.parentViewId == data.parentViewId && da.textSize == data.textSize && da.index == data.index) { - if (this@SystemUITest::lastView.isInitialized) { - (lastView.parent as LinearLayout).removeView(testTextView) - lastView.showView() - } - textview.hideView() - val parentLinearLayout = textview.parent as LinearLayout - parentLinearLayout.addView(testTextView, 0) - lastView = textview - return@forEach - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/app/src/main/java/statusbar/lyric/tools/ActivityTools.kt b/app/src/main/java/statusbar/lyric/tools/ActivityTools.kt deleted file mode 100644 index 1e2ea24e..00000000 --- a/app/src/main/java/statusbar/lyric/tools/ActivityTools.kt +++ /dev/null @@ -1,185 +0,0 @@ -/* - * StatusBarLyric - * Copyright (C) 2021-2022 fkj@fkj233.cn - * https://github.com/577fkj/StatusBarLyric - * - * This software is free opensource software: you can redistribute it - * and/or modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either - * version 3 of the License, or any later version and our eula as published - * by 577fkj. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * and eula along with this software. If not, see - * - * . - */ - -package statusbar.lyric.tools - - -import android.annotation.SuppressLint -import android.content.Intent -import android.content.pm.ApplicationInfo -import android.content.pm.PackageManager -import android.net.Uri -import android.os.Handler -import android.os.Looper -import android.widget.Toast -import cn.fkj233.ui.activity.MIUIActivity.Companion.activity -import cn.fkj233.ui.activity.MIUIActivity.Companion.context -import cn.fkj233.ui.dialog.MIUIDialog -import org.json.JSONException -import org.json.JSONObject -import statusbar.lyric.BuildConfig -import statusbar.lyric.R -import statusbar.lyric.data.Data -import statusbar.lyric.tools.LogTools.log -import statusbar.lyric.tools.Tools.goMainThread -import statusbar.lyric.tools.Tools.isNot -import java.io.BufferedReader -import java.io.InputStreamReader -import java.net.URL -import kotlin.system.exitProcess - -@SuppressLint("StaticFieldLeak") -object ActivityTools { - private val handler by lazy { Handler(Looper.getMainLooper()) } - - - lateinit var dataList: ArrayList - - fun changeConfig(type: String = "normal", path: String = "") { - Thread { - Thread.sleep(200) - context.sendBroadcast(Intent("updateConfig").apply { - putExtra("type", type) - putExtra("path", path) - }) - }.start() - } - - fun showToastOnLooper(message: Any?) { - try { - handler.post { - Toast.makeText(context, message.toString(), Toast.LENGTH_LONG).show() - message.log() - } - } catch (e: RuntimeException) { - e.printStackTrace() - } - } - - fun checkInstalled(pkgName: String): ApplicationInfo? { - return try { - context.packageManager.getApplicationInfo(pkgName, PackageManager.GET_META_DATA) - } catch (_: Exception) { - null - } - } - - fun openUrl(url: String) { - context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url))) - } - - - fun getUpdate() { - Thread { - getHttp("https://api.github.com/repos/Block-Network/StatusBarLyric/releases/latest") { response -> - try { - val jsonObject = JSONObject(response) - if (jsonObject.getString("tag_name").split("v") - .toTypedArray()[1].toInt() > BuildConfig.VERSION_CODE - ) { - MIUIDialog(activity) { - setTitle( - String.format( - "%s [%s]", - activity.getString(R.string.have_new_version), - jsonObject.getString("name") - ) - ) - setMessage(jsonObject.getString("body").replace("#", "")) - setRButton(R.string.update) { - try { - openUrl( - jsonObject.getJSONArray("assets").getJSONObject(0) - .getString("browser_download_url") - ) - } catch (e: JSONException) { - showToastOnLooper(activity.getString(R.string.get_new_version_error) + e) - } - dismiss() - } - setLButton(R.string.cancel) { dismiss() } - }.show() - } else { - showToastOnLooper(activity.getString(R.string.no_new_version)) - } - } catch (_: JSONException) { - showToastOnLooper(activity.getString(R.string.check_update_error)) - } - }.isNot { - showToastOnLooper(activity.getString(R.string.check_update_error)) - } - }.start() - } - - fun getNotice() { - Thread { - getHttp("https://app.xiaowine.cc/app/notice.json") { response -> - goMainThread { - val jsonObject = JSONObject(response) - val minVersionCode = jsonObject.getInt("minVersionCode") - val maxVersionCode = jsonObject.getInt("maxVersionCode") - if (BuildConfig.VERSION_CODE in minVersionCode..maxVersionCode) { - if (jsonObject.getBoolean("forcibly")) { - MIUIDialog(activity) { - setTitle(activity.getString(R.string.announcement)) - setMessage(jsonObject.getString("data")) - setRButton(activity.getString(R.string.ok)) { dismiss() } - if (jsonObject.getBoolean("isLButton")) { - setLButton(jsonObject.getString("lButton")) { - openUrl(jsonObject.getString("url")) - dismiss() - } - } - }.show() - } - } - - } - }.isNot { - showToastOnLooper(activity.getString(R.string.get_announcement_error)) - } - - }.start() - } - - - private fun getHttp(url: String, callback: (String) -> Unit): Boolean { - return try { - val connection = URL(url).openConnection() as java.net.HttpURLConnection - connection.requestMethod = "GET" - connection.connectTimeout = 5000 - val reader = BufferedReader(InputStreamReader(connection.inputStream)) - callback(reader.readLine()) - true - } catch (e: Exception) { - e.printStackTrace() - false - } - } - - fun restartApp() { - val intent = context.packageManager.getLaunchIntentForPackage(context.packageName) - intent!!.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) - context.startActivity(intent) - exitProcess(0) - } -} \ No newline at end of file diff --git a/app/src/main/java/statusbar/lyric/view/EdgeTransparentView.kt b/app/src/main/java/statusbar/lyric/view/EdgeTransparentView.kt deleted file mode 100644 index f9ca4be8..00000000 --- a/app/src/main/java/statusbar/lyric/view/EdgeTransparentView.kt +++ /dev/null @@ -1,77 +0,0 @@ -package statusbar.lyric.view - -import android.annotation.SuppressLint -import android.content.Context -import android.graphics.Canvas -import android.graphics.Color -import android.graphics.LinearGradient -import android.graphics.Paint -import android.graphics.PorterDuff -import android.graphics.PorterDuffXfermode -import android.graphics.Shader -import android.view.View -import android.widget.FrameLayout -import statusbar.lyric.config.XposedOwnSP.config - -@SuppressLint("ViewConstructor") -open class EdgeTransparentView(context: Context, private val drawSize: Float = 50f) : FrameLayout(context) { - private var mPaint: Paint = Paint(Paint.ANTI_ALIAS_FLAG).apply { - style = Paint.Style.FILL - xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_OUT) - } - private var mWidth = 0 - private var mHeight = 0 - - - override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { - super.onSizeChanged(w, h, oldw, oldh) - initShader() - mWidth = width - mHeight = height - } - - private fun initShader() { - mPaint.setShader(LinearGradient(0f, 0f, 0f, drawSize, intArrayOf(Color.WHITE, Color.TRANSPARENT), floatArrayOf(0f, 1f), Shader.TileMode.CLAMP)) - } - - override fun drawChild(canvas: Canvas, child: View, drawingTime: Long): Boolean { - val drawChild = super.drawChild(canvas, child, drawingTime) - val offset = (mHeight - mWidth) / 2f - val saveCount = canvas.save() - var start = false - var end = false - when (config.lyricBlurredEdgesType) { - 0 -> { - start = true - end = true - } - - 1 -> { - start = true - } - - 2 -> { - end = true - } - } - if (start) { - canvas.apply { - rotate(270f, mWidth / 2f, mHeight / 2f) - translate(0f, offset) - drawRect(0 - offset, 0f, mWidth + offset, drawSize, mPaint) - restoreToCount(saveCount) - } - } - if (end) { - canvas.apply { - rotate(90f, mWidth / 2f, mHeight / 2f) - translate(0f, offset) - drawRect(0 - offset, 0f, mWidth + offset, drawSize, mPaint) - restoreToCount(saveCount) - } - } - val layerSave = canvas.saveLayer(0f, 0f, mWidth.toFloat(), mHeight.toFloat(), null, Canvas.ALL_SAVE_FLAG) - canvas.restoreToCount(layerSave) - return drawChild - } -} \ No newline at end of file diff --git a/app/src/main/java/statusbar/lyric/view/LyricSwitchView.kt b/app/src/main/java/statusbar/lyric/view/LyricSwitchView.kt deleted file mode 100644 index e05fe59d..00000000 --- a/app/src/main/java/statusbar/lyric/view/LyricSwitchView.kt +++ /dev/null @@ -1,111 +0,0 @@ -/* - * StatusBarLyric - * Copyright (C) 2021-2022 fkj@fkj233.cn - * https://github.com/577fkj/StatusBarLyric - * - * This software is free opensource software: you can redistribute it - * and/or modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either - * version 3 of the License, or any later version and our eula as published - * by 577fkj. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * and eula along with this software. If not, see - * - * . - */ - -package statusbar.lyric.view - -import android.animation.LayoutTransition -import android.content.Context -import android.graphics.Shader -import android.graphics.Typeface -import android.graphics.drawable.Drawable -import android.text.TextPaint -import android.widget.TextSwitcher - -open class LyricSwitchView(context: Context) : TextSwitcher(context) { - - init { - initialize() - } - - private fun initialize() { - setFactory { - LyricTextView(context).apply { - layoutParams = LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT) - } - } - } - - fun getPaint(): TextPaint { - return (getChildAt(0) as LyricTextView).paint - } - - fun applyToAllViews(action: (LyricTextView) -> Unit) { - for (i in 0 until childCount) { - action(getChildAt(i) as LyricTextView) - } - } - - fun maxLyricWidth(width: Float) { - applyToAllViews { it.maxViewWidth(width) } - } - - fun setWidth(width: Int) { - applyToAllViews { - layoutTransition = LayoutTransition() - it.layoutParams.width = width - } - } - - fun iconWidth(width: Float) { - applyToAllViews { it.iconWidth(width) } - } - - fun setTextColor(color: Int) { - applyToAllViews { it.setTextColor(color) } - } - - fun setLinearGradient(shader: Shader) { - applyToAllViews { it.setLinearGradient(shader) } - } - - override fun setBackground(background: Drawable?) { - applyToAllViews { it.background = background } - } - - fun setScrollSpeed(speed: Float) { - applyToAllViews { it.setScrollSpeed(speed) } - } - - fun setLetterSpacings(letterSpacing: Float) { - applyToAllViews { it.letterSpacing = letterSpacing } - } - - fun strokeWidth(width: Float) { - applyToAllViews { it.setStrokeWidth(width) } - } - - fun setTypeface(typeface: Typeface) { - applyToAllViews { it.typeface = typeface } - } - - fun setTextSize(unit: Int, size: Float) { - applyToAllViews { it.setTextSize(unit, size) } - } - - fun setSingleLine(singleLine: Boolean) { - applyToAllViews { it.isSingleLine = singleLine } - } - - fun setMaxLines(maxLines: Int) { - applyToAllViews { it.maxLines = maxLines } - } -} \ No newline at end of file diff --git a/app/src/main/java/statusbar/lyric/view/LyricTextView.kt b/app/src/main/java/statusbar/lyric/view/LyricTextView.kt deleted file mode 100644 index 77871722..00000000 --- a/app/src/main/java/statusbar/lyric/view/LyricTextView.kt +++ /dev/null @@ -1,132 +0,0 @@ -/* - * StatusBarLyric - * Copyright (C) 2021-2022 fkj@fkj233.cn - * https://github.com/577fkj/StatusBarLyric - * - * This software is free opensource software: you can redistribute it - * and/or modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either - * version 3 of the License, or any later version and our eula as published - * by 577fkj. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * and eula along with this software. If not, see - * - * . - */ - -package statusbar.lyric.view - -import android.content.Context -import android.graphics.Canvas -import android.graphics.Paint -import android.graphics.Shader -import android.view.Choreographer -import android.widget.TextView -import statusbar.lyric.config.XposedOwnSP.config - -class LyricTextView(context: Context) : TextView(context), Choreographer.FrameCallback { - private var isScrolling = false - private var textLength = 0f - private var viewWidth = 0f - private var iconWidth = 0f - private var scrollSpeed = 4f - private var currentX = 0f - private val iconSwitch = config.iconSwitch - private val lyricStartMargins = config.lyricStartMargins - private val lyricEndMargins = config.lyricEndMargins - private val iconStartMargins = config.iconStartMargins - private val startScrollRunnable = Runnable { Choreographer.getInstance().postFrameCallback(this) } - - init { - paint.style = Paint.Style.FILL_AND_STROKE - } - - override fun onDetachedFromWindow() { - stopScroll() - super.onDetachedFromWindow() - } - - override fun onTextChanged(text: CharSequence, start: Int, lengthBefore: Int, lengthAfter: Int) { - super.onTextChanged(text, start, lengthBefore, lengthAfter) - textLength = getTextLength() - currentX = 0f - startScroll() - } - - override fun setTextColor(color: Int) { - paint.color = color - postInvalidate() - } - - fun setLinearGradient(shader: Shader) { - paint.shader = shader - postInvalidate() - } - - fun setStrokeWidth(width: Float) { - paint.strokeWidth = width - postInvalidate() - } - - override fun onDraw(canvas: Canvas) { - val y = (height - (paint.descent() + paint.ascent())) / 2 - text?.let { canvas.drawText(it.toString(), currentX, y, paint) } - } - - private fun updateScrollPosition() { - val realTextLength = textLength + lyricEndMargins + lyricStartMargins - val realLyricWidth = viewWidth - if (iconSwitch) iconWidth + iconStartMargins else 0f - if (realTextLength <= realLyricWidth) { - currentX = 0f - stopScroll() - } else if (realLyricWidth - currentX >= realTextLength) { - currentX = realLyricWidth - realTextLength - stopScroll() - } else { - currentX -= scrollSpeed - } - } - - override fun doFrame(frameTimeNanos: Long) { - if (isScrolling) { - updateScrollPosition() - postInvalidate() - Choreographer.getInstance().postFrameCallback(this) - } - } - - private fun startScroll() { - isScrolling = true - postDelayed(startScrollRunnable, 1000) - } - - private fun stopScroll() { - isScrolling = false - removeCallbacks(startScrollRunnable) - Choreographer.getInstance().removeFrameCallback(this) - } - - private fun getTextLength(): Float { - return text?.let { paint.measureText(it.toString()) } ?: 0f - } - - fun setScrollSpeed(speed: Float) { - this.scrollSpeed = speed - } - - fun maxViewWidth(float: Float) { - viewWidth = float - } - - fun iconWidth(width: Float) { - if (config.iconSwitch) { - iconWidth = width - } - } -} \ No newline at end of file diff --git a/app/src/main/java/statusbar/lyric/view/TitleDialog.kt b/app/src/main/java/statusbar/lyric/view/TitleDialog.kt deleted file mode 100644 index 6e8b1fec..00000000 --- a/app/src/main/java/statusbar/lyric/view/TitleDialog.kt +++ /dev/null @@ -1,219 +0,0 @@ -package statusbar.lyric.view - -import android.annotation.SuppressLint -import android.app.Dialog -import android.content.Context -import android.graphics.Color -import android.graphics.PixelFormat -import android.graphics.drawable.GradientDrawable -import android.os.Handler -import android.os.Looper -import android.text.TextUtils -import android.util.TypedValue -import android.view.Gravity -import android.view.View -import android.view.Window -import android.view.WindowManager -import android.view.animation.AccelerateInterpolator -import android.view.animation.Animation -import android.view.animation.AnimationSet -import android.view.animation.BounceInterpolator -import android.view.animation.TranslateAnimation -import android.widget.ImageView -import android.widget.LinearLayout -import android.widget.TextView -import cn.fkj233.ui.activity.dp2px -import com.github.kyuubiran.ezxhelper.EzXHelper -import statusbar.lyric.R -import statusbar.lyric.config.XposedOwnSP.config -import statusbar.lyric.tools.LyricViewTools - -@SuppressLint("InternalInsetResource", "DiscouragedApi") -class TitleDialog(context: Context) : Dialog(context) { - - private val resourceId = context.resources.getIdentifier("status_bar_height", "dimen", "android") - private val statusBarHeight = if (resourceId > 0) context.resources.getDimensionPixelSize(resourceId) else 0 - private val h2 = statusBarHeight / 2 - private val maxWidth = context.resources.displayMetrics.widthPixels / 2 - 80 - statusBarHeight / 2 - var showIng: Boolean = false - var hiding: Boolean = false - private var isStop: Boolean = false - private val baseGravity = when (config.titleGravity) { - 0 -> Gravity.START - 1 -> Gravity.CENTER - 2 -> Gravity.END - else -> Gravity.START - } - - private val handler = Handler(Looper.getMainLooper()) - private val runnable = Runnable { - viewYAnimate(false) - } - - private var textView: TextView = object : TextView(context) { - init { - ellipsize = TextUtils.TruncateAt.MARQUEE - setSingleLine(true) - marqueeRepeatLimit = -1 - } - - override fun isFocused(): Boolean { - return true - } - - }.apply { - setTextSize(TypedValue.COMPLEX_UNIT_SP, 20f) - setTextColor(Color.WHITE) - gravity = Gravity.CENTER - if (baseGravity != Gravity.CENTER) { - maxWidth = this@TitleDialog.maxWidth - } - } - private val iconView: ImageView by lazy { - ImageView(context).apply { - layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT).apply { - width = dp2px(context, 15f) - height = dp2px(context, 15f) - setMargins(0, 0, 15, 0) - } - setImageDrawable(EzXHelper.moduleRes.getDrawable(R.drawable.ic_song, null)) - } - } - private var content: LinearLayout = LinearLayout(context).apply { - addView(iconView) - addView(textView) - orientation = LinearLayout.HORIZONTAL - gravity = Gravity.CENTER - background = GradientDrawable().apply { - cornerRadius = config.titleBackgroundRadius.toFloat() - setColor(Color.parseColor(config.titleColorAndTransparency)) - setStroke(config.titleBackgroundStrokeWidth, Color.parseColor(config.titleBackgroundStrokeColorAndTransparency)) - } - setPadding(40, 5, 40, 5) - } - - private var root: LinearLayout = LinearLayout(context).apply { - addView(content) - elevation = 10f - gravity = Gravity.CENTER - visibility = View.GONE - setPadding(h2, 0, h2, statusBarHeight + 20) - setOnClickListener { - if (!hiding) { - handler.removeCallbacks(runnable) - viewYAnimate(false) - } - } - } - - init { - requestWindowFeature(Window.FEATURE_NO_TITLE) - setContentView(root) - window?.apply { - setBackgroundDrawable(null) - val params = attributes - params.apply { - gravity = baseGravity or Gravity.TOP - flags = WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM or - WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or - WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN or - WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS - type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY - format = PixelFormat.TRANSLUCENT - width = WindowManager.LayoutParams.WRAP_CONTENT - height = WindowManager.LayoutParams.WRAP_CONTENT - } - attributes = params - } - show() - } - - fun delayedHide() { - if (DELAY_DURATION == 0L) return - handler.removeCallbacks(runnable) - handler.postDelayed(runnable, DELAY_DURATION) - } - - fun showTitle(title: String) { - setTitle(title) - if (root.visibility == View.VISIBLE) { - delayedHide() - return - } - if (showIng) { - handler.removeCallbacks(runnable) - return - } - viewYAnimate(true) - } - - fun hideTitle() { - if (isStop) return - isStop = true - if (hiding) return - viewYAnimate(false) - } - - fun setTitle(title: String) { - textView.apply { - text = title -// val w = textView.paint.measureText(title).toInt() -// layoutParams.width = if (w > this@TitleDialog.maxWidth) this@TitleDialog.maxWidth else w - } - } - - private fun viewYAnimate(into: Boolean) { - if (into) { - root.visibility = View.VISIBLE - } - val alphaAnimation = createAllAnimation(into) - root.startAnimation(alphaAnimation) - } - - - private fun createAllAnimation(into: Boolean): AnimationSet { - return LyricViewTools.getAlphaAnimation(into, ALPHA_ANIMATION_DURATION).apply { - fillAfter = true - val fromY = if (into) h2.toFloat() else statusBarHeight.toFloat() - val toY = if (into) statusBarHeight.toFloat() else h2.toFloat() - val translateAnimation = TranslateAnimation(0f, 0f, fromY, toY).apply { - duration = ANIMATION_DURATION - } - addAnimation(translateAnimation) - interpolator = if (into) { - BounceInterpolator() - } else { - AccelerateInterpolator(1.5f) - } - setAnimationListener(object : Animation.AnimationListener { - override fun onAnimationStart(animation: Animation?) { - if (into) { - showIng = true - delayedHide() - } else { - hiding = true - } - } - - override fun onAnimationEnd(animation: Animation?) { - if (into) { - showIng = false - root.visibility = View.VISIBLE - } else { - hiding = false - root.visibility = View.GONE - } - } - - override fun onAnimationRepeat(animation: Animation?) { - } - }) - } - } - - companion object { - private const val ANIMATION_DURATION: Long = 600L - private const val ALPHA_ANIMATION_DURATION: Long = 500L - private val DELAY_DURATION: Long = config.titleDelayDuration.toLong() - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/statusbar/lyric/config/Config.kt b/app/src/main/kotlin/statusbar/lyric/config/Config.kt index 07c31a1e..26dbf8fe 100644 --- a/app/src/main/kotlin/statusbar/lyric/config/Config.kt +++ b/app/src/main/kotlin/statusbar/lyric/config/Config.kt @@ -346,14 +346,6 @@ class Config { set(value) { config.put("hideCarrier", value) } - var checkUpdate: Boolean - get() { -// return config.opt("checkUpdate", true) - return false - } - set(value) { - config.put("checkUpdate", value) - } var lyricColorScheme: Int get() { return config.opt("lyricColorScheme", 0) @@ -550,9 +542,6 @@ class Config { private val myPlayerIcon by lazy { @Suppress("SpellCheckingInspection") "UklGRqwBAABXRUJQVlA4TJ8BAAAvH8AHEP+ioG0bxuUPehfE/M+/47aRHGkj3fzf5mx3FYUESaTpDRw1QAB/ADwIgsUAAih8obgAC1gAwB8FAAQAMIAfgj8KCHoRgGIAQTGAooABDACCogigKIpi4S4QfLEIiuKC8h1OQIxk27S15tm28f3e+7Zt2z//PK7OjyCi/wzcNlKULB7DzD5Cjr6dbi4sbJ6+yZsfSyVslpY+3PkZhXA0NPpx4SoOkOgv7x+sjiUB4leO7AB072XzoQew41IzD9LDfKNSqc/dS49ZYNfGHdCWTorYLBxLHeDOwncEmtI0jk5JLYh8S9IQElINF6tSEoaSvgLwpElcndAzBL6kRWjpGgvF9Zub9SIWLzWARSkLL0pZWJXFVQs5HUJW7xDXCwBrsrkG4EsDvJ/AuGYB8nIwDxDrACcbsKI6wJYk/f1J0hbAmXywsQD7KgPcSNr//d2XdANEl7b7sGBA//X8Aha8T/y3e4PPAhveDwnOQL/CicGFKIWBd4P/ktERZM3/q3lcGMeVeVz+T1xLu57zwjivjPPSOK//bV0wXlcEAA==" } - private val miPlayerIcon by lazy { - @Suppress("SpellCheckingInspection") "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAACYdJREFUeF7tnWGe3TQMxF9PBpwMOBn0ZFAtz8XNJtFoNLKdJu9T+a1jy6O/xnK2fXx5PR+1Ar++Xq+/1ZNWzfelauKbzvvH6/X65fV6/XaV/T8A6DL117fKb9X/AKDTdfmZLOm/v5Pfgr1MYV0m0EUxMMu35G8/5gCX6AMeAOJkWcW3qj96+gEgruvyT+xZ/VHQf377gbnD8p/HAY5TZAm3z/Z8R5L6AICotNCYPtkWVvtvNsQHAFa5gc9FLD0a1gNAVDFnfKvIbGeNNHCK0B8AFCp23bYlLtOvVFb73lafW0ASgG3CMhV1dFdPhnj6eAbWyrg+zb1aoEeVygBgc9nr2Rmf1XQ91GClQNu7dIWlzqj6FjcD6wxIP9ZcAQDkfI7EOTP5pukDQABnJFkRQZH5AuFRQyOwUgsoH5oVLFL1UUtdIfkRWNv+WtxTbg4zAIgmChXmH2VlkHNF9dxqwQBEhvrfY9GAU4t9eziafDRGZt7sXrbPM8nbg5aZh97LSADOuvyjDaBizAYAjbPf51nM9sZzyN8qGgUAk/xIRz3T/tXJb5AMgWAEAGzyTQjk/J/5wodJvu0LBbYcgmoAMslHz/+IoPRZufMgm/zocVUKQRUAiqqMCBwVNQOCJcRiY38ziVZ/H2MZBFUAZCs/cv43oRRrnoGRTbzNnQG1BIIKADKb7BOAnP/9eIXrbAEw0b++q52t+DanQhc5BGoAFJtsgjGxRSEwK7d/yWNJ7rtv+3M24VuYGOvfc6TI0egedYzIR5Oqkp+lPHIURF3GFdQZEIntbCoZBCoAopV3tDnVxtBqy8LGAKEqFAm8KgAUZKuSb0mJACkRMkiCAgIJvAoAFJtRJj96K5AIGQQgeyPo+5XUK+MsAKsmPwpBBYAIEwr9Ug6WBSBr/dXCR46CrBZIwvfGZCFIOVhm09nAq5MfvX+PiqcCAjr2DABop11+lwVKD3WqlJ0CcZwNyRYUFTsLQCbYlGWRIqNHwYzY+i2hoO7JQMXOApCpfnZNMvffH0OhpSopG1z3fEbbcOxMMlAhV7D+bQxIhVGVJAQAdSuJCzAAsITSjcoEccOVJIwx+44gFHsUgEz1R9cSaxo+CmbHyxZayMGim2SDWqH6o83W7JgzRwGcV3jgN/XY6p8t5J6ToOKG7LTAspCeJdVr3RUA9JwN2WkBACio26XhuCMAMPa/YvVHj4KrugAUNwrAz2T/PQBIhcHVVOAANiUSI30MoAAw1W9BofMXaQdNi8ANVRO0GjeI6QUgcJEElRLI6SF/yhMYElMe1f8TsjlwwUUAQCpkb+/I3IWahaZGBJ7dzzAuPA2A2WKFsv8ejIA+E2rPpfb27DoXsiGGvCsCYAJ6IruCMuSBzyAuFXbiKgCQecF9Dx/mAe/aamHEXmx7S5/G6yUKscXtolet/rYPr9JmuoDnUA8AourzhJ7lAh6c4T7AcwBPiDBxogSNmObMbme5wHAAmDPHg2pE8hRreGLPOuqkOfGSJV1MkZXBc3g9kKdfRbhSV/Y2EAVgljVWCN3mPBN8hgsMA8CzwD3RZwhSmXyb29NhdEPouVKoLztzAG/jdwHA9rnEV7oF3lhuc3MI6QMA7h/KbzPHV/08kilMCgCp1WR2PPBZE7d9tt8Qcib8yN6HAeDwaD5zgJ8dgPaF1e2cP+OsfVeQfZ1MD0n/zKhe4AEg4Qgt6UdJTEz98ah3q8rOjzSlod7sLg5Qnfgm+ohb0OMAgTIalfiRR8HSAIyoADT/TA+Dzu31C6mvbXGCYPY1rAlcAYAZVQ/fuwWEDQOAsZqR16E9LZmYBTn5NEWlDg8ABxlbJfktvKpr4dK/C6gk36vU6C+uvPmyP6/SYhgAJgAj6oi78DY5jCjZBCPPV7iANCdeshhhvTkR4SJjmDMxMn9mbIULLA9ABfVHSVg5+RW9ANPnnELoVSvjABXUXxkApR4M8KdXcw8AOXEZP908y4ghXB6eSgkAY//DATBlRhwDVwHA9PAKDaWJASD1D0PYm0A1AIwzoSJXjFPowQJ/Ch9C5op9ACtGRXKRORWvyJk8uOsiALDVpqD+ys1fH7ubCIAixv7dda8KACMGoHHZEDcRzsqs47lFiABgsTH2o+x+t/o8AGCsuvl1B7zXKSMQ28enUXcCgNUech0UALYPqHABNhaSNcljUDIOVmLcF756ogCwx0DFO4ErAhDRueeArX648CKBscLDwYC1xsYBTi8fltk/e9TBjhMBgH0pZM/BAYHys8KA00uHsXtnqx+2/9DAZDPIrHWWBfZclGYWnMy9ih3Mw0IeAi7qAKu4QKY6wLxJhoWS0a2Y2V8op6HB7wAz1cdWwzYbV+kDGAAyewuvxwCQCVB5FGRAlJS3M0k4Ge/5WOuntGUAsIUyFpXpinvNsyBWQ8Bom4GaAo4JsgmXIZUKdidjGcEqAWD2lykqqvrph97KZSuQEekKvQCzr2zymTU/tMw4gD2frUBFU5gVT+kETCKy8TNrft9zFoCsC1ggCgiyICogYBIxXb8sANmGsAnPiLdN2kwImPizlW/7Z9b9QTcFAIqjQLKZ5O2EdQHGwRTJl9ymVACYeJlbgdIJFOIiMLAJUMUnyZ1kEtGtoInOCrtNmkro7bwWn1nv9lvEEGhUx1Ta+luwSgBU/UCLjbHWvWti/21gSJKOxmQSr2j2lC4puwXsiaWsPBnp7/7A4v0dpKBVOFvtbZlV9fiIT+0AbdMqqyuhvjuy7I9WnVs7Z+y9+ghSFkOpA1RBYPOWiAA6Ajqs4juKVH3Rpz1UOUAlBO1bO81aV/pUJN72V5b8yiOgT4z6OOiPBfvzTBDaN45aX1Hx7aOlyR8FQEsS2nwxVT3SFaqT3vZfnvyRAIyAoAende6KZq41ig3gikrfQj+s16nuAao7Y9QtGghfuwe2cLTE2jeCt8+IZE9L/mgHaBtV3otRAK4yTvHyK7TX0Q4wojkMCbDI4MxbxtQWZgIwui9ICVX48LDzfm8PswFoDZbqfX1hnuRTT6v6ficrAHDH3mBq1a8KwB1AGHK3j3jVSg6wypUxoh86dgm7X7UH8ES88rVR/ULK0yr885UdYM8Rzv63beHNFz2wbLVf1QH24l7NFVR/eaSIyeNpr+QAe7uw62P/y5mRArZKtzVVv3MYGf/HWlcHYCtYD4TyuOgr/NIJ3wr2swFwVEHNJZBf7vTVfNnKRq3kLgCgetxu3APA7VL+44YfAB4Abq7Azbf/OMADwM0VuPn2/wXTiFGfMXUuLAAAAABJRU5ErkJggg==" - } private val lunaIcon by lazy { @Suppress("SpellCheckingInspection") "iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAC4jAAAuIwF4pT92AAADMElEQVRoge3aSYhdRRQG4K+ngEZbVBRxAEGNilObxgGjdmzNJguHjW6zcSVu3ItuRd0HshVxY1aCIA6tdhxwFsVgdONABE2cSIS0Sbk4aRuk33333HvLiOSHy+NRZ6j/1a0zVL2JUor/AyZP9ASGwkkiDdiJPwd+nh3ntAaRZUwN/NyKU5qc1iDyJv4Y2OaFuKpJoAaRb/HFwDYncHuTQA0ix/BGBbuLTYO1otZSBZvzmB01WIvIu/h9YJvnYW7UYC0iP+DTCnYXRg3UTIivV7B5Qoi8VsHmIs5fb2C6grNVfIADOLul/E78OEZmAjPrDlSufl/CtpayN+K9ro5qF42vJGS393FUm8hyQvaOPo5qE/kI37eUncM5XR3VJnJYbPo2OAM3dXU0dNSaxmbchctxKTYl9G/DC10dD4FTsQMPaigjWmBBhNh0KB0i/G7DU7i2ryEcwhX4LqvYd488ghcNQwI24uYuin2IPIanRSs6JBobqFHoSmQHHu+oOw4LOvw4XfbIZXhfQ5PTE0dwNfZllLqsyBPqkYAN2JJVyhKZx71ZJx0wsu8YhSyRh0Wcr40tYmVaI7tHbhEhckW8y8eOf39Uh1+xAUdxHT5vq5DN7G8d/zxTlCKLIu7PJ+2Mw5QkkbYrci6ux1ax7HM4PT29HJZFsp0Rr9kG8Qbsx4cich5eFV6PyAwuECFwqyjkNqvbFo/DN9gjzsvewdeinPkb/yQyixtEt3aReP+P4BdcqUeZnUAROeRtaxP/UqzGSGQ2+33Y3X1+jdgnJrwk9uHerIHM6/JT1ngCT+JVEa1mcI3oLA+2NZBZkbPEErc93sniqLUcNYk7BblWyCTEg3oc17TAlJjPpDjfatsiI5/Zn0nKd8Vu/JpRyGb2jfgEl2SUklgR4f6zjFJ2RQ6JcqQmdkmSoHvP/hwe6KI4BntFPfdzVrErkVm8LJLnUDggardO9ypdW93fcI+1IrIv9uNufS6HSil9ntNKKbtKPyyVUjb1nEdvIqvP9lLKniSBr0opD5VSpoeYw5D3IxMiG98vNuzFIlyvYkVUsR/jeXE0OtiFae2Lnn8NJ/8d9F/DXxXl/JXTBJUJAAAAAElFTkSuQmCC" } diff --git a/app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt b/app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt index ad37a46e..addcbffd 100644 --- a/app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt +++ b/app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt @@ -33,14 +33,10 @@ import android.graphics.Color import android.graphics.LinearGradient import android.graphics.Paint import android.graphics.Point -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt import android.graphics.PorterDuff -======== ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt import android.graphics.Shader import android.graphics.Typeface import android.graphics.drawable.GradientDrawable -import android.media.MediaMetadata import android.os.Build import android.util.DisplayMetrics import android.util.TypedValue @@ -74,15 +70,10 @@ import statusbar.lyric.tools.LogTools.log import statusbar.lyric.tools.LyricViewTools import statusbar.lyric.tools.LyricViewTools.hideView import statusbar.lyric.tools.LyricViewTools.iconColorAnima -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt import statusbar.lyric.tools.LyricViewTools.randomAnima import statusbar.lyric.tools.LyricViewTools.showView import statusbar.lyric.tools.LyricViewTools.textColorAnima import statusbar.lyric.tools.SystemMediaSessionListener -======== -import statusbar.lyric.tools.LyricViewTools.showView -import statusbar.lyric.tools.LyricViewTools.textColorAnima ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt import statusbar.lyric.tools.Tools.goMainThread import statusbar.lyric.tools.Tools.isHyperOS import statusbar.lyric.tools.Tools.isLandscape @@ -95,10 +86,6 @@ import statusbar.lyric.tools.Tools.isTargetView import statusbar.lyric.tools.Tools.observableChange import statusbar.lyric.tools.Tools.shell import statusbar.lyric.tools.Tools.togglePrompts -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt -======== -import statusbar.lyric.view.EdgeTransparentView ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt import statusbar.lyric.view.LyricSwitchView import statusbar.lyric.view.TitleDialog import java.io.File @@ -109,12 +96,8 @@ class SystemUILyric : BaseHook() { private lateinit var hook: XC_MethodHook.Unhook val context: Context by lazy { AndroidAppHelper.currentApplication() } -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt private var lastColor: Int by observableChange(Color.WHITE) { oldValue, newValue -> -======== - private var lastColor: Int by observableChange(Color.WHITE) { _, newValue -> ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt goMainThread { if (config.lyricColor.isEmpty() && config.lyricGradientColor.isEmpty()) { when (config.lyricColorScheme) { @@ -124,13 +107,8 @@ class SystemUILyric : BaseHook() { } if (config.iconColor.isEmpty()) { when (config.lyricColorScheme) { -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt 0 -> iconView.setColorFilter(newValue, PorterDuff.Mode.SRC_IN) 1 -> iconView.iconColorAnima(oldValue, newValue) -======== - 0 -> iconView.setColorFilter(newValue) - 1 -> iconView.iconColorAnima(lastColor, newValue) ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt } } } @@ -224,7 +202,6 @@ class SystemUILyric : BaseHook() { gravity = Gravity.CENTER layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT) addView(iconView) -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt addView(lyricView) visibility = View.GONE } @@ -233,27 +210,6 @@ class SystemUILyric : BaseHook() { private val titleDialog by lazy { TitleDialog(context) } -======== - addView(if (config.lyricBlurredEdges) { - EdgeTransparentView(context, config.lyricBlurredEdgesRadius.toFloat()).apply { - addView(lyricView) - } - } else { - lyricView - }) - visibility = View.GONE - } - } - private lateinit var mMIUINetworkSpeedView: TextView - private val titleDialog by lazy { - TitleDialog(context).apply { -// val location = IntArray(2) -// clockView.getLocationOnScreen(location) -// setX(location[0]) - } - } - ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt //////////////////////////////Hook////////////////////////////////////// @SuppressLint("DiscouragedApi") @@ -295,27 +251,6 @@ class SystemUILyric : BaseHook() { } } } -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt -======== - if (config.titleSwitch) { - for (i in 0..10) { - val clazz = loadClassOrNull("com.android.systemui.statusbar.NotificationMediaManager$$i") - clazz.log() - if (clazz.isNotNull()) { - if (clazz!!.hasMethod("onMetadataChanged")) { - clazz.methodFinder().filterByName("onMetadataChanged").first().createHook { - after { hookParam -> - if (isStop || !isPlaying) return@after - val metadata = hookParam.args[0] as? MediaMetadata ?: return@after - title = metadata.getString(if (config.useBlueGetTitle) MediaMetadata.METADATA_KEY_ARTIST else MediaMetadata.METADATA_KEY_TITLE) - } - } - break - } - } - } - } ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt "${moduleRes.getString(R.string.lyric_color_scheme)}:${config.lyricColorScheme}".log() when (config.lyricColorScheme) { 0 -> { @@ -479,16 +414,7 @@ class SystemUILyric : BaseHook() { } else { lyricView.setMaxLyricViewWidth(scaleWidth().toFloat() + config.lyricEndMargins + config.lyricStartMargins) } -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt if (isHyperOS && config.mHyperOSTexture) { -======== - if (config.lyricWidth == 0) { - lyricView.maxLyricWidth(targetView.width.toFloat()) - } else { - lyricView.maxLyricWidth(scaleWidth().toFloat() + config.lyricEndMargins + config.lyricStartMargins) - } - if (isHyperOS() && config.mHyperOSTexture) { ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt val blurRadio = config.mHyperOSTextureRadio val cornerRadius = cornerRadius(config.mHyperOSTextureCorner.toFloat()) val blendModes = arrayOf( @@ -553,13 +479,7 @@ class SystemUILyric : BaseHook() { isStop = false isPlaying = true goMainThread { -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt if (config.lyricColor.isEmpty()) lastColor = clockView.currentTextColor -======== - if (!isPlaying && config.lyricColor.isEmpty()) { - lastColor = clockView.currentTextColor - } ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt lyricLayout.showView() if (config.hideTime) clockView.hideView() if (this::mNotificationIconArea.isInitialized) mNotificationIconArea.hideView() @@ -597,7 +517,6 @@ class SystemUILyric : BaseHook() { } private fun changeIcon(it: ExtraData) { - lyricView.iconWidth(iconView.width.toFloat()) if (!iconSwitch) return if (config.changeAllIcons.isNotEmpty()) { lastBase64Icon = config.changeAllIcons @@ -608,24 +527,17 @@ class SystemUILyric : BaseHook() { } else { config.getDefaultIcon(it.packageName) } -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt } if (config.lyricWidth == 0) { lyricView.setMaxLyricViewWidth(targetView.width.toFloat() - if (config.iconSwitch) config.iconStartMargins.toFloat() + iconView.width else 0f) } else { lyricView.setMaxLyricViewWidth(scaleWidth().toFloat() + config.lyricEndMargins + config.lyricStartMargins) -======== ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt } } private fun hideLyric(anim: Boolean = true) { if (isStop) return -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt if (!isHiding && isPlaying && anim) { -======== - if (!isHiding && isPlaying) { ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt isPlaying = false isStop = true } @@ -660,15 +572,9 @@ class SystemUILyric : BaseHook() { } } if (config.lyricWidth == 0) { -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt setMaxLyricViewWidth(targetView.width.toFloat() - if (config.iconSwitch) config.iconStartMargins.toFloat() + iconView.width else 0f) } else { setMaxLyricViewWidth(scaleWidth().toFloat() + config.lyricEndMargins + config.lyricStartMargins) -======== - maxLyricWidth(targetView.width.toFloat()) - } else { - maxLyricWidth(scaleWidth().toFloat() + config.lyricEndMargins + config.lyricStartMargins) ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt } setLetterSpacings(config.lyricLetterSpacing / 100f) strokeWidth(config.lyricStrokeWidth / 100f) @@ -696,19 +602,11 @@ class SystemUILyric : BaseHook() { } } -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt val animation = config.lyricAnimation isRandomAnima = animation == 9 if (!isRandomAnima) { val interpolator = config.lyricInterpolator val duration = config.animationDuration -======== - val animation = config.animation - val interpolator = config.interpolator - val duration = config.animationDuration - isRandomAnima = config.animation == "Random" - if (!isRandomAnima) { ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt inAnimation = LyricViewTools.switchViewInAnima(animation, interpolator, duration) outAnimation = LyricViewTools.switchViewOutAnima(animation, duration) } @@ -738,20 +636,12 @@ class SystemUILyric : BaseHook() { } if (config.iconColor.isEmpty()) { when (config.lyricColorScheme) { -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt 0 -> setColorFilter(clockView.currentTextColor, PorterDuff.Mode.SRC_IN) -======== - 0 -> setColorFilter(clockView.currentTextColor) ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt 1 -> iconColorAnima(lastColor, clockView.currentTextColor) } } else { when (config.lyricColorScheme) { -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt 0 -> setColorFilter(Color.parseColor(config.iconColor), PorterDuff.Mode.SRC_IN) -======== - 0 -> setColorFilter(Color.parseColor(config.iconColor)) ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt 1 -> iconColorAnima(lastColor, Color.parseColor(config.iconColor)) } } @@ -795,11 +685,7 @@ class SystemUILyric : BaseHook() { inner class SystemUISpecial { init { -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt if (isMiui) { -======== - if (isMIUI) { ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt for (i in 0..10) { val clazz = loadClassOrNull("com.android.keyguard.wallpaper.MiuiKeyguardWallPaperManager\$$i") if (clazz.isNotNull()) { @@ -889,7 +775,6 @@ class SystemUILyric : BaseHook() { inner class ScreenLockReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { isScreenLock = intent.action == Intent.ACTION_SCREEN_OFF -<<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt if (isScreenLock) { hideLyric(false) } else { @@ -898,9 +783,6 @@ class SystemUILyric : BaseHook() { lastColor = clockView.currentTextColor } } -======== - if (isScreenLock) hideLyric(false) ->>>>>>>> main:app/src/main/java/statusbar/lyric/hook/module/SystemUILyric.kt } } } diff --git a/app/src/main/kotlin/statusbar/lyric/tools/BlurTools.kt b/app/src/main/kotlin/statusbar/lyric/tools/BlurTools.kt index 14c4e4b1..91ee4423 100644 --- a/app/src/main/kotlin/statusbar/lyric/tools/BlurTools.kt +++ b/app/src/main/kotlin/statusbar/lyric/tools/BlurTools.kt @@ -3,10 +3,6 @@ package statusbar.lyric.tools import android.view.View object BlurTools { -<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/tools/BlurTools.kt -======= - ->>>>>>> main:app/src/main/java/statusbar/lyric/tools/BlurTools.kt private val setBackgroundBlur by lazy { View::class.java.getDeclaredMethod("setBackgroundBlur", Integer.TYPE, FloatArray::class.java, Array::class.java) } diff --git a/app/src/main/kotlin/statusbar/lyric/tools/LyricViewTools.kt b/app/src/main/kotlin/statusbar/lyric/tools/LyricViewTools.kt index fbf40a32..639e26a9 100644 --- a/app/src/main/kotlin/statusbar/lyric/tools/LyricViewTools.kt +++ b/app/src/main/kotlin/statusbar/lyric/tools/LyricViewTools.kt @@ -19,12 +19,9 @@ import android.widget.ImageView import statusbar.lyric.view.LyricSwitchView object LyricViewTools { -<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/tools/LyricViewTools.kt private var animaList: ArrayList = arrayListOf(1, 2, 3, 4, 5, 6, 7, 8) val randomAnima: Int get() = animaList.random() -======= ->>>>>>> main:app/src/main/java/statusbar/lyric/tools/LyricViewTools.kt fun getAlphaAnimation(into: Boolean, duration: Long = 250): AnimationSet { val alphaAnimation = (if (into) AlphaAnimation(0f, 1F) else AlphaAnimation(1F, 0f)).apply { this.duration = duration @@ -36,7 +33,6 @@ object LyricViewTools { fun switchViewInAnima(int: Int?, interpolator: Int?, time: Int?): Animation? { val t = time?.toLong() ?: 500L -<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/tools/LyricViewTools.kt val translateAnimation: Animation? = when (int) { 1 -> TranslateAnimation(0f, 0f, 100f, 0f) 2 -> TranslateAnimation(0f, 0f, -100f, 0f) @@ -46,17 +42,6 @@ object LyricViewTools { 6 -> ScaleAnimation(0f, 1f, 0f, 1f) 7 -> ScaleAnimation(0f, 1f, 1f, 1f) 8 -> ScaleAnimation(1f, 1f, 0f, 1f) -======= - val translateAnimation: Animation? = when (str) { - "Top" -> TranslateAnimation(0f, 0f, 100f, 0f) - "Bottom" -> TranslateAnimation(0f, 0f, -100f, 0f) - "Start" -> TranslateAnimation(100f, 0f, 0f, 0f) - "End" -> TranslateAnimation(-100f, 0f, 0f, 0f) - "Fade" -> null - "ScaleXY" -> ScaleAnimation(0f, 1f, 0f, 1f) - "ScaleX" -> ScaleAnimation(0f, 1f, 1f, 1f) - "ScaleY" -> ScaleAnimation(1f, 1f, 0f, 1f) ->>>>>>> main:app/src/main/java/statusbar/lyric/tools/LyricViewTools.kt else -> return null }?.apply { duration = t @@ -71,7 +56,6 @@ object LyricViewTools { fun switchViewOutAnima(str: Int?, time: Int?): Animation? { val t = time?.toLong() ?: 500L val translateAnimation: Animation? = when (str) { -<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/tools/LyricViewTools.kt 1 -> TranslateAnimation(0f, 0f, 0f, -100f) 2 -> TranslateAnimation(0f, 0f, 0f, +100f) 3 -> TranslateAnimation(0f, -100f, 0f, 0f) @@ -80,16 +64,6 @@ object LyricViewTools { 6 -> ScaleAnimation(1f, 0f, 1f, 0f) 7 -> ScaleAnimation(1f, 0f, 1f, 1f) 8 -> ScaleAnimation(1f, 1f, 1f, 0f) -======= - "Top" -> TranslateAnimation(0f, 0f, 0f, -100f) - "Bottom" -> TranslateAnimation(0f, 0f, 0f, +100f) - "Start" -> TranslateAnimation(0f, -100f, 0f, 0f) - "End" -> TranslateAnimation(0f, 0f + 100f, 0f, 0f) - "Fade" -> null - "ScaleXY" -> ScaleAnimation(1f, 0f, 1f, 0f) - "ScaleX" -> ScaleAnimation(1f, 0f, 1f, 1f) - "ScaleY" -> ScaleAnimation(1f, 1f, 1f, 0f) ->>>>>>> main:app/src/main/java/statusbar/lyric/tools/LyricViewTools.kt else -> return null }?.apply { duration = t diff --git a/app/src/main/kotlin/statusbar/lyric/tools/Tools.kt b/app/src/main/kotlin/statusbar/lyric/tools/Tools.kt index 6b80dae3..09b50067 100644 --- a/app/src/main/kotlin/statusbar/lyric/tools/Tools.kt +++ b/app/src/main/kotlin/statusbar/lyric/tools/Tools.kt @@ -53,7 +53,6 @@ object Tools { private var index: Int = 0 -<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/tools/Tools.kt val isMiui by lazy { isPresent("android.provider.MiuiSettings") } val isPad by lazy { getSystemProperties("ro.build.characteristics") == "tablet" } @@ -69,21 +68,6 @@ object Tools { fun dp2px(context: Context, dpValue: Float): Int = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.resources.displayMetrics).toInt() -======= - val isMIUI by lazy { isPresent("android.provider.MiuiSettings") } - - val isPad get() = getSystemProperties("ro.build.characteristics") == "tablet" - - fun isHyperOS(): Boolean { - try { - getSystemProperties("ro.mi.os.version.incremental") - return Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE - } catch (_: Exception) { - return false - } - } - ->>>>>>> main:app/src/main/java/statusbar/lyric/tools/Tools.kt val togglePrompts: Boolean get() { arrayOf("com.lge.adaptive.JavaImageUtil").forEach { @@ -105,13 +89,7 @@ object Tools { @SuppressLint("PrivateApi") fun getSystemProperties(key: String): String { val ret: String = try { -<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/tools/Tools.kt Class.forName("android.os.SystemProperties").getDeclaredMethod("get", String::class.java).invoke(null, key) as String -======= - Class.forName("android.os.SystemProperties") - .getDeclaredMethod("get", String::class.java) - .invoke(null, key) as String ->>>>>>> main:app/src/main/java/statusbar/lyric/tools/Tools.kt } catch (iAE: IllegalArgumentException) { throw iAE } catch (e: Exception) { @@ -121,23 +99,13 @@ object Tools { } fun copyToClipboard(context: Context, text: String) { -<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/tools/Tools.kt val clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager -======= - val clipboardManager = - context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager ->>>>>>> main:app/src/main/java/statusbar/lyric/tools/Tools.kt val clipData = ClipData.newPlainText("text", text) clipboardManager.setPrimaryClip(clipData) } fun observableChange( -<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/tools/Tools.kt initialValue: T, onChange: (oldValue: T, newValue: T) -> Unit -======= - initialValue: T, - onChange: (oldValue: T, newValue: T) -> Unit ->>>>>>> main:app/src/main/java/statusbar/lyric/tools/Tools.kt ): ReadWriteProperty { return Delegates.observable(initialValue) { _, oldVal, newVal -> if (oldVal != newVal) { @@ -206,13 +174,8 @@ object Tools { } fun getSP(context: Context, key: String): SharedPreferences? { -<<<<<<< HEAD:app/src/main/kotlin/statusbar/lyric/tools/Tools.kt @Suppress("DEPRECATION", "WorldReadableFiles") return context.createDeviceProtectedStorageContext() .getSharedPreferences(key, if (isHook()) Context.MODE_WORLD_READABLE else Context.MODE_PRIVATE) -======= - @Suppress("DEPRECATION") return context.createDeviceProtectedStorageContext() - .getSharedPreferences(key, Context.MODE_WORLD_READABLE) ->>>>>>> main:app/src/main/java/statusbar/lyric/tools/Tools.kt } fun shell(command: String, isSu: Boolean) { diff --git a/app/src/main/res/drawable/ic_song.xml b/app/src/main/res/drawable/ic_song.xml index 0035d803..dc53d6da 100644 --- a/app/src/main/res/drawable/ic_song.xml +++ b/app/src/main/res/drawable/ic_song.xml @@ -1,4 +1,3 @@ -<<<<<<< HEAD -======= - - ->>>>>>> main diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 2e609240..e1b54e0d 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -21,7 +21,6 @@ 重启系统界面 确定要重新启动系统界面吗? 主开关 -<<<<<<< HEAD 锚点选择 锚点选择模式 宽松过滤 @@ -29,31 +28,15 @@ 歌词样式 图标样式 扩展选项 -======= - 锚点页> - 锚点设置模式 - 宽松过滤 - 允许更多锚点出现 - 歌词页 - 图标页 - 自定义图标页 - 扩展页 ->>>>>>> main 锚点选择页 歌词宽度 范围: 0~100,0 代表自适应宽度 固定歌词宽度 打开后,显示宽度固定,不随歌词实际长度变化 歌词颜色和透明度 -<<<<<<< HEAD 请输入 16 进制颜色值 歌词背景渐变颜色和透明度 请输入 16 进制颜色,多个颜色为渐变色横向排布,使用英文逗号分隔 -======= - 请输入16进制颜色 - 歌词背景渐变颜色和透明度 - 请输入16进制颜色,多个颜色为渐变色横向排布,使用英文逗号分隔 ->>>>>>> main 歌词大小 范围: 0~100,0 代表自适应 歌词字间距 @@ -80,7 +63,6 @@ 图标左边距 范围: 0~500 图标颜色和透明度 -<<<<<<< HEAD 请输入 16 进制颜色值 图标背景颜色和透明度 请输入 16 进制颜色值 @@ -96,33 +78,6 @@ 请先打开锚点设置模式配置 未找到锚点 是否选择此锚点 -======= - 请输入十六进制颜色值 - 图标背景颜色和透明度 - 请输入十六进制颜色值 - 颜色错误 - 输入错误 - 时间格式 - 歌词模式 - 获取锚点 - 主开关关闭 - Hook成功 - Hook失败 - 开始Hook所有TextView - %s已满足初步要求,共有%s个符合要求 - 没有符合要求的TextView - 发送:%s - 清除TextView列表及其关联数据 - 我不理解时间格式 - 加载Class:%s - 请先打开锚点设置模式配置 - 加载失败,未找到该Class - 加载成功,Class:%s - 未找到锚点 - 请尝试重新启动系统界面,如果仍然无法找到,请联系开发人员 - 是否选择此锚点 - 重启应用程序生效 ->>>>>>> main 强制显示图标 广播接收超时 隐藏时间 @@ -149,22 +104,14 @@ 隐藏通知图标 限制可见性更改 可以防止部分系统的特性导致有时间会出现 -<<<<<<< HEAD 锁定屏幕时隐藏歌词 建议先关闭其他修改状态栏布局的模块后,再来此页面选择锚点\n\n有效的锚点选择: 状态栏显示模块名字,并有白色背景\n\n选择锚点后,返回关闭锚点模式,重启系统模式即锚点设置完成 隐藏运营商 第一次安装模块,请先设置锚点\n开启锚点设置模式,重启系统界面,获取锚定并选择后关闭锚点模式再次重启系统界面 -======= - * 锁定屏幕时隐藏歌词 - 建议先关闭其他修改状态栏布局的模块后,再来此页面选择锚点\n有效的锚点选择:状态栏显示模块名字,并有白色背景\n\n选择锚点后,返回关闭锚点模式,重启系统模式即锚点设置完成 - * 隐藏运营商 - 第一次安装模块,请先设置锚点,方可使用本模块\n\n开启锚点设置模式,重启系统界面,获取锚定并选择后关闭锚点模式再次重启系统界面 ->>>>>>> main 歌词背景半径 范围: 0~100 方案 1 方案 2 -<<<<<<< HEAD 歌词反色方案 需重启 动态歌词速度 (Beta) @@ -205,46 +152,4 @@ 恢复配置 重置配置 确定要重置配置吗? -======= - * 歌词反色方案 - * 的选项,重启系统界面生效 - 动态歌词速度(Beta) - * 点击状态栏隐藏歌词 - * 长按状态栏停止音乐 - 系统特供页 - * MIUI隐藏网速 - * MIUI平板优化 - * 添加高级材质背景 - * 高级材质模糊半径 - * 高级材质四边圆角 - * 高级材质背景颜色 - 仅右边 - 仅左边 - 两边 - * 歌词模糊边缘类型 - * 状态栏滑动切歌 - * 滑动切歌X半径 - 范围:50–2000 - * 滑动切歌Y半径 - 范围:10–100 - 标题提示隐藏延迟隐藏时间 - 范围:0–10000,单位:毫秒 - 标题提示开关 - 使用蓝牙获取标题方案 - 下列所有调节选项重启生效 - 标题提示背景颜色 - 标题提示背景圆角 - 标题提示背景描边宽度 - 范围 0–30 - 标题提示背景描边颜色 - 标题提示显示相同的歌词 - 开始 - 中心 - 结束 - 标题提示居中 - 更改所有图标 - 请输入Base64 - 请输入16进制颜色,多个颜色为渐变色横向排布,使用英文逗号分隔 - * 歌词渐变色和透明 ->>>>>>> main \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index c8e4789e..04bbf06f 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -21,7 +21,6 @@ 重啟系統界面 確定要重新啟動系統界面嗎? 主開關 -<<<<<<< HEAD 錨點選擇 錨點選擇模式 寬鬆過濾 @@ -29,31 +28,15 @@ 歌詞樣式 圖示樣式 擴展選項 -======= - 錨點頁 - 錨點設置模式 - 寬鬆過濾 - 允許更多錨點出現 - 歌詞頁 - 圖示頁 - 自訂圖示頁 - 擴展頁 ->>>>>>> main 錨點選擇頁 歌詞寬度 範圍: 0~100,0 代表自適應寬度 固定歌詞寬度 打開後,顯示寬度固定,不隨歌詞實際長度變化 歌詞顏色和透明度 -<<<<<<< HEAD 請輸入 16 進位制顏色值 歌詞背景漸變顏色和透明度 請輸入 16 進位制顏色,多個顏色為漸變色橫向排布,使用英文逗號分隔 -======= - 請輸入十進制顏色 - 歌詞背景漸變顏色和透明度 - 請輸入16進制顏色,多個顏色為漸變色橫向排布,使用英文逗號分隔 ->>>>>>> main 歌詞大小 範圍: 0~100,0 代表自適應 歌詞字間距 @@ -80,7 +63,6 @@ 圖示左邊距 範圍: 0~500 圖示顏色和透明度 -<<<<<<< HEAD 請輸入 16 進位制顏色值 圖示背景顏色和透明度 請輸入 16 進位制顏色值 @@ -96,34 +78,6 @@ 請先打開錨點設置模式配置 未找到錨點 是否選擇此錨點 -======= - 請輸入十六進制顏色值 - 圖示背景顏色和透明度 - 請輸入十六進制顏色值 - 顏色錯誤 - 輸入錯誤 - 時間格式 - 歌詞模式 - 獲取錨點 - 主開關關閉 - Hook成功 - Hook失敗 - 開始Hook所有TextView - %s已滿足初步要求,共有%s個符合要求 - 沒有符合要求的TextView - 發送:%s - 清除TextView列表及其關聯數據 - 我不理解時間格式 - 加載Class:%s - 請先打開錨點設置模式配置 - 加載失敗,未找到該Class - 加載成功,Class:%s - 未找到锚点 - 請嘗試重新啟動系統UI,如果仍然無法找到,請聯繫開發人員 - 是否選擇此锚点 - 第一次安裝模組,請先設置錨點,方可使用本模組\n\n開啟錨點設置模式,重啟系統介面,獲取錨定並選擇后關閉錨點模式再次重啟系統介面 - 重啟應用程式生效 ->>>>>>> main 強制顯示圖示 廣播接收超時 隱藏時間 @@ -150,21 +104,14 @@ 隱藏通知圖示 限制可見性更改 可以防止部分系統的特性導致有時間會出現 -<<<<<<< HEAD 鎖定螢幕時隱藏歌詞 建議先關閉其他修改狀態欄布局的模組後,再來此頁面選擇錨點\n\n有效的錨點選擇: 狀態欄顯示模組名字,並有白色背景\n\n選擇錨點後,返回關閉錨點模式,重啟系統模式即錨點設置完成 隱藏運營商 第一次安裝模組,請先設置錨點\n開啟錨點設置模式,重啟系統界面,獲取錨定並選擇後關閉錨點模式再次重啟系統界面 -======= - * 鎖定螢幕時隱藏歌詞 - 建議先關閉其他修改狀態列佈局的模組后,再來此頁面選擇錨點\n有效的錨點選擇:狀態列顯示模組名字,並有白色背景\n\n選擇錨點后,返回關閉錨點模式,重啟系統模式即錨點設置完成 - * 隱藏運營商 ->>>>>>> main 歌詞背景半徑 範圍: 0~100 方案 1 方案 2 -<<<<<<< HEAD 歌詞反色方案 需重啟 動態歌詞速度 (Beta) @@ -205,46 +152,4 @@ 恢復配置 重設配置 確定要重設配置嗎? -======= - * 歌詞反色方案 - * 的選項,重啟系統UI生效 - 動態歌詞速度(Beta) - * 點擊狀態列隱藏歌詞 - * 長按狀態列停止音樂 - 系統特供頁 - * MIUI隱藏網速 - * MIUI平板優化 - * 顯示高級材質背景 - * 高級材質模糊半徑 - * 高級材質四邊圓角 - * 高級材質背景顏色 - 僅右邊 - 僅左邊 - 兩邊 - * 歌詞模糊邊緣類型 - * 狀態列滑動切歌 - * 滑動切歌X半徑 - 範圍:50–2000 - * 滑動切歌Y半徑 - 範圍:10–100 - 標題提示隱藏延遲隱藏時間 - 範圍:0–10000,單位:毫秒 - 標題提示開關 - 使用藍牙獲取標題方案 - 以下所有調節選項重啟生效 - 標題提示背景顏色 - 標題提示背景圓角 - 標題提示背景描邊寬度 - 範圍 0–30 - 標題提示背景描邊顏色 - 標題提示顯示相同的歌詞 - 開始 - 中心 - 結束 - 標題提示重力 - 更改所有圖標 - 請輸入Base64 - 請輸入16進制顏色,多個顏色為漸變色橫向排布,使用英文逗號分隔 - * 歌詞漸變色和透明 ->>>>>>> main \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index edbcd611..694497f7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -65,12 +65,6 @@ Please enter a decimal Color Icon background Color And Transparency Please enter a decimal Color -<<<<<<< HEAD -======= - Color Error - Input Error - TimeFormat ->>>>>>> main Lyric Mode Get the Hook point Master switch is off @@ -111,11 +105,7 @@ It can prevent the characteristics of some systems from causing time to appear Hide Lyric When Lock Screen It is recommended to close other modules that modify the layout of the status bar first, and then come to this page to select Hook Points\nEffective Hook Point Selection: The status bar displays the module name, and the time is hidden -<<<<<<< HEAD Hide Carrier -======= - * Hide Carrier ->>>>>>> main Lyric background gradient color and transparency Please enter hexadecimal color, multiple colors are gradient colors arranged horizontally, separated by English commas Lyric Background Radius @@ -128,7 +118,6 @@ Click Status Bar To Hide Lyric Long Click Status Bar Stop Music System Special Page -<<<<<<< HEAD Hide Network Speed tablet optimization Add Advanced texture background @@ -165,40 +154,4 @@ Recovery Config Clear Config Are you sure you want to clear the configuration? -======= - * MIUI Hide Network Speed - * MIUI tablet optimization - * Add Advanced texture background - * Advanced texture blur radio - * Advanced texture rounded corners - * Advanced texture background corner - Lyric Blurred Edges Type End - Lyric Blurred Edges Type Start - Lyric Blurred Edges Type All - * Lyric Blurred Edges Type - * Slide Status Bar Cut Songs - * Slide Status Bar Cut Songs X Radius - Range 50–2000 - * Slide Status Bar Cut Songs Y Radius - Range 10–100 - Title hint hides the delay - Range: 0–10000,Unit: milliseconds - Title hint switch - Use Bluetooth to get the title scheme - All the following adjustment options take effect after restart - Title hint background color - Title hint background corner radius - Title hint background stroke width - Range 0–30 - Title hint background stroke color - Title hint show with same Lyric - Start - Center - End - Title hint gravity - Change all icons - Please enter Base64 - Please enter hexadecimal color, multiple colors are gradient colors arranged horizontally, separated by English commas - * Lyrics gradient and transparent ->>>>>>> main \ No newline at end of file diff --git a/blockmiui b/blockmiui deleted file mode 160000 index f1f32bcd..00000000 --- a/blockmiui +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f1f32bcd96557aa59be63efba597a3041500be26