Created
September 18, 2022 11:11
-
-
Save ercnksgl/86fd24f96dc3855f2bb67cc2a764f45a to your computer and use it in GitHub Desktop.
The enum to customize the view.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.annotation.ColorRes | |
import androidx.annotation.DrawableRes | |
import androidx.annotation.StringRes | |
import com.ercnksgl.enumtestapp.R | |
enum class MessageType( | |
@StringRes val titleResId: Int, | |
@DrawableRes val iconResId: Int, | |
@ColorRes val cardColorResId: Int, | |
@ColorRes val titleColorResId: Int | |
) { | |
SUCCESS( | |
titleResId = R.string.success_title, | |
iconResId = R.drawable.check, | |
cardColorResId = R.color.green_300, | |
titleColorResId = R.color.green_100 | |
), | |
ERROR( | |
titleResId = R.string.error_title, | |
iconResId = R.drawable.close, | |
cardColorResId = R.color.red_300, | |
titleColorResId = R.color.red_100 | |
), | |
INFO( | |
titleResId = R.string.info_title, | |
iconResId = R.drawable.info, | |
cardColorResId = R.color.yellow_300, | |
titleColorResId = R.color.yellow_100 | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment