Skip to content

Instantly share code, notes, and snippets.

View captain-miao's full-sized avatar

yan_lu captain-miao

  • HangZhou, China
View GitHub Profile
@captain-miao
captain-miao / LocaleHelper.java
Created March 23, 2017 05:27 — forked from gunhansancar/LocaleHelper.java
While developing your awesome application, sometimes you are required to add a language change feature to your app on the fly. However, Android OS does not directly support this behaviour. And therefore, you need to solve this situation in some other ways. For more details see http://gunhansancar.com/change-language-programmatically-in-android/
package com.gunhansancar.changelanguageexample.helper;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.preference.PreferenceManager;
@captain-miao
captain-miao / PicassoBindingAdapter.java
Created June 3, 2016 15:14
Picasso DataBinding Adapter
package com.dahuo.learn.common.databinding;
import android.databinding.BindingAdapter;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
/**