Skip to content

Instantly share code, notes, and snippets.

Hard work

Uzias uziassantosferreira

Hard work
View GitHub Profile
uziassantosferreira /
Created Nov 3, 2016
Example create enum in android annotation
User user = new User();
user.age = Numbers.ONE;
public class Action implements Serializable {
public String label;
public String url;
public String type;
public Type getType(){
return Type.fromInt(Integer.parseInt(type));
uziassantosferreira / BindableAdapter.kt
Created Feb 5, 2019
Example use mvvm with recyclerview
View BindableAdapter.kt
interface BindableAdapter<T> {
fun setData(items: List<T>?)
View ExampleViewModel.kt
internal class ExampleViewModel : ViewModel() {
private val disposables = CompositeDisposable()
val showLoading = MutableLiveData<Boolean>()
val viewState = MutableLiveData<ExampleViewState>()
val posts = MutableLiveData<List<Post>>()
View SimpleScreenState.kt
sealed class SimpleScreenState {
object Loading : SimpleScreenState()
object GenericError : SimpleScreenState()
object NetworkError : SimpleScreenState()
object EmptyState : SimpleScreenState()
data class Content<T>(val data: T) : SimpleScreenState()
uziassantosferreira /
Created Dec 12, 2016
Screen Recording in service android
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 {
You can’t perform that action at this time.