[UI] Replace dropdown arrow drawable with Iconics.

This commit is contained in:
Kuba Szczodrzyński 2021-03-30 11:11:17 +02:00
parent ebbb9e4904
commit 6287f694f4

View File

@ -3,9 +3,11 @@ package pl.szczodrzynski.edziennik.utils
import android.content.Context import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
import androidx.appcompat.widget.PopupMenu import androidx.appcompat.widget.PopupMenu
import androidx.core.graphics.drawable.DrawableCompat
import com.google.android.material.textfield.TextInputEditText import com.google.android.material.textfield.TextInputEditText
import pl.szczodrzynski.edziennik.R import com.mikepenz.iconics.IconicsDrawable
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
import com.mikepenz.iconics.utils.colorInt
import com.mikepenz.iconics.utils.sizeDp
open class TextInputDropDown : TextInputEditText { open class TextInputDropDown : TextInputEditText {
constructor(context: Context) : super(context) { constructor(context: Context) : super(context) {
@ -32,11 +34,12 @@ open class TextInputDropDown : TextInputEditText {
} }
open fun create(context: Context) { open fun create(context: Context) {
val drawable = context.resources.getDrawable(R.drawable.dropdown_arrow) val drawable = IconicsDrawable(context, CommunityMaterial.Icon.cmd_chevron_down).apply {
val wrappedDrawable = DrawableCompat.wrap(drawable) colorInt = Themes.getPrimaryTextColor(context)
DrawableCompat.setTint(wrappedDrawable, Themes.getPrimaryTextColor(context)) sizeDp = 24
}
setCompoundDrawablesWithIntrinsicBounds(null, null, wrappedDrawable, null) setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null)
isFocusableInTouchMode = false isFocusableInTouchMode = false
isCursorVisible = false isCursorVisible = false
isLongClickable = false isLongClickable = false