From 3785b0851a9e9d6d6f00707b976db728dfc0bfa5 Mon Sep 17 00:00:00 2001 From: raheemadamboev Date: Sat, 4 Mar 2023 18:38:54 +0500 Subject: [PATCH] Added clearing pin programmatically; --- .../java/xyz/teamgravity/pin_lock_compose/PinManager.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pin_lock_compose/src/main/java/xyz/teamgravity/pin_lock_compose/PinManager.kt b/pin_lock_compose/src/main/java/xyz/teamgravity/pin_lock_compose/PinManager.kt index 63d79c8..b59e75e 100644 --- a/pin_lock_compose/src/main/java/xyz/teamgravity/pin_lock_compose/PinManager.kt +++ b/pin_lock_compose/src/main/java/xyz/teamgravity/pin_lock_compose/PinManager.kt @@ -113,4 +113,12 @@ object PinManager { fun pinExists(): Boolean { return getPreferences().contains(PIN_LOCK) } + + /** + * Clears the saved pin. By calling this function, you can clear the saved pin so that user can create a new pin without remembering + * the saved pin. + */ + fun clearPin() { + getPreferences().edit().remove(PIN_LOCK).apply() + } } \ No newline at end of file