Custom loading view based on dribbble shot
Originally based on this Dribbble shot.
Add jitpack repo in your project.gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add implementation in your app.gradle
dependencies {
implementation 'com.github.muramrr:LoadingView:1.2'
}
<com.mmdev.loadingviewlib.LoadingView
android:id="@+id/loadingView"
android:layout_height="100dp"
android:layout_width="100dp"
app:loadStrokeColor="@android:color/white"
app:loadStrokeWidth="6dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
By default animation is running automatically
You can pause and resume animation in your activity/fragment:
loadingView.setOnClickListener {
loadingView.toggleAnimation()
}
Copyright (c) 2020 Andrii Kovalchuk