I am trying with bottom sheet dialog fragment, but whenever the keyboard opens the layout also jumps in fragment like recyclerview, already tried with adjustPan and adjustNothing but no success.
Can anyone please help me out ( Need something similar to tiktok UI comments section )
- Tried this already [ https://stackoverflow.com/questions/55788594/remaking-tiktoks-comments-ui-sticky-edittext-at-the-bottom ] but its not working in my case
Some xml snippet which I tried yet
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/no_of_comments"
android:layout_width="match_parent"
android:layout_height="36dp"
android:gravity="center_vertical|center_horizontal"
android:text="30.8k comments"
android:textColor="@color/graycolor" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="300dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/comments_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</ScrollView>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_gravity="bottom"
android:orientation="horizontal">
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/top_gray_line"
android:hint="Leave a comment"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textSize="12sp" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:alpha="0.3"
android:background="@android:color/white"
android:hapticFeedbackEnabled="true"
android:src="@drawable/ic_send_pink" />
</RelativeLayout>
</FrameLayout>
You can try something like following: activity_main:
AndroidManifest:
For output like: