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
sealed class SimpleScreenState { | |
object Loading : SimpleScreenState() | |
object GenericError : SimpleScreenState() | |
object NetworkError : SimpleScreenState() | |
object EmptyState : SimpleScreenState() | |
data class Content<T>(val data: T) : SimpleScreenState() | |
} |
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
internal class ExampleViewModel : ViewModel() { | |
private val disposables = CompositeDisposable() | |
val showLoading = MutableLiveData<Boolean>() | |
val viewState = MutableLiveData<ExampleViewState>() | |
val posts = MutableLiveData<List<Post>>() |
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
interface BindableAdapter<T> { | |
fun setData(items: List<T>?) | |
} |
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
public class MediaRecorderHelper { | |
private static final int SENSOR_ORIENTATION_DEFAULT_DEGREES = 90; | |
private static final int SENSOR_ORIENTATION_INVERSE_DEGREES = 270; | |
private static final SparseIntArray DEFAULT_ORIENTATIONS = new SparseIntArray(); | |
private static final SparseIntArray INVERSE_ORIENTATIONS = new SparseIntArray(); | |
static { | |
DEFAULT_ORIENTATIONS.append(Surface.ROTATION_0, 90); | |
DEFAULT_ORIENTATIONS.append(Surface.ROTATION_90, 0); |
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
//Example | |
User user = new User(); | |
user.age = Numbers.ONE; |
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
import java.io.Serializable; | |
public class Action implements Serializable { | |
public String label; | |
public String url; | |
public String type; | |
public Type getType(){ | |
return Type.fromInt(Integer.parseInt(type)); |