Skip to content

Commit

Permalink
测试 demo 增加 itemdecoration
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCheen committed Aug 22, 2022
1 parent 86ff3a7 commit f0c0482
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/me/yifeiyuan/flapdev/GitHubDemoFragment.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.yifeiyuan.flapdev

import android.view.View
import me.yifeiyuan.flap.decoration.LinearSpaceItemDecoration
import me.yifeiyuan.flap.delegate.adapterDelegate
import me.yifeiyuan.flap.ext.bindTextView
import me.yifeiyuan.flapdev.components.SimpleTextModel
Expand All @@ -16,6 +17,8 @@ class GitHubDemoFragment : BaseTestcaseFragment() {
override fun onInit(view: View) {
super.onInit(view)

recyclerView.addItemDecoration(LinearSpaceItemDecoration(requireActivity().toPixel(6)))

val simpleTextDelegate = adapterDelegate<SimpleTextModel>(R.layout.flap_item_simple_text) {
onBind { model ->
bindTextView(R.id.tv_content) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import android.view.MenuItem
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import me.yifeiyuan.flap.decoration.LinearSpaceItemDecoration
import me.yifeiyuan.flap.skeleton.Skeleton
import me.yifeiyuan.flap.widget.FlapGridLayoutManager
import me.yifeiyuan.flap.widget.FlapLinearLayoutManager
import me.yifeiyuan.flap.widget.FlapStaggeredGridLayoutManager
import me.yifeiyuan.flapdev.R
import me.yifeiyuan.flapdev.components.ZeroHeightModel
import me.yifeiyuan.flapdev.mockMultiTypeModels
import me.yifeiyuan.flapdev.toPixel

/**
* 多类型测试
Expand Down Expand Up @@ -53,6 +55,8 @@ class MultiTypeTestcase : BaseTestcaseFragment() {
.onlyOnce(false)
.withEmptyViewHelper(adapter.emptyViewHelper)
.show()

recyclerView.addItemDecoration(LinearSpaceItemDecoration(requireActivity().toPixel(6)))
}

override fun createRefreshData(size: Int): MutableList<Any> {
Expand Down

0 comments on commit f0c0482

Please sign in to comment.