diff --git a/app/src/main/java/me/yifeiyuan/flapdev/GitHubDemoFragment.kt b/app/src/main/java/me/yifeiyuan/flapdev/GitHubDemoFragment.kt index 3b82acdc..716fb55c 100644 --- a/app/src/main/java/me/yifeiyuan/flapdev/GitHubDemoFragment.kt +++ b/app/src/main/java/me/yifeiyuan/flapdev/GitHubDemoFragment.kt @@ -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 @@ -16,6 +17,8 @@ class GitHubDemoFragment : BaseTestcaseFragment() { override fun onInit(view: View) { super.onInit(view) + recyclerView.addItemDecoration(LinearSpaceItemDecoration(requireActivity().toPixel(6))) + val simpleTextDelegate = adapterDelegate(R.layout.flap_item_simple_text) { onBind { model -> bindTextView(R.id.tv_content) { diff --git a/app/src/main/java/me/yifeiyuan/flapdev/testcases/MultiTypeTestcase.kt b/app/src/main/java/me/yifeiyuan/flapdev/testcases/MultiTypeTestcase.kt index 6dcc7362..53af1c63 100644 --- a/app/src/main/java/me/yifeiyuan/flapdev/testcases/MultiTypeTestcase.kt +++ b/app/src/main/java/me/yifeiyuan/flapdev/testcases/MultiTypeTestcase.kt @@ -6,6 +6,7 @@ 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 @@ -13,6 +14,7 @@ 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 /** * 多类型测试 @@ -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 {