Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit 99b7be2

Browse files
authored
Update README.md
1 parent 15780f9 commit 99b7be2

File tree

1 file changed

+89
-29
lines changed

1 file changed

+89
-29
lines changed

demoProjects/ExamplesRecyclerView/README.md

Lines changed: 89 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,71 @@ The basic pattern of useage is
1414
1. set a Layout Manager on the RecyclerView ```rv.setLayoutManager(new LinearLayoutManager(this));```
1515

1616
-----------------------------
17-
### Calendar using ConstraintLayout in Recycler View
1817

19-
* [CalendarRecycler.java](https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/java/com/example/motionrecycle/CalendarRecycler.java)
20-
the recycler view code
21-
* [res/layout/calendar.xml](https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/layout/calendar.xml)
22-
the layout used as an item containing the ConstraintLayout
23-
* [res/layout/calendar_entries.xml](https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/layout/calendar_entries.xml)
24-
the TextViews included in the ConstraintLayout
25-
* [res/values/styles.xml](https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/values/styles.xml)
26-
the styles minimizes the amount of xml for each widget
18+
<table border="0">
19+
<tr>
20+
<td colspan="2"><b style="font-size:30px">Calendar using ConstraintLayout in Recycler View</b></td>
21+
22+
</tr>
23+
<tr>
24+
<td>
25+
<ul>
26+
<li> <a href="https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/java/com/example/motionrecycle/CalendarRecycler.java">CalendarRecycler.java</a>
27+
the recycler view code
28+
</li>
29+
<li> <a href="https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/layout/calendar.xml">res/layout/calendar.xml</a>
30+
the layout used as an item containing the ConstraintLayout
31+
</li>
32+
<li> <a href="https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/layout/calendar_entries.xml">res/layout/calendar_entries.xml</a>
33+
the TextViews included in the ConstraintLayout
34+
</li>
35+
<li> <a href="https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/values/styles.xml">res/values/styles.xml</a>
36+
the styles minimizes the amount of xml for each widget
37+
</li>
38+
</ul>
39+
</td>
40+
<td>
41+
<img src="https://user-images.githubusercontent.com/15019413/197081542-de4947e7-fa14-4c95-8b8d-9e46766230e0.gif" alt="recycler_vew_cl"/>
42+
</td>
43+
</tr>
44+
</table>
2745

