In the chat application, I have an action with an image as a background. Now, when I enter a message to publish the phone keypad, it appears and reduces the size of my layout when I use windowSoftInputMode = "adjustResize" in the manifest file. Also, when I use windowSoftInputMode = "adjustPan", the phone keypad hides the action bar. These two problems are cleverly resolved in many applications that are on the market today, for example, WhatsApp chat. Please help me solve this problem in my application. Below is the layout of my chat.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/chat_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="11"
tools:context="com.sixsquarekik.app.ChatActivity" >
<LinearLayout
android:id="@+id/setFrameLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="9"
android:isScrollContainer="false"
android:padding="5dip" >
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/activity_main_swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ListView
android:id="@+id/mlistView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:background="@android:color/transparent"
android:cacheColorHint="@android:color/transparent" >
</ListView>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/ColorPrimary" />
<LinearLayout
android:id="@+id/chat_window_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:gravity="center_horizontal"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:background="@color/White"
android:gravity="center_horizontal"
android:isScrollContainer="false"
android:orientation="horizontal"
android:weightSum="5" >
<EditText
android:id="@+id/mEditText1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:background="#00000000"
android:ems="10"
android:paddingBottom="2dp"
android:hint="Message here"
android:paddingTop="5dp" >
<requestFocus />
</EditText>
<ImageButton
android:id="@+id/mButton"
style="?android:attr/buttonStyleSmall"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:onClick="onSendMessage"
android:src="@drawable/ic_action_send_now"
android:text="send" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
source
share