Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PageIndicatorView only work outside viewpager #121

Open
mm580486 opened this issue Sep 1, 2019 · 4 comments
Open

PageIndicatorView only work outside viewpager #121

mm580486 opened this issue Sep 1, 2019 · 4 comments

Comments

@mm580486
Copy link

mm580486 commented Sep 1, 2019

hi
i have some problem with com.rd.PageIndicatorView tag i used this tag inside viewpager but i cant see result (dont show in build or design mode) but when i move PageIndicatorView to outside of viewpager works fine

dont show


<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.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"
        xmlns:attrs="http://schemas.android.com/apk/res-auto"

        tools:context=".HomeActivity">

    <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appBarLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#03FFFFFF"
            android:theme="@style/AppTheme.AppBarOverlay">


        <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent">


            <androidx.viewpager.widget.ViewPager
                    android:id="@+id/viewpager"
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:clickable="true"
                    android:visibility="visible"
                    tools:visibility="visible"
                    android:focusable="true">

                <com.rd.PageIndicatorView
                        android:id="@+id/pageIndicatorView"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerInParent="true"
                        android:visibility="visible"
                        app:piv_animationType="scale"
                        app:piv_dynamicCount="true"
                        app:piv_interactiveAnimation="true"
                        app:piv_selectedColor="@color/colorPrimary"
                        app:piv_unselectedColor="@color/colorPrimary"
                        app:piv_viewPager="@+id/viewpager"
                        attrs:piv_padding="12dp"
                        attrs:piv_radius="8dp"
                        tools:visibility="visible" />

            </androidx.viewpager.widget.ViewPager>

            <androidx.appcompat.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    android:layout_gravity="top"
                    android:background="@android:color/transparent"
                    app:popupTheme="@style/AppTheme.PopupOverlay" />

        </FrameLayout>
    </com.google.android.material.appbar.AppBarLayout>

    <include
            android:id="@+id/include"
            layout="@layout/content_home"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    <include
            layout="@layout/btm_nav"
            app:layout_anchor="@+id/include"
            app:layout_anchorGravity="center" />
    
</androidx.coordinatorlayout.widget.CoordinatorLayout>

show

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.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"
        xmlns:attrs="http://schemas.android.com/apk/res-auto"

        tools:context=".HomeActivity">

    <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appBarLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#03FFFFFF"
            android:theme="@style/AppTheme.AppBarOverlay">


        <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent">


            <androidx.viewpager.widget.ViewPager
                    android:id="@+id/viewpager"
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:clickable="true"
                    android:visibility="visible"
                    tools:visibility="visible"
                    android:focusable="true">



            </androidx.viewpager.widget.ViewPager>

            <androidx.appcompat.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    android:layout_gravity="top"
                    android:background="@android:color/transparent"
                    app:popupTheme="@style/AppTheme.PopupOverlay" />

        </FrameLayout>

        <com.rd.PageIndicatorView
                android:id="@+id/pageIndicatorView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:visibility="visible"
                app:piv_animationType="scale"
                app:piv_dynamicCount="true"
                app:piv_interactiveAnimation="true"
                app:piv_selectedColor="@color/colorPrimary"
                app:piv_unselectedColor="@color/colorPrimary"
                app:piv_viewPager="@+id/viewpager"
                attrs:piv_padding="12dp"
                attrs:piv_radius="8dp"
                tools:visibility="visible" />
    </com.google.android.material.appbar.AppBarLayout>

    <include
            android:id="@+id/include"
            layout="@layout/content_home"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    <include
            layout="@layout/btm_nav"
            app:layout_anchor="@+id/include"
            app:layout_anchorGravity="center" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
@romandanylyk
Copy link
Owner

romandanylyk commented Sep 1, 2019 via email

@mm580486
Copy link
Author

mm580486 commented Sep 1, 2019

sorry , can you sho me an example , i cant find layout attr in PageIndicatorView tag

@romandanylyk
Copy link
Owner

app:piv_viewPager="@id/viewPager"

@mm580486
Copy link
Author

mm580486 commented Sep 1, 2019

i do it please watch my code in first comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants