Skip to content

Commit 7892527

Browse files
committed
rename app:layout_id to app:layout_res
1 parent 8db55f7 commit 7892527

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

app/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
app:layout_constraintLeft_toLeftOf="parent"
2929
app:layout_constraintRight_toRightOf="parent"
3030
app:layout_constraintTop_toBottomOf="@id/ll_dummy"
31-
app:layout_id="@layout/layout_multiple_textview"
31+
app:layout_res="@layout/layout_multiple_textview"
3232
app:parent_layout_id="@id/cl_parent" />
3333

3434
</androidx.constraintlayout.widget.ConstraintLayout>

library/src/main/java/dev/wendyyanto/library/LazyLoadComponent.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ class LazyLoadComponent @JvmOverloads constructor(
4040
try {
4141
parentResId =
4242
typeArray.getResourceId(R.styleable.LazyLoadComponent_parent_layout_id, -1)
43-
val layoutResId = typeArray.getResourceId(R.styleable.LazyLoadComponent_layout_id, -1)
44-
if (layoutResId == -1) {
43+
val layoutRes = typeArray.getResourceId(R.styleable.LazyLoadComponent_layout_res, -1)
44+
if (layoutRes == -1) {
4545
throw IllegalArgumentException(LAYOUT_RESOURCE_IS_INVALID)
4646
}
4747
if (parentResId == -1) {
4848
throw IllegalArgumentException(PARENT_RESOURCE_ID_IS_INVALID)
4949
}
5050
with(viewStub) {
51-
layoutResource = layoutResId
51+
layoutResource = layoutRes
5252
addView(this)
5353
}
5454
} finally {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
33
<declare-styleable name="LazyLoadComponent">
4-
<attr name="layout_id" format="reference" />
4+
<attr name="layout_res" format="reference" />
55
<attr name="parent_layout_id" format="reference" />
66
</declare-styleable>
77
</resources>

0 commit comments

Comments
 (0)