28-
![recycler_vew_cl](https://user-images.githubusercontent.com/15019413/197081542-de4947e7-fa14-4c95-8b8d-9e46766230e0.gif)
2946

3047
-----------------------------
3148

32-
### Calendar using ConstraintLayout in a MotionLayout as an item in RecyclerView
49+
<table border="0">
50+
<tr>
51+
<td colspan="2"><b style="font-size:30px">Calendar using ConstraintLayout in a MotionLayout as an item in RecyclerView</b></td>
52+
53+
</tr>
54+
<tr>
55+
<td>
3356

34-
* [CalendarRecycler2.java](https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/java/com/example/motionrecycle/CalendarRecycler2.java)
35-
the recycler view code
36-
* [res/layout/calendar_motion.xml](https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/layout/calendar_motion.xml)
37-
the layout used as an item containing the MotionLayout
38-
* [res/xml/calendar_motion_scene.xml](https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/xml/calendar_motion_scene.xml)
39-
the motionScene file
57+
<ul><li>
4058

59+
<a href="https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/java/com/example/motionrecycle/CalendarRecycler2.java">CalendarRecycler2.java</a>
60+
the recycler view code
61+
</li><li>
62+
63+
<a href="https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/layout/calendar_motion.xml">res/layout/calendar_motion.xml</a>
64+
the layout used as an item containing the ConstraintLayout
65+
</li><li>
66+
67+
<a href="https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/xml/calendar_motion_scene.xml">res/xml/calendar_motion_scene.xml</a>
68+
the TextViews included in the ConstraintLayout
69+
</li></ul>
70+
71+
</td>
72+
<td>
73+
<img src="https://user-images.githubusercontent.com/15019413/197082807-2929704a-81ad-4401-ae65-b66b898d0a1b.gif" alt="recycler_ml"/>
74+
</td>
75+
</tr>
76+
</table>
4177

42-
![recycler_ml](https://user-images.githubusercontent.com/15019413/197082807-2929704a-81ad-4401-ae65-b66b898d0a1b.gif)
4378

4479
-----------------------------
4580

81+
4682
### MotionLayout in Recycler view showing how to cache the states of active motionLayouts
4783

4884

@@ -66,8 +102,7 @@ https://user-images.githubusercontent.com/20599348/195418010-512859a1-8503-48e5-
66102

67103

68104
-----------------------------
69-
70-
105+
71106
### Scroll locking during transition
72107

73108
Demo of locking the RecyclerView during swipe
@@ -122,20 +157,45 @@ A key issue is that bind(...) is done before onAtach so custom atach may get con
122157
https://user-images.githubusercontent.com/15019413/197657408-3b60f4d6-0e0b-4a00-b6ec-83ca6b6b5ac7.mp4
123158

124159
---------------------------
125-
### This demos having 2 recycler views one horizontal and one Veritcal
126160

127-
* [layout/recycler_two.xml](https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/layout/recycler_two.xml) - Top Level Layout
128-
* [xml/recycle_two_scene.xml](https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/xml/recycle_two_scene.xml) - Top Level MotionScene
129-
* [TwoRecycler.java](https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/java/com/example/motionrecycle/TwoRecycler.java)
130-
* [layout/row_item_horizontal.xml](https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/layout/row_item_horizontal.xml) - The horizontal recyclerView item
131-
* [layout/lock_recycler_item.xml](https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/layout/lock_recycler_item.xml) - The vertical recycler view item
132-
* [xml/lock_recycler_item_scene.xml](https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/xml/lock_recycler_item_scene.xml)
161+
<table border="0">
162+
<tr>
163+
<td colspan="2"><b style="font-size:30px">This demos having 2 recycler views one horizontal and one Veritcal</b></td>
164+
</tr>
165+
<tr>
166+
<td>
133167

134-
This uses a trick to have have the horizontal recycler view not get the vertical strokes.
168+
<ul><li>
169+
170+
<a href="https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/layout/recycler_two.xml">layout/recycler_two.xml</a> Top Level Layout
171+
</li><li>
172+
173+
<a href="https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/xml/recycle_two_scene.xml">xml/recycle_two_scene.xml</a> Top Level MotionScene
174+
</li><li>
135175

176+
<a href="https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/java/com/example/motionrecycle/TwoRecycler.java">TwoRecycler.java</a> The activity, Adapter and ViewHolder
177+
178+
</li><li>
136179

137-
![recyclerView_hv2](https://user-images.githubusercontent.com/15019413/199828729-d6a95d67-c85f-42b6-9b94-5ad4d55c0627.gif)
180+
<a href="https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/layout/row_item_horizontal.xml">layout/row_item_horizontal.xml</a> The horizontal recyclerView item
181+
182+
</li><li>
138183

184+
<a href="https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/layout/lock_recycler_item.xml">layout/lock_recycler_item.xml</a> The vertical recycler view item
185+
</li><li>
186+
187+
<a href="https://github.com/androidx/constraintlayout/blob/main/demoProjects/ExamplesRecyclerView/app/src/main/res/xml/lock_recycler_item_scene.xml">xml/lock_recycler_item_scene.xml</a> The Vertical item (also a motionLayout)
188+
189+
</li></ul>
190+
This uses a trick to have have the horizontal recycler view not get the vertical strokes.
191+
</td>
192+
<td>
193+
<img src="https://user-images.githubusercontent.com/15019413/199828729-d6a95d67-c85f-42b6-9b94-5ad4d55c0627.gif" alt="Vertical + horizontal recyclerviews"/>
194+
</td>
195+
</tr>
196+
</table>
197+
198+
139199

140200

141201
## Contributing

0 commit comments

Comments
 (0)