1

I have a tabbed Activity in android created using the android.support.design.widget.AppBarLayout and android.support.v4.view.ViewPager classes. The parent layout for this activity is a android.support.design.widget.CoordinatorLayout. In one of the tabs, the fragment has the layout with a customised player at the bottom (with id audioController in below code). That fragment is meant to play the earlier recorded audio files through the app. My layout is as follows:

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ListView
        android:id="@+id/recordingsListView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:divider="@color/course_brow_text_color_light"
        android:dividerHeight="1dp"/>


    <RelativeLayout
        android:id="@+id/audioController"
        android:layout_width="wrap_content"
        android:background="@color/player_bkg_color"
        android:layout_height="80dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <ImageButton
            android:contentDescription="@string/record_button_desc"
            android:id="@+id/playPauseButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/play"
            android:layout_gravity="start"
            android:layout_centerVertical="true"/>

        <SeekBar
            android:id="@+id/audioSeekBar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_toRightOf="@id/playPauseButton"
            android:layout_toEndOf="@id/playPauseButton" />

        <TextView
            android:text="@string/time_elapsed_default"
            android:id="@+id/elapsedTime"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"/>

    </RelativeLayout>

</RelativeLayout>

The problem that I am facing is that my relative layout with the id audioController is hidden behind the soft touch keypad (the one with back, home and open application button) on the newer devices like Nexus 5. What is the best way to put this relative layout just above the soft touch keypad.

Swapnil
  • 1,870
  • 2
  • 23
  • 48
  • I resolved this by using a `RelativeLayout` instead of a `android.support.design.widget.CoordinatorLayout` as mentioned in the question. I am still not sure on why did this work. I guess this behavior of `CoordinatorLayout` has to do with it being a special kind of `FrameLayout`. Can someone clarify on this? – Swapnil Feb 02 '16 at 11:07

0 Answers0