Package com.kernelcrew.moodapp.data
Class Utility
java.lang.Object
com.kernelcrew.moodapp.data.Utility
A utility class for UI related actions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.android.gms.tasks.Task<Void>
clearCollection
(com.google.firebase.firestore.CollectionReference collectionRef, int batchSize) Recursively deletes all documents in the given collection.static void
hideSoftKeyboard
(Activity activity) Hide the keyboard if it is open
-
Constructor Details
-
Utility
public Utility()
-
-
Method Details
-
hideSoftKeyboard
Hide the keyboard if it is open- Parameters:
activity
- The current activity where the keyboard is active.
-
clearCollection
public static com.google.android.gms.tasks.Task<Void> clearCollection(com.google.firebase.firestore.CollectionReference collectionRef, int batchSize) Recursively deletes all documents in the given collection.- Parameters:
collectionRef
- The collection to clear.batchSize
- The maximum number of documents to delete per batch.- Returns:
- A Task that completes when the collection is empty.
-