diff --git a/Spotlight-library/src/main/java/com/wooplr/spotlight/SpotlightView.java b/Spotlight-library/src/main/java/com/wooplr/spotlight/SpotlightView.java index ce00ac5..7cda753 100755 --- a/Spotlight-library/src/main/java/com/wooplr/spotlight/SpotlightView.java +++ b/Spotlight-library/src/main/java/com/wooplr/spotlight/SpotlightView.java @@ -1257,4 +1257,27 @@ private static int getSoftButtonsBarHeight(Activity activity) { } return 0; } + + /** + * This will remove all usage ids from preferences. + */ + public void resetAllUsageIds(){ + try{ + preferencesManager.resetAll(); + }catch(Exception e){ + e.printStackTrace(); + } + } + + /** + * This will remove given usage id from preferences. + * @param id Spotlight usage id to be removed + */ + public void resetUsageId(String id){ + try{ + preferencesManager.reset(id); + }catch(Exception e){ + e.printStackTrace(); + } + } } \ No newline at end of file diff --git a/Spotlight-library/src/main/java/com/wooplr/spotlight/prefs/PreferencesManager.java b/Spotlight-library/src/main/java/com/wooplr/spotlight/prefs/PreferencesManager.java index 94c5f5e..adba2e6 100755 --- a/Spotlight-library/src/main/java/com/wooplr/spotlight/prefs/PreferencesManager.java +++ b/Spotlight-library/src/main/java/com/wooplr/spotlight/prefs/PreferencesManager.java @@ -22,7 +22,7 @@ public void setDisplayed(String id) { } public void reset(String id) { - sharedPreferences.edit().putBoolean(id, false).apply(); + sharedPreferences.edit().remove(id).apply(); } public void resetAll() {