Created
June 2, 2017 08:04
-
-
Save senneco/b254ca8fda2f71f37bfbb848470d94b3 to your computer and use it in GitHub Desktop.
This file contains 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 Temp { | |
public View showFloatingView(View contentView) | |
{ | |
final View floatingView = ((LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE)).inflate(R.layout.view_floating, null); | |
final WindowManager windowManager = (WindowManager) getSystemService(WINDOW_SERVICE); | |
final WindowManager.LayoutParams mLayoutParams = new WindowManager.LayoutParams( | |
WindowManager.LayoutParams.WRAP_CONTENT, | |
WindowManager.LayoutParams.WRAP_CONTENT, | |
WindowManager.LayoutParams.TYPE_SYSTEM_ERROR, | |
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | |
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | |
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | |
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | |
| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH, | |
PixelFormat.TRANSLUCENT); | |
windowManager.addView(floatingView, mLayoutParams); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment