1
0
Эх сурвалжийг харах

Add README content for list check state management methods

Aidan Follestad 6 жил өмнө
parent
commit
c2c4031433
1 өөрчлөгдсөн 37 нэмэгдсэн , 0 устгасан
  1. 37 0
      README.md

+ 37 - 0
README.md

@@ -376,6 +376,22 @@ MaterialDialog(this)
   .show()
 ```
 
+---
+
+There are methods you can use in a built dialog to modify checked states:
+
+```kotlin
+val dialog: MaterialDialog = // ...
+
+dialog.checkItem(index)
+
+dialog.uncheckItem(index)
+
+dialog.toggleItemChecked(index)
+
+val checked: Boolean = dialog.isItemChecked(index)
+```
+
 ### Multiple Choice
 
 You can show multiple choice (checkbox) lists using the `listItemsMultiChoice` extension on `MaterialDialog`:
@@ -453,6 +469,27 @@ MaterialDialog(this)
   .show()
 ```
 
+---
+
+There are methods you can use in a built dialog to modify checked states:
+
+```kotlin
+val dialog: MaterialDialog = // ...
+val indices: IntArray = // ...
+
+dialog.checkItems(indices)
+
+dialog.uncheckItems(indices)
+
+dialog.toggleItemsChecked(indices)
+
+dialog.checkAllItems()
+
+dialog.uncheckAllItems()
+
+dialog.toggleAllItemsChecked()
+```
+
 ### Custom Adapters 
 
 If you want to customize lists to use your own views, you need to use a custom adapter.