Skip to content

Commit

Permalink
[feature/common/royal_flush_edit_text]: #9 rename: Royal Flush Edit T…
Browse files Browse the repository at this point in the history
…ext -> Royal Flush Icon Edit Text로 변경
  • Loading branch information
soopeach committed May 14, 2023
1 parent be6c697 commit 40c1717
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,26 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.ggne.feature_common.R
import com.ggne.feature_common.databinding.RoyalFlushEditTextBinding
import com.ggne.feature_common.databinding.RoyalFlushIconEditTextBinding

class RoyalFlushEditText(context: Context, attrs: AttributeSet) : ConstraintLayout(context, attrs) {
class RoyalFlushIconEditText(context: Context, attrs: AttributeSet) :
ConstraintLayout(context, attrs) {

private val binding =
RoyalFlushEditTextBinding.inflate(LayoutInflater.from(context), this, true)
RoyalFlushIconEditTextBinding.inflate(LayoutInflater.from(context), this, true)

init {

context.theme.obtainStyledAttributes(
attrs,
R.styleable.RoyalFlushEditText,
R.styleable.RoyalFlushIconEditText,
0,
0,
).apply {
try {

getResourceId(
R.styleable.RoyalFlushEditText_startIcon,
R.styleable.RoyalFlushIconEditText_startIcon,
EMPTY_RESOURCE,
).let { resource ->
if (resource == EMPTY_RESOURCE) {
Expand All @@ -34,7 +35,7 @@ class RoyalFlushEditText(context: Context, attrs: AttributeSet) : ConstraintLayo
}

getResourceId(
R.styleable.RoyalFlushEditText_endIcon,
R.styleable.RoyalFlushIconEditText_endIcon,
EMPTY_RESOURCE,
).let { resource ->
if (resource == EMPTY_RESOURCE) {
Expand All @@ -44,10 +45,9 @@ class RoyalFlushEditText(context: Context, attrs: AttributeSet) : ConstraintLayo
}
}

getString(R.styleable.RoyalFlushEditText_royalFlushEditTextHint).let { hint ->
getString(R.styleable.RoyalFlushIconEditText_royalFlushIconEditTextHint).let { hint ->
binding.et.hint = hint
}

} finally {
recycle()
}
Expand Down
4 changes: 2 additions & 2 deletions feature/feature-common/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="RoyalFlushEditText">
<declare-styleable name="RoyalFlushIconEditText">
<attr name="startIcon" format="reference" />
<attr name="endIcon" format="reference" />
<attr name="royalFlushEditTextHint" format="string" />
<attr name="royalFlushIconEditTextHint" format="string" />
</declare-styleable>
</resources>

0 comments on commit 40c1717

Please sign in to comment.