I have a custom Dialog as shown below:



When I click on the Edit Text, The dialog is shifted upwards but half of the dialog becomes invisible as shown below:


I verified the issue on Android ICS and Gingerbread but it doesn't happen on Android Lollipop.

I appreciate your help for figuring out why.

Here is the custom dialog layout XML:

&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layoutChatInGame"
android:layout_width="305dp"
android:layout_height="190dp"
android:background="@drawable/dialog_table_border"
android:orientation="vertical"
android:visibility="visible"&gt;

&lt;LinearLayout
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/roomlist_title_background"&gt;

    &lt;ProgressBar
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/progressBar"
        android:layout_margin="5dp"/&gt;

    &lt;LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:layout_margin="5dp"&gt;

        &lt;LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"&gt;

            &lt;TextView
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:text="Game is on hold because the host paused the app"
                android:id="@+id/lblOnHoldDialogMessage"
                android:textColor="@color/progress_dialog_on_hold_text"
                android:textSize="18dp"
                android:singleLine="false"
                android:layout_gravity="center_horizontal"/&gt;
        &lt;/LinearLayout&gt;
    &lt;/LinearLayout&gt;

&lt;/LinearLayout&gt;

&lt;TextView
    android:id="@+id/lblChatHistoryGameOnHold"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:layout_weight="1"
    android:gravity="bottom"
    android:maxLines="5"
    android:scrollbars="vertical"
    android:textColor="@color/edit_text_general_text"
    android:textColorHint="@color/edit_text_general_hint"
    android:paddingRight="2dp"
    android:paddingLeft="2dp"/&gt;

&lt;LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"&gt;

    &lt;EditText
        android:id="@+id/textChatGameOnHold"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="2dp"
        android:layout_marginStart="2dp"
        android:layout_weight="1"
        android:ems="10"
        android:hint="@string/edit_text_send_chat_message"
        android:imeOptions="flagNoExtractUi|actionDone"
        android:inputType="text"
        android:maxLength="100"
        android:maxLines="1"
        android:textColor="@color/edit_text_general_text"
        android:textColorHint="@color/edit_text_general_hint"/&gt;

    &lt;Button
        android:id="@+id/btnSendGameOnHold"
        style="@style/lightboxButton.Blue"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="sendChatMessageInGame"
        android:text="@string/btn_send"/&gt;
&lt;/LinearLayout&gt;

&lt;/LinearLayout&gt; 



Question: ... finished {written/writing/to write/wrote} two compositions
Answer: This is a licensing matter: each verb “licenses” or permits only specific kinds of clausal complement. The verb finish licenses gerund clauses but not infinitive or that clauses:


  okSalman finished writing two compositions.
  ∗ Salman finished to write two compositions.
  ∗ Salman finished that he wrote two compositions.  


By contrast, begin licenses both gerund and infinitive clauses:


  okSalman began writing two compositions.
  okSalman began to write two compositions.
  ∗ Salman began that he wrote two compositions.  


Linguists have strained for a couple of generations to discern a “logic or rule” behind specific licenses, but I have not seen a convincing account. It’s just an idiomatic property of individual words, and you have to learn it word-by-word.

Click this licensing to see more questions involving licensing by verbs and words of other classes.



∗ marks an utterance as unacceptable