Skip to content

Commit

Permalink
add itemSpace BindingAdapter for dp sample
Browse files Browse the repository at this point in the history
  • Loading branch information
sjjeong committed Nov 24, 2019
1 parent 4b20230 commit 2f93737
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_mvp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="3"
bind:dino_itemLayout="@{@layout/item_vector_asset}"
bind:dino_itemSpace="@{8}"
bind:dino_itemSpace="@{`8dp`}"
bind:dino_items="@{items}"
tools:itemCount="10"
tools:listitem="@layout/item_vector_asset" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_mvvm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
app:layoutManager="androidx.recyclerview.widget.StaggeredGridLayoutManager"
app:spanCount="3"
bind:dino_itemLayout="@{@layout/item_vector_asset}"
bind:dino_itemSpace="@{8}"
bind:dino_itemSpace="@{`8dp`}"
bind:dino_items="@{vm.vectorAssetItems}"
tools:itemCount="10"
tools:listitem="@layout/item_vector_asset" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_normal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
bind:dino_itemLayout="@{@layout/item_vector_asset}"
bind:dino_itemSpace="@{8}"
bind:dino_itemSpace="@{@dimen/space}"
bind:dino_items="@{items}"
tools:itemCount="10"
tools:listitem="@layout/item_vector_asset" />
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<dimen name="space">8dp</dimen>

</resources>

0 comments on commit 2f93737

Please sign in to comment.