-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Show Contact Visibility Logic Firebase
- Loading branch information
1 parent
6a9d6b0
commit 6bcb2f4
Showing
3 changed files
with
109 additions
and
4 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
app/src/main/java/com/binay/shaw/justap/domain/FirebaseResult.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,26 @@ | ||
package com.binay.shaw.justap.domain | ||
|
||
sealed class Resource<T> { | ||
data class Success<T>(val data: T) : Resource<T>() | ||
data class Error<T>(val exception: Exception) : Resource<T>() | ||
data class Loading<T>(val message: String?) : Resource<T>() | ||
data class Clear<T>(val message: String? = null) : Resource<T>() | ||
|
||
companion object { | ||
fun <T> success(data: T): Resource<T> { | ||
return Success(data) | ||
} | ||
|
||
fun <T> error(exception: Exception): Resource<T> { | ||
return Error(exception) | ||
} | ||
|
||
fun <T> loading(message: String? = null): Resource<T> { | ||
return Loading(message) | ||
} | ||
|
||
fun <T> clear(message: String? = null): Resource<T> { | ||
return Clear(message) | ||
} | ||
} | ||
} |
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