Skip to content

Instantly share code, notes, and snippets.

@shem8
Created October 6, 2015 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shem8/23ce1218bfe584a8ce5a to your computer and use it in GitHub Desktop.
Save shem8/23ce1218bfe584a8ce5a to your computer and use it in GitHub Desktop.
public class SplashView extends View {
private Bitmap bitmap;
public SplashView(Context context) {
super(context);
init();
}
private void init() {
bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.logo);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int w = MeasureSpec.makeMeasureSpec(bitmap.getWidth(), MeasureSpec.EXACTLY);
int h = MeasureSpec.makeMeasureSpec(bitmap.getHeight(), MeasureSpec.EXACTLY);
super.onMeasure(w, h);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment