0

Click here for the screenshot Footer Bar in webview not showing up, I have RelativeLayout as parent layout. Footer bar layout contains 'goback' and 'gototop' buttons in order handle previous page loading and going to top of the webview. I need show the footer bar after scrolling the webview from (0,0) position. Please help me.

<?xml version="1.0" encoding="utf-8"?>

<android.support.constraint.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/nestedScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">


<ProgressBar
    android:id="@+id/fb_progressBar"
    style="@android:style/Widget.ProgressBar.Horizontal"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:maxHeight="5dip"
    android:minHeight="5dip"
    android:progressDrawable="@drawable/progress_horizontal"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

<utilities.ObservableWebView
    android:id="@+id/fb_webView"
    android:layout_width="0dp"
    android:layout_height="0dp"
    app:layout_constraintBottom_toTopOf="@+id/footerBar"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/fb_progressBar"
     />

<RelativeLayout
    android:id="@+id/footerBar"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@color/footerBarBg"
    android:paddingBottom="8dp"
    android:paddingTop="8dp"
    android:visibility="visible"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    >

    <ImageView
        android:id="@+id/go_back"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_marginStart="16dp"
        android:background="?attr/selectableItemBackground"
        android:padding="5dp"
        android:src="@drawable/ic_arrow_back_black_24dp" />

    <ImageView
        android:id="@+id/goToTop"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_alignParentTop="true"
        android:layout_marginEnd="16dp"
        android:background="?attr/selectableItemBackground"
        android:padding="5dp"
        android:src="@drawable/ic_arrow_upward_black_24dp" />

</RelativeLayout>


</android.support.constraint.ConstraintLayout>
Manikandan
  • 95
  • 1
  • 7
  • you can provide image for better idea. because contraintlayout in cobined linear layout and relative layout. there for i think no need for relative layout in your xml. –  Apr 03 '18 at 10:03

1 Answers1

0
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/nestedScrollView"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <utilities.ObservableWebView
        android:id="@+id/fb_webView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/footerBar"
        />

    <RelativeLayout
        android:id="@+id/footerBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="@color/footerBarBg"
        android:backgroundTint="#ff0000"
        android:paddingBottom="8dp"
        android:paddingTop="8dp"
        android:visibility="visible">

        <ImageView
            android:id="@+id/go_back"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_marginStart="16dp"
            android:background="?attr/selectableItemBackground"
            android:padding="5dp"
            android:src="@drawable/ic_arrow_back_black_24dp" />

        <ImageView
            android:id="@+id/goToTop"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_alignParentTop="true"
            android:layout_marginEnd="16dp"
            android:background="?attr/selectableItemBackground"
            android:padding="5dp"
            android:src="@drawable/ic_arrow_upward_black_24dp" />

    </RelativeLayout>

    <ProgressBar
        android:id="@+id/fb_progressBar"
        style="@android:style/Widget.ProgressBar.Horizontal"
        android:layout_width="match_parent"
        android:layout_height="5dp"
        android:maxHeight="5dip"
        android:minHeight="5dip"
        android:progressDrawable="@drawable/progress_horizontal" />
</RelativeLayout>

this work perfect

or refer to this document https://stackoverflow.com/a/44778453/7522720

007
  • 516
  • 1
  • 5
  • 17