清理代码
This commit is contained in:
3 files changed
-78
No files matched your search
@@ -1,66 +0,0 @@
|
|||||||
package io.legato.kazusa.ui.widget.button
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.util.AttributeSet
|
|
||||||
import com.google.android.material.button.MaterialButton
|
|
||||||
//import io.legado.app.lib.theme.bottomBackground
|
|
||||||
|
|
||||||
class AccentStrokeButton(context: Context, attrs: AttributeSet) :
|
|
||||||
MaterialButton(context, attrs) {
|
|
||||||
|
|
||||||
// private val isBottomBackground: Boolean
|
|
||||||
|
|
||||||
// init {
|
|
||||||
// val typedArray = context.obtainStyledAttributes(attrs, R.styleable.AccentStrokeTextView)
|
|
||||||
// isBottomBackground =
|
|
||||||
// typedArray.getBoolean(R.styleable.StrokeTextView_isBottomBackground, false)
|
|
||||||
// typedArray.recycle()
|
|
||||||
//
|
|
||||||
// // MaterialButton specific attributes
|
|
||||||
// insetTop = 0
|
|
||||||
// insetBottom = 0
|
|
||||||
// upStyle()
|
|
||||||
// }
|
|
||||||
|
|
||||||
// private fun upStyle() {
|
|
||||||
// val isLight = ColorUtils.isColorLight(context.bottomBackground)
|
|
||||||
// val disableColor = if (isBottomBackground) {
|
|
||||||
// if (isLight) {
|
|
||||||
// context.getCompatColor(R.color.md_light_disabled)
|
|
||||||
// } else {
|
|
||||||
// context.getCompatColor(R.color.md_dark_disabled)
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// context.getCompatColor(R.color.disabled)
|
|
||||||
// }
|
|
||||||
// val accentColor = if (isInEditMode) {
|
|
||||||
// context.getCompatColor(R.color.accent)
|
|
||||||
// } else {
|
|
||||||
// ThemeStore.accentColor(context)
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // Set MaterialButton properties
|
|
||||||
// strokeWidth = 1.dpToPx()
|
|
||||||
// strokeColor = ColorStateList.valueOf(accentColor)
|
|
||||||
//
|
|
||||||
// // For disabled state
|
|
||||||
// val states = arrayOf(
|
|
||||||
// intArrayOf(-android.R.attr.state_enabled), // disabled
|
|
||||||
// intArrayOf(android.R.attr.state_enabled) // enabled
|
|
||||||
// )
|
|
||||||
// val colors = intArrayOf(disableColor, accentColor)
|
|
||||||
//
|
|
||||||
// // Set stroke color state list
|
|
||||||
// strokeColor = ColorStateList(states, colors)
|
|
||||||
//
|
|
||||||
// // Set text color state list
|
|
||||||
// setTextColor(ColorStateList(states, colors))
|
|
||||||
//
|
|
||||||
// // Set ripple color
|
|
||||||
// rippleColor = ColorStateList.valueOf(context.getCompatColor(R.color.transparent30))
|
|
||||||
//
|
|
||||||
// // Remove default background and set transparent background
|
|
||||||
// setBackgroundColor(Color.TRANSPARENT)
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- res/drawable/bg_semi_transparent_overlay.xml -->
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:shape="rectangle">
|
|
||||||
<solid android:color="@color/transparent50" />
|
|
||||||
</shape>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- res/drawable/bg_semi_transparent_overlay.xml -->
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:shape="rectangle">
|
|
||||||
<solid android:color="@color/transparent70" />
|
|
||||||
</shape>
|
|
||||||
Reference in new issue
Block a user