From 786f927302b8c1b7450c2ed31372cc705cf0bf9a Mon Sep 17 00:00:00 2001 From: christoffer lucas Date: Thu, 6 Oct 2022 17:56:22 -0300 Subject: [PATCH] estudos sobre item decoration --- custom-views/SampleCustomView/.idea/misc.xml | 2 ++ .../RecyclerViewItemDecoration1Fragment.kt | 31 +++++++++++++++++++ ...agment_recycler_view_item_decoration_1.xml | 14 +++++++++ 3 files changed, 47 insertions(+) create mode 100644 custom-views/SampleCustomView/app/src/main/java/com/xp/samplecustomview/feature/recyclerview/features/itemdecoration/RecyclerViewItemDecoration1Fragment.kt create mode 100644 custom-views/SampleCustomView/app/src/main/res/layout/fragment_recycler_view_item_decoration_1.xml diff --git a/custom-views/SampleCustomView/.idea/misc.xml b/custom-views/SampleCustomView/.idea/misc.xml index 166356a..f08317b 100644 --- a/custom-views/SampleCustomView/.idea/misc.xml +++ b/custom-views/SampleCustomView/.idea/misc.xml @@ -44,6 +44,7 @@ + @@ -51,6 +52,7 @@ + diff --git a/custom-views/SampleCustomView/app/src/main/java/com/xp/samplecustomview/feature/recyclerview/features/itemdecoration/RecyclerViewItemDecoration1Fragment.kt b/custom-views/SampleCustomView/app/src/main/java/com/xp/samplecustomview/feature/recyclerview/features/itemdecoration/RecyclerViewItemDecoration1Fragment.kt new file mode 100644 index 0000000..225e3cf --- /dev/null +++ b/custom-views/SampleCustomView/app/src/main/java/com/xp/samplecustomview/feature/recyclerview/features/itemdecoration/RecyclerViewItemDecoration1Fragment.kt @@ -0,0 +1,31 @@ +package com.xp.samplecustomview.feature.recyclerview.features.itemdecoration + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import com.xp.samplecustomview.R + + +/* + links de estudo + https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ItemDecoration + https://stackoverflow.com/questions/24618829/how-to-add-dividers-and-spaces-between-items-in-recyclerview + */ + +class RecyclerViewItemDecoration1Fragment : Fragment() { + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_recycler_view_item_decoration_1, container, false) + } + + companion object { + @JvmStatic + fun newInstance() = RecyclerViewItemDecoration1Fragment() + } +} \ No newline at end of file diff --git a/custom-views/SampleCustomView/app/src/main/res/layout/fragment_recycler_view_item_decoration_1.xml b/custom-views/SampleCustomView/app/src/main/res/layout/fragment_recycler_view_item_decoration_1.xml new file mode 100644 index 0000000..694164c --- /dev/null +++ b/custom-views/SampleCustomView/app/src/main/res/layout/fragment_recycler_view_item_decoration_1.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file