Skip to content

Instantly share code, notes, and snippets.

View Eagles2F's full-sized avatar

Yifan Li Eagles2F

View GitHub Profile
@Eagles2F
Eagles2F / gist:fcf6f3ce40d766b6cc0a
Created August 30, 2015 19:29
Fit brand to material design[notes]
1. Logos
2. Typography
3. Color
4. Visual effect
5. Product itself
private TextView htmlTextView;
private SpannableStringBuilder htmlSpannable;
@Override
public void onCreate(Bundle savedInstanceState) {
// ...
// first parse the html
// replace getHtmlCode() with whatever generates/fetches your html
@Eagles2F
Eagles2F / OkHttpStack.java
Last active August 29, 2015 14:27 — forked from JakeWharton/OkHttpStack.java
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
* uses OkHttp as its transport.
*/
@Eagles2F
Eagles2F / OkHttpStack.java
Last active August 29, 2015 14:27 — forked from bryanstern/OkHttpStack.java
An OkHttp backed HttpStack for Volley
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Circle Internet Financial
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is