View ImmutableListDeserializer.java
public static void main(String[] args) {
Type type = getCollectionType(ImmutableList.class, Number.class);
Gson gson = new GsonBuilder().registerTypeAdapter(type, new ImmutableList_TypeAdapter<Number>()).create();
ImmutableList<Number> list = gson.fromJson("[1,2,3]", type);
ListVO vo = gson.fromJson("{\"numbers\":[1,2,3]}", ListVO.class);
}
private static class ListVO {
@Expose @SerializedName("numbers")
ImmutableList<Number> numbers;
View HeaderAdapter.java
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
/**
* Created by khaled bakhtiari on 10/26/2014.
* <a href="http://about.me/kh.bakhtiari">
*/