I am trying to adjust the softkeyboard right below the image buttons, but it covers the image buttons which does not makes it clickable . I want the buttons to be right above the softkeyboard when the user clicks on the edittext. I have tried using the windowSoftInputMode="adjustResize"
, but it does not seem to work.
Below is my layout.xml file
<?xml version="1.0" encoding="utf-8"?>
<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/addnote"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:titleTextColor="@color/white" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/addnote_title"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="10dp"
android:hint="Title">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/addnote_title_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout_editor_absoluteX="23dp"
tools:layout_editor_absoluteY="28dp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/addnote_descp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="10dp"
android:hint="Notes">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/addnote_descp_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:lines="10"
tools:layout_editor_absoluteX="23dp"
tools:layout_editor_absoluteY="28dp" />
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="2dp">
<ImageButton
android:id="@+id/check_btn"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="1"
android:background="@color/black"
android:layout_marginRight="2dp"
android:src="@drawable/checkbox"/>
<ImageButton
android:id="@+id/bold_btn"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="1"
android:background="@color/black"
android:layout_marginLeft="2dp"
android:src="@drawable/format_bold"/>
</LinearLayout>
</LinearLayout>
and in the AndroidManifest.xml file i have
<activity
android:name=".AddNote"
android:exported="true"
android:windowSoftInputMode="adjustResize"/>