-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to prevent dialog item selection through listener (#139)
- Loading branch information
Showing
4 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...ary/src/main/java/de/Maxr1998/modernpreferences/preferences/choice/OnItemClickListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package de.Maxr1998.modernpreferences.preferences.choice | ||
|
||
fun interface OnItemClickListener { | ||
/** | ||
* Notified when the user clicks a [SelectionItem]. | ||
* This is called before the change gets persisted and can be prevented by returning false. | ||
* | ||
* @param item the clicked item | ||
* @param index the index of the clicked item | ||
* | ||
* @return true to to allow the selection of the item | ||
*/ | ||
fun onItemSelected(item: SelectionItem): Boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters