0

I don't have any sample code for this case, because I don't know how this work.

A screenshot will explain this much clearer.

I'm trying to create an input like a Telegram.

Once the sticker button is clicked, hide the keyboard and show a panel with the same height.

The current way that I'm doing will cause the window jumping around. Because when the panel is open, the input will be pushed up When the keyboard is hidden, the input will go to the bottom then pushed up after the sticker panel shows up.

enter image description here

enter image description here

This is what I have right now

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/inputLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:showIn="@layout/activity_main">
    <LinearLayout
        android:id="@+id/inputContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
    >
    <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/inputBox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

</LinearLayout>

<RelativeLayout
        android:id="@+id/galleryContainer"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:background="@color/send_panel_color"
>
</RelativeLayout>

CodingTT
  • 1,125
  • 3
  • 14
  • 23
  • "The current way that I'm doing will cause the window jumping around. Because when the panel is open, the input will be pushed up When the keyboard is hidden, the input will go to the bottom then pushed up after the sticker panel shows up." Share what you have so far. – Bartek Lipinski Jul 25 '19 at 11:19

1 Answers1

0

adjustResize

The activity's main window is always resized to make room for the soft keyboard on screen.

adjustPan

The activity's main window is not resized to make room for the soft keyboard. Rather, the contents of the window are automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing. This is generally less desirable than resizing, because the user may need to close the soft keyboard to get at and interact with obscured parts of the window.

This might help you one of them !

<activity android:windowSoftInputMode="adjustResize"> </activity>

<activity android:windowSoftInputMode="adjustPan"> </activity>

Taken the help from Other member of Stackoverflow

Sagar Khurana
  • 184
  • 1
  • 2
  • 11
  • If you see the screenshot I attached, there is not adjustPan, adjustPan will move up the title in the toolbar as well – CodingTT Jul 26 '19 at 00:24