diff --git a/app/src/main/java/org/sopt/pingle/presentation/type/GroupType.kt b/app/src/main/java/org/sopt/pingle/presentation/type/GroupType.kt new file mode 100644 index 00000000..b06894b3 --- /dev/null +++ b/app/src/main/java/org/sopt/pingle/presentation/type/GroupType.kt @@ -0,0 +1,19 @@ +package org.sopt.pingle.presentation.type + +import androidx.annotation.DrawableRes +import androidx.annotation.StringRes +import org.sopt.pingle.R + +enum class GroupType( + @StringRes val groupTextRes: Int, + @DrawableRes val groupImageRes: Int, +) { + ORIGINAL( + R.string.on_bording_original_group, + R.drawable.ic_launcher_background + ), + NEW( + R.string.on_bording_new_group, + R.drawable.ic_launcher_background + ) +} \ No newline at end of file diff --git a/app/src/main/java/org/sopt/pingle/util/base/BindingAdapter.kt b/app/src/main/java/org/sopt/pingle/util/base/BindingAdapter.kt new file mode 100644 index 00000000..1ee2e426 --- /dev/null +++ b/app/src/main/java/org/sopt/pingle/util/base/BindingAdapter.kt @@ -0,0 +1,11 @@ +package org.sopt.pingle.util.base + +import android.widget.ImageView +import androidx.core.content.ContextCompat +import androidx.databinding.BindingAdapter + +@BindingAdapter("image") +fun setImageResource(imageView: ImageView, resId: Int) { + val drawable = ContextCompat.getDrawable(imageView.context, resId) + imageView.setImageDrawable(drawable) +}