Skip to content

Commit

Permalink
[feat] #13 GroupType 및 BindingAdpater
Browse files Browse the repository at this point in the history
  • Loading branch information
Doreminwoo committed Jan 2, 2024
1 parent a25773d commit 7be44af
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
19 changes: 19 additions & 0 deletions app/src/main/java/org/sopt/pingle/presentation/type/GroupType.kt
Original file line number Diff line number Diff line change
@@ -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
)
}
11 changes: 11 additions & 0 deletions app/src/main/java/org/sopt/pingle/util/base/BindingAdapter.kt
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 7be44af

Please sign in to comment.