I am displaying my SlidingDrawer on the main screen using the WindowManager object. I am facing difficulty in changing the height of the sliding drawer programmatically, because of which the elements which are behind the drawer are not clickable. I have read the Questions on this topic but none of them is giving me the desired result.
Note: i just want to change the height of the sliding drawer element.
Java Code
final WindowManager.LayoutParams params = new WindowManager.LayoutParams(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
PixelFormat.TRANSLUCENT);
windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
params.gravity = Gravity.BOTTOM | Gravity.LEFT;
//params.x = 0; params.y = 0;
windowManager.addView(view1, params);
Xml Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<SlidingDrawer
android:id="@+id/drawer"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:content="@+id/content"
android:handle="@+id/image">
<ImageView
android:id="@+id/image"
android:layout_width="70dp"
android:layout_height="70dp"
android:src="@drawable/handle2" />
<GridView
android:id="@+id/content"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/black_trans"></GridView>
</SlidingDrawer>