mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2024-11-24 19:04:38 -06:00
[UI] Replace dropdown arrow drawable with Iconics.
This commit is contained in:
parent
ebbb9e4904
commit
6287f694f4
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user