mirror of
https://github.com/cmclark00/RetroMusicPlayer.git
synced 2025-05-17 15:45:21 +01:00
Prevent R8 from removing appthemehelper classes
This commit is contained in:
parent
2bcce6977d
commit
46544e000e
2 changed files with 2 additions and 33 deletions
2
appthemehelper/proguard-rules.pro
vendored
2
appthemehelper/proguard-rules.pro
vendored
|
@ -19,3 +19,5 @@
|
|||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-keep class code.name.monkey.appthemehelper.** { *; }
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
package code.name.monkey.appthemehelper.util
|
||||
|
||||
import android.content.res.ColorStateList
|
||||
import androidx.annotation.ColorInt
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
object TextInputLayoutUtil {
|
||||
|
||||
fun setHint(view: TextInputLayout, @ColorInt hintColor: Int) {
|
||||
try {
|
||||
val mDefaultTextColorField = TextInputLayout::class.java.getDeclaredField("mDefaultTextColor")
|
||||
mDefaultTextColorField.isAccessible = true
|
||||
mDefaultTextColorField.set(view, ColorStateList.valueOf(hintColor))
|
||||
} catch (t: Throwable) {
|
||||
throw RuntimeException("Failed to set TextInputLayout hint (collapsed) color: " + t.localizedMessage, t)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun setAccent(view: TextInputLayout, @ColorInt accentColor: Int) {
|
||||
try {
|
||||
val mFocusedTextColorField = TextInputLayout::class.java.getDeclaredField("mFocusedTextColor")
|
||||
mFocusedTextColorField.isAccessible = true
|
||||
mFocusedTextColorField.set(view, ColorStateList.valueOf(accentColor))
|
||||
} catch (t: Throwable) {
|
||||
throw RuntimeException("Failed to set TextInputLayout accent (expanded) color: " + t.localizedMessage, t)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue