i am using webview inside NestedScrollView which allows me to hide and show toolbar on scroll but there is an issue. the title from toolbar and hamburger is visible Image<>
here is the main view code
<?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:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="0dp" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <ProgressBar android:id="@+id/progressbar_Horizontal" style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="10dp" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:indeterminate="true" android:indeterminateTint="@color/header_back_ground" android:max="100" /> <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/swipe_refresh" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/progressbar_Horizontal"> <android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/nested_scroll_view" android:fitsSystemWindows="true" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <WebView android:id="@+id/web" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerHorizontal="true" /> </android.support.v4.widget.NestedScrollView> </android.support.v4.widget.SwipeRefreshLayout> </RelativeLayout>
And here is the code from app_bar_main
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout 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:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context="com.pressplus.android.demo.MainActivity"> <android.support.design.widget.AppBarLayout android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_height="wrap_content" android:animateLayoutChanges="true" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/AppTheme.PopupOverlay"/> </android.support.design.widget.AppBarLayout> <include layout="@layout/press_plus_demo" /> </android.support.design.widget.CoordinatorLayout>
Tiada ulasan:
Catat Ulasan