ybq / Android-SpinKit

Android loading animations
https://ybq.github.io/Android-SpinKit
MIT License
8.6k stars 1.31k forks source link

spinkit does not stop animation #69

Open aurelianr opened 4 years ago

aurelianr commented 4 years ago

Hello

I am using the following code:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:context=".MainActivity" tools:showIn="@layout/activity_main">

    <com.github.ybq.android.spinkit.SpinKitView
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/spin_kit"
        style="@style/SpinKitView.Wave"
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:layout_gravity="center"
        android:indeterminate="false"
        android:indeterminateOnly="true"
        android:visibility="visible"
        android:background="@color/cardview_dark_background"
        app:SpinKit_Color="@color/colorAccent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"/>
    <!--<ProgressBar-->
        <!--xmlns:app="http://schemas.android.com/apk/res-auto"-->
        <!--android:id="@+id/spin_kit"-->
        <!--style="@style/SpinKitView.Wave"-->
        <!--android:layout_width="100dp"-->
        <!--android:layout_height="40dp"-->
        <!--android:layout_gravity="center"-->
        <!--android:indeterminate="false"-->
        <!--android:indeterminateOnly="true"-->
        <!--android:visibility="visible"-->
        <!--android:background="@color/cardview_dark_background"-->
        <!--app:SpinKit_Color="@color/colorAccent"-->
        <!--app:layout_constraintTop_toTopOf="parent"-->
        <!--app:layout_constraintBottom_toBottomOf="parent"-->
        <!--app:layout_constraintRight_toRightOf="parent"-->
        <!--app:layout_constraintLeft_toLeftOf="parent"/>-->

</androidx.constraintlayout.widget.ConstraintLayout>

I have a spin kit with wave animation but is animating forever. I need to stop and to block in the initial position after a while.

Best regards, Aurelian

rahulkushwaha482 commented 4 years ago

Hi @aurelianr I thing this is not possible in this .This is fixed forever. I also tryied but can't stop as your requiremenet.

aurelianr commented 4 years ago

Hi @rahulkushwaha482 I made a workaround using a CustomView on which I draw five rectangles in a similar position like those from the spinkit