Created
October 6, 2015 12:20
-
-
Save shem8/23ce1218bfe584a8ce5a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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