Skip to content

Instantly share code, notes, and snippets.

View saguinav's full-sized avatar

Samuel Guirado Navarro saguinav

View GitHub Profile
@saguinav
saguinav / Example.java
Created June 15, 2017 02:09
Polymorphic deserialization with Moshi
package com.square.moshi.example;
import com.squareup.moshi.RuntimeTypeJsonAdapterFactory.RuntimeType;
public class Example {
static class Animal {
String type;
String name;
@saguinav
saguinav / RecyclerPagerAdapter
Last active August 29, 2015 14:19
This class aims to provide a base implementation for PagerAdapter that includes a mechanism for recycling views.
/*
* Copyright (C) 2015 Samuel Guirado Navarro
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software