android Programming Glossary: windowmanager.layoutparams
Playing HTML5 video on fullscreen in android webview http://stackoverflow.com/questions/15768837/playing-html5-video-on-fullscreen-in-android-webview showing and hiding the title bar. Example if fullscreen WindowManager.LayoutParams attrs getWindow .getAttributes attrs.flags WindowManager.LayoutParams.FLAG_FULLSCREEN.. attrs getWindow .getAttributes attrs.flags WindowManager.LayoutParams.FLAG_FULLSCREEN attrs.flags WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON.. WindowManager.LayoutParams.FLAG_FULLSCREEN attrs.flags WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON getWindow .setAttributes attrs if android.os.Build.VERSION.SDK_INT..
What APIs in Android is Facebook using to create Chat Heads? http://stackoverflow.com/questions/15975988/what-apis-in-android-is-facebook-using-to-create-chat-heads this chatHead.setImageResource R.drawable.android_head WindowManager.LayoutParams params new WindowManager.LayoutParams WindowManager.LayoutParams.WRAP_CONTENT.. WindowManager.LayoutParams params new WindowManager.LayoutParams WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.WRAP_CONTENT.. params new WindowManager.LayoutParams WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.TYPE_PHONE..
Adding screen brightness controls to android application http://stackoverflow.com/questions/1791340/adding-screen-brightness-controls-to-android-application The internet claims this works I haven't tried it though WindowManager.LayoutParams lp getWindow .getAttributes lp.screenBrightness 100 100.0f getWindow..
Calling hidden API in android to turn screen off http://stackoverflow.com/questions/1875669/calling-hidden-api-in-android-to-turn-screen-off void setBright float value Window mywindow getWindow WindowManager.LayoutParams lp mywindow.getAttributes lp.screenBrightness value mywindow.setAttributes..
How to make an alert dialog fill 90% of screen size? http://stackoverflow.com/questions/2306503/how-to-make-an-alert-dialog-fill-90-of-screen-size dialog that can grow big enough to cover the whole screen. WindowManager.LayoutParams lp new WindowManager.LayoutParams lp.copyFrom d.getWindow .getAttributes.. cover the whole screen. WindowManager.LayoutParams lp new WindowManager.LayoutParams lp.copyFrom d.getWindow .getAttributes lp.width WindowManager.LayoutParams.MATCH_PARENT.. lp.copyFrom d.getWindow .getAttributes lp.width WindowManager.LayoutParams.MATCH_PARENT lp.height WindowManager.LayoutParams.MATCH_PARENT..
changing screen brightness programmatically in android http://stackoverflow.com/questions/3737579/changing-screen-brightness-programmatically-in-android programmatically in android. At the moment I use this code WindowManager.LayoutParams lp getWindow .getAttributes float brightness 1.0f lp.screenBrightness..
How my app can unlock screen programatically? http://stackoverflow.com/questions/3793221/how-my-app-can-unlock-screen-programatically Window.addFlags to add whichever of the following flags in WindowManager.LayoutParams that you desire FLAG_DISMISS_KEYGUARD FLAG_SHOW_WHEN_LOCKED..
creating a system overlay (always on top) button in android http://stackoverflow.com/questions/4481226/creating-a-system-overlay-always-on-top-button-in-android onCreate Toast.LENGTH_LONG .show mView new HUDView this WindowManager.LayoutParams params new WindowManager.LayoutParams WindowManager.LayoutParams.WRAP_CONTENT.. new HUDView this WindowManager.LayoutParams params new WindowManager.LayoutParams WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.WRAP_CONTENT.. params new WindowManager.LayoutParams WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY..
Can't apply system screen brightness programmatically in Android http://stackoverflow.com/questions/5032588/cant-apply-system-screen-brightness-programmatically-in-android Settings.System.SCREEN_BRIGHTNESS brightnessLevel then do WindowManager.LayoutParams lp getWindow .getAttributes lp.screenBrightness brightness getWindow..
Show AlertDialog in any position of the screen http://stackoverflow.com/questions/5469005/show-alertdialog-in-any-position-of-the-screen dialog.requestWindowFeature Window.FEATURE_NO_TITLE WindowManager.LayoutParams wmlp dialog.getWindow .getAttributes wmlp.gravity Gravity.TOP..
Changing the Screen Brightness System Setting Android http://stackoverflow.com/questions/6708692/changing-the-screen-brightness-system-setting-android brightnessIntent.getFloatExtra brightness value 0 WindowManager.LayoutParams lp getWindow .getAttributes lp.screenBrightness brightness getWindow..
Turn off screen on Android http://stackoverflow.com/questions/6756768/turn-off-screen-on-android turns off the screen once the light level is low enough. WindowManager.LayoutParams params getWindow .getAttributes params.flags LayoutParams.FLAG_KEEP_SCREEN_ON..
How to lock the screen of an android device http://stackoverflow.com/questions/6762671/how-to-lock-the-screen-of-an-android-device be low enough that the screen will automatically turn off. WindowManager.LayoutParams params getWindow .getAttributes params.screenBrightness 0 getWindow..
Changing screen brightness programmatically (as with the power widget) http://stackoverflow.com/questions/7646865/changing-screen-brightness-programmatically-as-with-the-power-widget Settings.System.SCREEN_BRIGHTNESS 20 WindowManager.LayoutParams lp getWindow .getAttributes lp.screenBrightness 0.2f 100 100.0f..
Playing HTML5 video on fullscreen in android webview http://stackoverflow.com/questions/15768837/playing-html5-video-on-fullscreen-in-android-webview Your code to handle the full screen change for example showing and hiding the title bar. Example if fullscreen WindowManager.LayoutParams attrs getWindow .getAttributes attrs.flags WindowManager.LayoutParams.FLAG_FULLSCREEN attrs.flags WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON.. hiding the title bar. Example if fullscreen WindowManager.LayoutParams attrs getWindow .getAttributes attrs.flags WindowManager.LayoutParams.FLAG_FULLSCREEN attrs.flags WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON getWindow .setAttributes attrs if android.os.Build.VERSION.SDK_INT.. attrs getWindow .getAttributes attrs.flags WindowManager.LayoutParams.FLAG_FULLSCREEN attrs.flags WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON getWindow .setAttributes attrs if android.os.Build.VERSION.SDK_INT 14 getWindow .getDecorView .setSystemUiVisibility..
What APIs in Android is Facebook using to create Chat Heads? http://stackoverflow.com/questions/15975988/what-apis-in-android-is-facebook-using-to-create-chat-heads getSystemService WINDOW_SERVICE chatHead new ImageView this chatHead.setImageResource R.drawable.android_head WindowManager.LayoutParams params new WindowManager.LayoutParams WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.TYPE_PHONE.. chatHead new ImageView this chatHead.setImageResource R.drawable.android_head WindowManager.LayoutParams params new WindowManager.LayoutParams WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.TYPE_PHONE WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE.. chatHead.setImageResource R.drawable.android_head WindowManager.LayoutParams params new WindowManager.LayoutParams WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.TYPE_PHONE WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE..
Adding screen brightness controls to android application http://stackoverflow.com/questions/1791340/adding-screen-brightness-controls-to-android-application
Calling hidden API in android to turn screen off http://stackoverflow.com/questions/1875669/calling-hidden-api-in-android-to-turn-screen-off turning the screen off that worked for me on a droid. public void setBright float value Window mywindow getWindow WindowManager.LayoutParams lp mywindow.getAttributes lp.screenBrightness value mywindow.setAttributes lp call this task to turn off the screen in..
How to make an alert dialog fill 90% of screen size? http://stackoverflow.com/questions/2306503/how-to-make-an-alert-dialog-fill-90-of-screen-size That new View is just there to have something inside the dialog that can grow big enough to cover the whole screen. WindowManager.LayoutParams lp new WindowManager.LayoutParams lp.copyFrom d.getWindow .getAttributes lp.width WindowManager.LayoutParams.MATCH_PARENT.. have something inside the dialog that can grow big enough to cover the whole screen. WindowManager.LayoutParams lp new WindowManager.LayoutParams lp.copyFrom d.getWindow .getAttributes lp.width WindowManager.LayoutParams.MATCH_PARENT lp.height WindowManager.LayoutParams.MATCH_PARENT.. screen. WindowManager.LayoutParams lp new WindowManager.LayoutParams lp.copyFrom d.getWindow .getAttributes lp.width WindowManager.LayoutParams.MATCH_PARENT lp.height WindowManager.LayoutParams.MATCH_PARENT d.show d.getWindow .setAttributes lp Note that the attributes..
changing screen brightness programmatically in android http://stackoverflow.com/questions/3737579/changing-screen-brightness-programmatically-in-android in android I want to change the screen brightness programmatically in android. At the moment I use this code WindowManager.LayoutParams lp getWindow .getAttributes float brightness 1.0f lp.screenBrightness brightness getWindow .setAttributes lp But this sample..
How my app can unlock screen programatically? http://stackoverflow.com/questions/3793221/how-my-app-can-unlock-screen-programatically Activity.getWindow to get the window of your activity use Window.addFlags to add whichever of the following flags in WindowManager.LayoutParams that you desire FLAG_DISMISS_KEYGUARD FLAG_SHOW_WHEN_LOCKED FLAG_TURN_SCREEN_ON This is how the standard car dock and desk..
creating a system overlay (always on top) button in android http://stackoverflow.com/questions/4481226/creating-a-system-overlay-always-on-top-button-in-android void onCreate super.onCreate Toast.makeText getBaseContext onCreate Toast.LENGTH_LONG .show mView new HUDView this WindowManager.LayoutParams params new WindowManager.LayoutParams WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.WRAP_CONTENT.. getBaseContext onCreate Toast.LENGTH_LONG .show mView new HUDView this WindowManager.LayoutParams params new WindowManager.LayoutParams WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY.. Toast.LENGTH_LONG .show mView new HUDView this WindowManager.LayoutParams params new WindowManager.LayoutParams WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.WRAP_CONTENT WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY 0 WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE..
Can't apply system screen brightness programmatically in Android http://stackoverflow.com/questions/5032588/cant-apply-system-screen-brightness-programmatically-in-android 0 Settings.System.putInt y.getContentResolver Settings.System.SCREEN_BRIGHTNESS brightnessLevel then do WindowManager.LayoutParams lp getWindow .getAttributes lp.screenBrightness brightness getWindow .setAttributes lp And if you call finish right after..
Show AlertDialog in any position of the screen http://stackoverflow.com/questions/5469005/show-alertdialog-in-any-position-of-the-screen else if item 1 else if item 2 AlertDialog dialog builder.create dialog.requestWindowFeature Window.FEATURE_NO_TITLE WindowManager.LayoutParams wmlp dialog.getWindow .getAttributes wmlp.gravity Gravity.TOP Gravity.LEFT wmlp.x 100 x position wmlp.y 100 y position dialog.show..
Changing the Screen Brightness System Setting Android http://stackoverflow.com/questions/6708692/changing-the-screen-brightness-system-setting-android msg Intent brightnessIntent this.getIntent float brightness brightnessIntent.getFloatExtra brightness value 0 WindowManager.LayoutParams lp getWindow .getAttributes lp.screenBrightness brightness getWindow .setAttributes lp Message message handler.obtainMessage..
Turn off screen on Android http://stackoverflow.com/questions/6756768/turn-off-screen-on-android android.permission.WAKE_LOCK UPDATE Try this method android turns off the screen once the light level is low enough. WindowManager.LayoutParams params getWindow .getAttributes params.flags LayoutParams.FLAG_KEEP_SCREEN_ON params.screenBrightness 0 getWindow .setAttributes..
How to lock the screen of an android device http://stackoverflow.com/questions/6762671/how-to-lock-the-screen-of-an-android-device By changing the brightness to 0 the brightness will be low enough that the screen will automatically turn off. WindowManager.LayoutParams params getWindow .getAttributes params.screenBrightness 0 getWindow .setAttributes params This and this might help you further...
Changing screen brightness programmatically (as with the power widget) http://stackoverflow.com/questions/7646865/changing-screen-brightness-programmatically-as-with-the-power-widget code I found to be working Settings.System.putInt this.getContentResolver Settings.System.SCREEN_BRIGHTNESS 20 WindowManager.LayoutParams lp getWindow .getAttributes lp.screenBrightness 0.2f 100 100.0f getWindow .setAttributes lp startActivity new Intent this..
|