Srujana

hobbies: reading, writing, singing

Code to set attributes for Windows

Usage of flag FLAG_NOT_TOUCH_MODAL which allows touch events that do not fall on the window area to permeate beyond.

        Window window = getWindow();
        LayoutParams layoutParams = window.getAttributes();
        window.addFlags(LayoutParams.FLAG_NOT_TOUCH_MODAL);        
        window.addFlags(LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

        layoutParams.gravity=Gravity.TOP | Gravity.RIGHT;
        layoutParams.dimAmount=0;

add a theme in your style.xml file and set that to your activity.
  <style name="Theme.dialog" parent="@android:style/Theme.Dialog">
        <item name="android:backgroundDimEnabled">false</item>
        <item name="android:colorForeground">#fff</item>
        <item name="android:windowIsFloating">true</item>
  </style>

My favorite pages:
Notion Ink Blog

me.jpg
Srujana Kalidindi