How to create a horizontal scroll view that moves automatically and cyclically

0

I'm trying to do a% horizontal% co_of which is going to take several images, what I'm trying to do is that the scrollview moves automatically and that when it reaches the end it automatically starts again from the first image something so

link , for now I have no more code than a scroll horizontal with some scrollvew , I would appreciate help me solve this problem.

Code imagebuttons

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:orientation="horizontal">

        <ImageButton
            android:id="@+id/imageButton12"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:srcCompat="@mipmap/ic_launcher" />

        <ImageButton
            android:id="@+id/imageButton11"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:srcCompat="@drawable/ic_transporte" />

        <ImageButton
            android:id="@+id/imageButton10"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:srcCompat="@drawable/ic_industria" />

        <ImageButton
            android:id="@+id/imageButton9"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:srcCompat="@drawable/ic_hoteles" />

        <ImageButton
            android:id="@+id/imageButton8"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:srcCompat="@drawable/ic_contactanos" />

        <ImageButton
            android:id="@+id/imageButton7"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:srcCompat="@drawable/ic_compartir" />

        <ImageButton
            android:id="@+id/imageButton6"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:srcCompat="@drawable/ic_bar_coffe" />
    </LinearLayout>
</HorizontalScrollView>
    
asked by Alvaro Fabian M 20.06.2017 в 05:57
source

2 answers

0

In the end, solve it using this library

link

    
answered by 20.01.2018 / 15:53
source
0

There is the HorizontalScrollView method and you place all your files in it.

<HorizontalScrollView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    // Aqui colocas tus objetos o elementos en un layout Horizontal

</HorizontalScrollView>
    
answered by 24.06.2017 в 19:48