Skip to content

Commit 5c06e7a

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 9acc705 + 666ca58 commit 5c06e7a

File tree

1 file changed

+49
-4
lines changed

1 file changed

+49
-4
lines changed

README.md

+49-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# multi selector bottom sheet library
1+
# Bottom Sheet Custom Views
22

33
How to implement?
44
```
@@ -15,20 +15,65 @@ dependencies {
1515
implementation 'com.github.maxx2478:multi_selector_dialog_library:1.1'
1616
}
1717
```
18-
How to show Bottom Sheet Dialog?
18+
19+
**1) Show a Filter Bottom Sheet (inspired by flipkart)**
20+
21+
![image](https://user-images.githubusercontent.com/64951609/197324236-6f8a8646-2d4a-4fb7-b966-8d9579d33d56.png)
22+
23+
```
24+
var list2 = arrayListOf<Category?>()
25+
list2.add(
26+
Category(
27+
catID = "1.1",
28+
catName = "Fruits Fruits Fruits FruitsFruits FruitsFruits",
29+
isCatHovered = false,
30+
isCatSelected = false,
31+
filters = arrayListOf<SelectionModel>(
32+
SelectionModel(data = SearchModel("1", "Apples"), isSelected = false, catID = "1.1"),
33+
SelectionModel(data = SearchModel("2", "Grapes"), isSelected = false, catID = "1.1"),
34+
SelectionModel(data = SearchModel("3", "Grapes 2"), isSelected = false, catID = "1.1"),
35+
SelectionModel(data = SearchModel("4", "Grapes 3"), isSelected = false, catID = "1.1")
36+
),
37+
isSingleSelection = false //choose mode : true-> single selection, false -> many
38+
)
39+
)
40+
// add more items in the list
41+
FilterBottomSheetDialog.show("Filters", this, list){ it->
42+
//List of all items (including selected and not selected)
43+
list2 = ArrayList(it) //update your list
44+
filterUIItems(list2)
45+
}.show()
46+
```
47+
48+
**2) Show a Multi Selector Bottom Sheet Dialog**
1949
```
2050
val list = arrayListOf<SelectionModel>()
2151
list.add(SelectionModel(data = SearchModel("1", "Apples"), isSelected = false))
2252
list.add(SelectionModel(data = SearchModel("2", "Grapes"), isSelected = false))
2353
//add as much as you want
2454
25-
SelectorDialog.showSelectorDialog("Choose your favourite fruits", this, list) { selectedItems->
55+
MultiSelectorDialog.show("Choose your favourite fruits", this, list) { selectedItems->
2656
//Selected Items List
2757
Toast.makeText(this, selectedItems.toString(), Toast.LENGTH_SHORT).show()
2858
2959
}.show()
3060
3161
```
3262
![image](https://user-images.githubusercontent.com/64951609/196044350-3bdd920b-29c5-40f5-ad8a-1bd7e9e9f999.png)
33-
![image](https://user-images.githubusercontent.com/64951609/196044374-2cafa511-0cd5-4bad-a40a-64ab1df16b6a.png)
3463

64+
65+
**3) Show a Single Selection Bottom Sheet**
66+
```
67+
val list = arrayListOf<SelectionModel>()
68+
list.add(SelectionModel(data = SearchModel("1", "Apples"), isSelected = false))
69+
list.add(SelectionModel(data = SearchModel("2", "Grapes"), isSelected = false))
70+
//add as much as you want
71+
72+
SelectorDialog.show("Choose your favourite fruits", this, list) { selectedItem->
73+
//Selected Item
74+
Toast.makeText(this, selectedItem.toString(), Toast.LENGTH_SHORT).show()
75+
76+
}.show()
77+
78+
```
79+

0 commit comments

Comments
 (0)