Created
January 28, 2015 05:52
-
-
Save guodong1111/eab2d794fe4f1330caee 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
private WindowManager windowManager; | |
private WindowManager.LayoutParams wmParams; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
view = findViewById(R.id.textView); | |
windowManager = (WindowManager) getApplication().getSystemService(WINDOW_SERVICE); | |
wmParams = new WindowManager.LayoutParams(); | |
wmParams.type = WindowManager.LayoutParams.TYPE_PHONE; | |
wmParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; | |
wmParams.format = PixelFormat.TRANSLUCENT; | |
wmParams.gravity = Gravity.LEFT | Gravity.TOP; | |
wmParams.height = WindowManager.LayoutParams.WRAP_CONTENT; | |
wmParams.width = WindowManager.LayoutParams.WRAP_CONTENT; | |
wmParams.y = 1000; | |
wmParams.x = 300; | |
Button button = new Button(this); | |
windowManager.addView(button, wmParams); | |
button.animate().scaleX(3f).setDuration(3000).start(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment