-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68fc48d
commit f322e44
Showing
4 changed files
with
81 additions
and
13 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
28 changes: 28 additions & 0 deletions
28
app/src/main/java/app/grapheneos/pdfviewer/viewModel/PasswordStatus.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,28 @@ | ||
package app.grapheneos.pdfviewer.viewModel | ||
|
||
import androidx.lifecycle.MutableLiveData | ||
import androidx.lifecycle.ViewModel | ||
|
||
class PasswordStatus : ViewModel() { | ||
|
||
enum class Status { | ||
MissingPassword, | ||
InvalidPassword, | ||
Validated | ||
} | ||
|
||
val status: MutableLiveData<Status> = MutableLiveData(Status.MissingPassword) | ||
|
||
fun passwordMissing() { | ||
status.postValue(Status.MissingPassword) | ||
} | ||
|
||
fun invalid() { | ||
status.postValue(Status.InvalidPassword) | ||
} | ||
|
||
fun validated() { | ||
status.postValue(Status.Validated) | ||
} | ||
|
||
} |
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