J'essaie de cacher mon ActionBar/barre d'outils verticale à l'aide Swipe ViewPager, ceci est mon MainActivity
XML:cacher actionbar sur Swipe verticale viewPager
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="InconsistentLayout">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<include
android:id="@+id/toolbar"
layout="@layout/view_toolbar" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/view_home" />
</android.support.design.widget.CoordinatorLayout>
<include layout="@layout/view_left_drawer" />
</android.support.v4.widget.DrawerLayout>
J'ai ajouté à ma barre d'outils: app:layout_scrollFlags="scroll|enterAlways"
Je n'ai que la page vierge dans mon Fragment, le ViewPager
pas visible:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:isScrollContainer="false"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"
android:background="@color/greeen_theme"
android:clipToPadding="false"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/light_theme_color_read"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/refreshListBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/bg_refresh_list_button_selector"
android:textColor="@android:color/white"
android:visibility="visible"/>
<com.axample.android.view.SwipeRefreshLayout
android:id="@+id/swiperefresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.axample.android.adapter.vertical.VerticalViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/pager_padd_botom"
android:clipToPadding="false"/>
</com.axample.android.view.SwipeRefreshLayout>
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
vidéo: https://www.youtube.com/watch?v=sWknAZFs6RA
S'il vous plaît, aidez !!
Mise à jour: mon view_left_drawer.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@color/black_main"
tools:showIn="@layout/activity_home">
<include layout="@layout/view_drawer_content"/>
</FrameLayout>
mon SwipeRefreshLayout
: https://github.com/FredJul/Flym/blob/master/Flym/src/main/java/net/fred/feedex/view/SwipeRefreshLayout.java
ajouter cette barre d'outils pour l'application: layout_scrollFlags = "scroll | enterAlways" – MinnuKaAnae
Merci, maintenant après que je défiler la actionbar cache, mais toujours écran vide, je vais ajouter mon code fragment. –
Une fois enlever android: visibility = "gone" du bouton et vérifier ou ajouter une couleur de fond pour vérifier si cela fonctionne ou non – MinnuKaAnae