Skip to content

Commit

Permalink
Merge pull request #16 from agrawalsuneet/dev
Browse files Browse the repository at this point in the history
Merge Dev to master for 0.8 release
  • Loading branch information
agrawalsuneet authored Dec 29, 2017
2 parents bf329a8 + 3e57441 commit e5d42d0
Show file tree
Hide file tree
Showing 19 changed files with 401 additions and 237 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@

please check a better quality demo [here](https://www.youtube.com/watch?v=24xl6td1LBg)

Other loaders: [FourFoldLoader](https://github.com/agrawalsuneet/FourFoldLoader), [ZipZapLoader](https://github.com/agrawalsuneet/FourFoldLoader), [ClockLoader](https://github.com/agrawalsuneet/LoadersPack), [RippleLoader](https://github.com/agrawalsuneet/LoadersPack), [SVGLoader](https://github.com/agrawalsuneet/SVGLoadersPack-Android)
### RotatingCircularDotsLoader


please check a better quality demo [here]()

Other loaders: [SVGLoader](https://github.com/agrawalsuneet/SVGLoadersPack-Android), [ClockLoader](https://github.com/agrawalsuneet/LoadersPack), [RippleLoader](https://github.com/agrawalsuneet/LoadersPack), [FourFoldLoader](https://github.com/agrawalsuneet/FourFoldLoader), [ZipZapLoader](https://github.com/agrawalsuneet/FourFoldLoader), [WaveLoader](https://github.com/agrawalsuneet/FourFoldLoader)

## How To use
include below dependency in build.gradle of application and compile it
```
compile 'com.agrawalsuneet.androidlibs:dotsloader:0.7'
compile 'com.agrawalsuneet.androidlibs:dotsloader:0.8'
```

### LinearDotsLoader
Expand Down Expand Up @@ -285,6 +290,40 @@ SlidingLoader sliding = new SlidingLoader(this, 40, 10,
containerLL.addView(sliding);
```

### RotatingCircularDotsLoader
##### Through XML
```
<com.agrawalsuneet.dotsloader.loaders.RotatingCircularDotsLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:rotatingcircular_animDur="3000"
app:rotatingcircular_bigCircleRadius="42dp"
app:rotatingcircular_dotsColor="@color/blue_selected"
app:rotatingcircular_dotsRadius="14dp" />
```

##### Through Code

* Kotlin
```
val loader = RotatingCircularDotsLoader(this,
20, 60, ContextCompat.getColor(this, R.color.red))
.apply {
animDuration = 3000
}
containerLL.addView(loader)
```

* Java
```
RotatingCircularDotsLoader loader = new RotatingCircularDotsLoader(this,
20, 60, ContextCompat.getColor(this, R.color.red));
loader.setAnimDuration(3000);
containerLL.addView(loader);
```

Please take a 2 mins survey to make this library better [here](https://goo.gl/forms/81Cf63sL2X1WhXHl2).
It won't take more than 2 mins I promise :) or feel free to drop an email at agrawalsuneet@gmail.com if face any issue or require any additional functionality in it.
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:label="SlidingLoader">
<activity
android:name=".MainActivity"
android:label="RotatingCircularDotsLoader">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
55 changes: 33 additions & 22 deletions app/src/main/java/com/agrawalsuneet/loaders/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,29 @@ class MainActivity : AppCompatActivity() {

lateinit var containerLL: LinearLayout

private var colorSwitch = false

lateinit var loader: LinearDotsLoader

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
setContentView(R.layout.activity_main_3)

containerLL = findViewById(R.id.container) as LinearLayout

//initView()
//initLinearDotsLoader()
//initCircularDotsLoader()
//initLazyLoader()
initTashieLoader()

//initTashieLoader()
//initSlidongLoader()
//initRotatingCircularDotsLoader()
}


private fun initRotatingCircularDotsLoader() {
val loader = RotatingCircularDotsLoader(this,
20, 60, ContextCompat.getColor(this, R.color.red))
.apply {
animDuration = 10000
}

containerLL.addView(loader)
}

private fun initSlidongLoader() {
Expand Down Expand Up @@ -78,8 +86,23 @@ class MainActivity : AppCompatActivity() {
containerLL.addView(lazyLoader)
}

private fun initView() {
loader = LinearDotsLoader(this)
private fun initCircularDotsLoader() {
var cirLoader = CircularDotsLoader(this@MainActivity)
cirLoader.setPadding(20, 20, 20, 20)
cirLoader.defaultColor = ContextCompat.getColor(this, R.color.blue_delfault)
cirLoader.selectedColor = ContextCompat.getColor(this, R.color.blue_selected)
cirLoader.bigCircleRadius = 116
cirLoader.radius = 40
cirLoader.animDur = 100
cirLoader.firstShadowColor = ContextCompat.getColor(this, R.color.pink_selected)
cirLoader.secondShadowColor = ContextCompat.getColor(this, R.color.purple_selected)
cirLoader.showRunningShadow = true

containerLL.addView(cirLoader)
}

private fun initLinearDotsLoader() {
val loader = LinearDotsLoader(this)
loader.defaultColor = ContextCompat.getColor(this, R.color.loader_defalut)
loader.selectedColor = ContextCompat.getColor(this, R.color.loader_selected)
loader.isSingleDir = false
Expand All @@ -95,17 +118,5 @@ class MainActivity : AppCompatActivity() {
containerLL.addView(loader)


var cirLoader = CircularDotsLoader(this@MainActivity)
cirLoader.setPadding(20, 20, 20, 20)
cirLoader.defaultColor = ContextCompat.getColor(this, R.color.blue_delfault)
cirLoader.selectedColor = ContextCompat.getColor(this, R.color.blue_selected)
cirLoader.bigCircleRadius = 116
cirLoader.radius = 40
cirLoader.animDur = 100
//cirLoader.firstShadowColor = ContextCompat.getColor(this, R.color.pink_selected)
//cirLoader.secondShadowColor = ContextCompat.getColor(this, R.color.purple_selected)
//cirLoader.showRunningShadow = false

containerLL.addView(cirLoader)
}
}
14 changes: 11 additions & 3 deletions app/src/main/java/com/agrawalsuneet/loaders/MainActivityJava.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import android.view.animation.LinearInterpolator;
import android.widget.LinearLayout;

import com.agrawalsuneet.dotsloader.loaders.LazyLoader;
import com.agrawalsuneet.dotsloader.loaders.RotatingCircularDotsLoader;
import com.agrawalsuneet.dotsloader.loaders.SlidingLoader;
import com.agrawalsuneet.dotsloader.loaders.TashieLoader;

Expand All @@ -23,13 +23,13 @@ public class MainActivityJava extends AppCompatActivity {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

LazyLoader loader = new LazyLoader(this, 30, 20, ContextCompat.getColor(this, R.color.loader_selected),
/*LazyLoader loader = new LazyLoader(this, 30, 20, ContextCompat.getColor(this, R.color.loader_selected),
ContextCompat.getColor(this, R.color.loader_selected),
ContextCompat.getColor(this, R.color.loader_selected));
loader.setAnimDuration(500);
loader.setFirstDelayDuration(100);
loader.setSecondDelayDuration(200);
loader.setInterpolator(new LinearInterpolator());
loader.setInterpolator(new LinearInterpolator());*/


TashieLoader tashie = new TashieLoader(this);
Expand All @@ -43,6 +43,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

containerLL.addView(tashie);

//sliding loader
SlidingLoader sliding = new SlidingLoader(this, 40, 10,
ContextCompat.getColor(this, R.color.red),
ContextCompat.getColor(this, R.color.yellow),
Expand All @@ -51,5 +52,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
sliding.setDistanceToMove(12);

containerLL.addView(sliding);

//RotatingCircularDotsLoader
RotatingCircularDotsLoader loader = new RotatingCircularDotsLoader(this,
20, 60, ContextCompat.getColor(this, R.color.red));
loader.setAnimDuration(3000);

containerLL.addView(loader);
}
}

This file was deleted.

29 changes: 12 additions & 17 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@
android:background="@color/grey_cool"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.agrawalsuneet.loaders.MainActivity">

<com.agrawalsuneet.dotsloader.loaders.TashieLoader
<!--<com.agrawalsuneet.dotsloader.loaders.TashieLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
Expand All @@ -36,7 +32,7 @@
app:tashieloader_dotsDist="5dp"
app:tashieloader_dotsRadius="20dp"
app:tashieloader_interpolator="@android:anim/accelerate_interpolator"
app:tashieloader_noOfDots="6" />
app:tashieloader_noOfDots="6" />-->


<!--<com.agrawalsuneet.dotsloader.loaders.LazyLoader
Expand Down Expand Up @@ -95,7 +91,6 @@
app:loader_selectedColor="@color/pink_selected"
app:loader_selectedRadius="20dp" />-->


<!--<com.agrawalsuneet.dotsloader.loaders.LinearDotsLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -107,7 +102,6 @@
app:loader_isSingleDir="true"
app:loader_selectedColor="@color/blue_selected" />-->


<!--<com.agrawalsuneet.dotsloader.loaders.LinearDotsLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -132,14 +126,15 @@
app:loader_selectedColor="@color/purple_selected"
app:loader_showRunningShadow="true" />-->

<!-- <com.agrawalsuneet.dotsloader.loaders.CircularDotsLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:loader_animDur="1000"
app:loader_bigCircleRadius="42dp"
app:loader_circleRadius="14dp"
app:loader_defaultColor="@color/blue_delfault"
app:loader_selectedColor="@color/blue_selected"
app:loader_showRunningShadow="true" />-->
<com.agrawalsuneet.dotsloader.loaders.CircularDotsLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:loader_animDur="1000"
app:loader_bigCircleRadius="42dp"
app:loader_circleRadius="14dp"
app:loader_defaultColor="@color/blue_delfault"
app:loader_selectedColor="@color/blue_selected"
app:loader_showRunningShadow="true" />

</LinearLayout>
4 changes: 0 additions & 4 deletions app/src/main/res/layout/activity_main_2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
android:background="@color/grey_cool"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.agrawalsuneet.loaders.MainActivity">

<com.agrawalsuneet.dotsloader.loaders.SlidingLoader
Expand Down
60 changes: 60 additions & 0 deletions app/src/main/res/layout/activity_main_3.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="@color/grey_cool"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:layout_margin="16dp">

<com.agrawalsuneet.dotsloader.loaders.RotatingCircularDotsLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:rotatingcircular_animDur="5000"
app:rotatingcircular_bigCircleRadius="15dp"
app:rotatingcircular_dotsColor="@color/red"
app:rotatingcircular_dotsRadius="5dp" />

<com.agrawalsuneet.dotsloader.loaders.RotatingCircularDotsLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:rotatingcircular_animDur="5000"
app:rotatingcircular_bigCircleRadius="15dp"
app:rotatingcircular_dotsColor="@color/yellow"
app:rotatingcircular_dotsRadius="5dp" />

<com.agrawalsuneet.dotsloader.loaders.RotatingCircularDotsLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:rotatingcircular_animDur="5000"
app:rotatingcircular_bigCircleRadius="15dp"
app:rotatingcircular_dotsColor="@color/green"
app:rotatingcircular_dotsRadius="5dp" />

</LinearLayout>

<com.agrawalsuneet.dotsloader.loaders.RotatingCircularDotsLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:rotatingcircular_animDur="3000"
app:rotatingcircular_bigCircleRadius="42dp"
app:rotatingcircular_dotsColor="@color/blue_selected"
app:rotatingcircular_dotsRadius="14dp" />

<com.agrawalsuneet.dotsloader.loaders.RotatingCircularDotsLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:rotatingcircular_animDur="4000" />


</LinearLayout>
Loading

0 comments on commit e5d42d0

Please sign in to comment.