ok so I have a custom dialog that it shows up as the left picture. And I want with a click of a button (black square) to take the full screen like the right screen but don't go behind the keyboard. How can I do this?
for now my dialog is like this
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/comments_relative_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF" >
<EditText
android:id="@+id/user_comments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:gravity="top"
android:textColor="#000000" />
<TextView
android:id="@+id/char_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:text="2048" />
<Button
android:id="@+id/fullscreen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:background="@drawable/full_screen_button_selector"
android:minHeight="1dp"
android:minWidth="1dp" />
</RelativeLayout>
I tried this on onclick but it doesn't work
RelativeLayout r = (RelativeLayout) findViewById(R.id.comments_relative_layout);
FrameLayout.LayoutParams _rootLayoutParams = new
FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
r.setLayoutParams(_rootLayoutParams);
anyone has an idea how to do this?
Try this:
myDialog.show();
Window window = myDialog.getWindow();
window.setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);