본문으로 건너뛰기

spinkit-loading-animation

loadingAnimation (SpinKit) in Android Studio

이 글은 기존 블로그의 원문에서 가져왔습니다. 원문 작성일: 2021-08-23

SpinKit 참고 영상 (YouTube)

Android-SpinKit 애니메이션 라이브러리

위와 같이 사람들이 만들어놓은 라이브러리 등을 github에서 찾아서 사용하면 편하게 더 퀄리티 높은 앱을 만들 수 있다.

밑 링크에서 license에 관한 더 자세한 정보를 얻을 수 있다.

라이선스 분류


1. build.gradle (:app)

            ...
dependencies {
            ...
    implementation 'com.github.ybq:Android-SpinKit:1.4.0'
}

위와 같이 라이브러리를 추가해준다.


2. activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            ...
    android:background="#673AB7"
    android:gravity="center">
    <com.github.ybq.android.spinkit.SpinKitView
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/spin_kit_1"
        style="@style/SpinKitView.Large.FoldingCube"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:SpinKit_Color="#00BCD4" />
</LinearLayout>

6~12 - 위와 같은 형태로 로딩 애니메이션을 넣을 수 있다.

원하는 종류에 따라서 아래와 같이 style 속성을 설정해주면 된다.

@style/SpinKitView

@style/SpinKitView.Circle

@style/SpinKitView.Large

@style/SpinKitView.Small

@style/SpinKitView.Small.DoubleBounce