소스 검색

Add README content for list check state management methods

Aidan Follestad 6 년 전
부모
커밋
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.