Skip to content

muramrr/LoadingView

Repository files navigation

LoadingView GitHub license

Custom loading view based on dribbble shot

sample

Originally based on this Dribbble shot.

Design on Dribbble

Installation

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'
}

Usage

<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()
}

License

GitHub license

Copyright (c) 2020 Andrii Kovalchuk