Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 51 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,70 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 22
buildToolsVersion '25.0.0'
compileSdkVersion 30
buildToolsVersion "29.0.3"

defaultConfig {
applicationId "com.github.jlmd.animatedcircleloadingview.sample"
minSdkVersion 15
targetSdkVersion 22
targetSdkVersion 30
versionCode 1
versionName "1.0"
}

buildTypes {
release {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}


packagingOptions {
exclude 'META-INF/atomicfu.kotlin_module'
}


// You can change the value to override the default behavior.
buildFeatures {
// Determines whether to support View Binding.
// Note that the viewBinding.enabled property is now deprecated.
viewBinding = true
// Determines whether to support Data Binding.
// Note that the dataBinding.enabled property is now deprecated.
dataBinding = true


}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile project(':library')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
def archLifecycleVersion = '2.2.0'
// Lifecycle components
implementation "androidx.lifecycle:lifecycle-extensions:$archLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$archLifecycleVersion"


implementation project(':library')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"


}
repositories {
mavenCentral()
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.github.jlmd.animatedcircleloadingview.sample

import android.app.Activity
import android.os.Bundle
import com.github.jlmd.animatedcircleloadingview.AnimatedCircleLoadingView
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.coroutines.*

class MainActivity : Activity() {
private var animatedCircleLoadingView: AnimatedCircleLoadingView? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
animatedCircleLoadingView = circle_loading_view
startLoading()
startPercentMockThread()

}

private fun startLoading() {
animatedCircleLoadingView!!.startDeterminate()
}

private fun startPercentMockThread() {
CoroutineScope(Dispatchers.IO).launch {
delay(1000)
for (i in 0..100) {
delay(100)
withContext(Dispatchers.Main) {
changePercent(i)
}
}
}
}

private fun changePercent(percent: Int) {
animatedCircleLoadingView!!.setPercent(percent)
}

fun resetLoading() {
animatedCircleLoadingView!!.resetLoading()
}
}
30 changes: 17 additions & 13 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background">

<com.github.jlmd.animatedcircleloadingview.AnimatedCircleLoadingView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/circle_loading_view"
android:layout_width="250dp"
android:layout_height="250dp"
android:background="@color/background"
android:layout_centerInParent="true"
app:animCircleLoadingView_mainColor="@color/main_color"
app:animCircleLoadingView_secondaryColor="@color/secondary_color"
app:animCircleLoadingView_textColor="@android:color/white"
/>
<com.github.jlmd.animatedcircleloadingview.AnimatedCircleLoadingView
android:id="@+id/circle_loading_view"
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_centerInParent="true"
android:background="@color/background"
app:animCircleLoadingView_mainColor="@color/main_color"
app:animCircleLoadingView_secondaryColor="@color/secondary_color"
app:animCircleLoadingView_textColor="@android:color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
11 changes: 8 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
ext.kotlin_version = '1.4.10'
ext.gradle_version = '3.0.1'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
// NOTE: Do not place your application dependencies here; they belong
classpath 'com.android.tools.build:gradle:4.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
google()
}
}
17 changes: 10 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

org.gradle.jvmargs=-Xmx2048m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Jul 08 22:01:22 CEST 2017
#Fri Oct 02 08:50:45 IST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
16 changes: 11 additions & 5 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 22
buildToolsVersion '25.0.0'
compileSdkVersion 30
buildToolsVersion "29.0.3"

defaultConfig {
minSdkVersion 14
targetSdkVersion 22
targetSdkVersion 30
versionCode 116
versionName "1.1.6"
}
Expand All @@ -19,6 +20,11 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation "androidx.core:core-ktx:1.3.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()
}
Loading