Skip to content

Commit

Permalink
Merge pull request #14 from agrawalsuneet/dev
Browse files Browse the repository at this point in the history
Merge Dev to master for 0.7 release
  • Loading branch information
agrawalsuneet authored Dec 18, 2017
2 parents efbc38b + 2ad30f9 commit 17cef07
Show file tree
Hide file tree
Showing 27 changed files with 542 additions and 225 deletions.
Binary file added .idea/caches/build_file_checksums.ser
Binary file not shown.
83 changes: 65 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
### TashieLoader
![tashieloader](https://user-images.githubusercontent.com/12999622/32248048-500dffc4-be7c-11e7-93cf-5d57f3fa7f34.gif)

Other loaders: [FourFoldLoader](https://github.com/agrawalsuneet/FourFoldLoader), [ZipZapLoader](https://github.com/agrawalsuneet/FourFoldLoader), [ClockLoader](https://github.com/agrawalsuneet/LoadersPack)
### SlidingLoader
![slidingloader](https://user-images.githubusercontent.com/12999622/34130222-f58ba220-e43e-11e7-8f60-4971918fecde.gif)
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)

## How To use
include below dependency in build.gradle of application and compile it
Expand All @@ -29,7 +33,7 @@ compile 'com.agrawalsuneet.androidlibs:dotsloader:0.6'
### LinearDotsLoader
##### Through XML
```
<com.agrawalsuneet.dotsloader.ui.LinearDotsLoader
<com.agrawalsuneet.dotsloader.loaders.LinearDotsLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:loader_animDur="1000"
Expand Down Expand Up @@ -92,7 +96,7 @@ compile 'com.agrawalsuneet.androidlibs:dotsloader:0.6'
### CircularDotsLoader
##### Through XML
```
<com.agrawalsuneet.dotsloader.ui.CircularDotsLoader
<com.agrawalsuneet.dotsloader.loaders.CircularDotsLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:loader_animDur="100"
Expand Down Expand Up @@ -143,18 +147,20 @@ CircularDotsLoader loader = new CircularDotsLoader(this);
### LazyLoader
##### Through XML
```
<com.agrawalsuneet.dotsloader.ui.LazyLoader
<com.agrawalsuneet.dotsloader.loaders.LazyLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:layout_marginTop="30dp"
app:all_animDur="500"
app:all_dotsColor="@color/loader_selected"
app:all_dotsDist="10dp"
app:all_dotsRadius="16dp"
app:all_interpolator="@android:anim/accelerate_interpolator"
app:lazyloader_firstDelayDur="100"
app:lazyloader_secondDelayDur="200" />
app:lazyloader_animDur="800"
app:lazyloader_dotsDist="10dp"
app:lazyloader_dotsRadius="16dp"
app:lazyloader_firstDelayDur="150"
app:lazyloader_firstDotColor="@color/red"
app:lazyloader_interpolator="@android:anim/decelerate_interpolator"
app:lazyloader_secondDelayDur="300"
app:lazyloader_secondDotColor="@color/green"
app:lazyloader_thirdDotColor="@color/yellow" />
```

##### Through Code
Expand Down Expand Up @@ -189,16 +195,15 @@ CircularDotsLoader loader = new CircularDotsLoader(this);
### TashieLoader
##### Through XML
```
<com.agrawalsuneet.dotsloader.ui.TashieLoader
<com.agrawalsuneet.dotsloader.loaders.TashieLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:all_animDur="1000"
app:all_dotsColor="@color/purple_selected"
app:all_dotsDist="5dp"
app:all_dotsRadius="20dp"
app:all_interpolator="@android:anim/accelerate_interpolator"
app:tashieloader_animDelay="200"
app:tashieloader_animDur="1000"
app:tashieloader_dotsColor="@color/purple_selected"
app:tashieloader_dotsDist="5dp"
app:tashieloader_dotsRadius="20dp"
app:tashieloader_interpolator="@android:anim/accelerate_interpolator"
app:tashieloader_noOfDots="6" />
```

Expand Down Expand Up @@ -234,6 +239,48 @@ TashieLoader tashie = new TashieLoader(this);
containerLL.addView(tashie);
```

### SlidingLoader
##### Through XML
```
<com.agrawalsuneet.dotsloader.loaders.SlidingLoader
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:slidingloader_animDur="2000"
app:slidingloader_distanceToMove="12"
app:slidingloader_dotsDist="6dp"
app:slidingloader_dotsRadius="10dp"
app:slidingloader_firstDotColor="@color/colorPrimary"
app:slidingloader_secondDotColor="@color/colorAccent"
app:slidingloader_thirdDotColor="@color/colorPrimaryDark" />
```

##### Through Code

* Kotlin
```
var sliding = SlidingLoader(this, 40, 10,
ContextCompat.getColor(this, R.color.red),
ContextCompat.getColor(this, R.color.yellow),
ContextCompat.getColor(this, R.color.green)).apply {
animDuration = 1000
distanceToMove = 12
}
containerLL.addView(sliding)
```

* Java
```
SlidingLoader sliding = new SlidingLoader(this, 40, 10,
ContextCompat.getColor(this, R.color.red),
ContextCompat.getColor(this, R.color.yellow),
ContextCompat.getColor(this, R.color.green));
sliding.setAnimDuration(1000);
sliding.setDistanceToMove(12);
containerLL.addView(sliding);
```


Please take a 2 mins survey to make this library better [here](https://goo.gl/forms/81Cf63sL2X1WhXHl2).
Expand Down
27 changes: 13 additions & 14 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<option name="pluginClasspaths">
<array />
</option>
<option name="version" value="true" />
</compilerArguments>
</configuration>
</facet>
Expand Down Expand Up @@ -120,19 +119,19 @@
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-annotations-25.1.0" level="project" />
<orderEntry type="library" exported="" name="annotations-13.0" level="project" />
<orderEntry type="library" exported="" name="kotlin-stdlib-jre7-1.1.3-2" level="project" />
<orderEntry type="library" exported="" name="support-fragment-25.1.0" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-25.1.0" level="project" />
<orderEntry type="library" exported="" name="support-compat-25.1.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-25.1.0" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-25.1.0" level="project" />
<orderEntry type="library" exported="" name="support-media-compat-25.1.0" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-25.1.0" level="project" />
<orderEntry type="library" exported="" name="kotlin-stdlib-1.1.3-2" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-25.1.0" level="project" />
<orderEntry type="library" exported="" name="support-core-utils-25.1.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-core-utils-25.1.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:animated-vector-drawable-25.1.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:appcompat-v7-25.1.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-core-ui-25.1.0" level="project" />
<orderEntry type="library" exported="" name="org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3-2@jar" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-compat-25.1.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-media-compat-25.1.0" level="project" />
<orderEntry type="library" exported="" name="org.jetbrains:annotations:13.0@jar" level="project" />
<orderEntry type="library" exported="" name="org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2@jar" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-annotations:25.1.0@jar" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-vector-drawable-25.1.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-v4-25.1.0" level="project" />
<orderEntry type="library" exported="" name="com.android.support:support-fragment-25.1.0" level="project" />
<orderEntry type="module" module-name="dotsloader" exported="" />
</component>
</module>
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ apply plugin: 'kotlin-android'

repositories {
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}

android {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity"
android:label="SlidingLoader">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
65 changes: 24 additions & 41 deletions app/src/main/java/com/agrawalsuneet/loaders/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@ package com.agrawalsuneet.loaders
import android.os.Bundle
import android.support.v4.content.ContextCompat
import android.support.v7.app.AppCompatActivity
import android.view.Menu
import android.view.MenuItem
import android.view.animation.AccelerateInterpolator
import android.view.animation.DecelerateInterpolator
import android.view.animation.LinearInterpolator
import android.widget.LinearLayout
import com.agrawalsuneet.dotsloader.ui.CircularDotsLoader
import com.agrawalsuneet.dotsloader.ui.LazyLoader
import com.agrawalsuneet.dotsloader.ui.LinearDotsLoader
import com.agrawalsuneet.dotsloader.ui.TashieLoader
import com.agrawalsuneet.loaders.dialog.DotsLoaderDialog
import com.agrawalsuneet.dotsloader.loaders.*

class MainActivity : AppCompatActivity() {

lateinit var containerLL : LinearLayout
lateinit var containerLL: LinearLayout

private var colorSwitch = false

Expand All @@ -31,6 +25,20 @@ class MainActivity : AppCompatActivity() {
//initView()
//initLazyLoader()
initTashieLoader()

//initSlidongLoader()
}

private fun initSlidongLoader() {
var sliding = SlidingLoader(this, 20, 5,
ContextCompat.getColor(this, R.color.red),
ContextCompat.getColor(this, R.color.yellow),
ContextCompat.getColor(this, R.color.green)).apply {
animDuration = 1500
distanceToMove = 12
}

containerLL.addView(sliding)
}

private fun initTashieLoader() {
Expand All @@ -40,13 +48,18 @@ class MainActivity : AppCompatActivity() {
dotsDist = 10
dotsRadius = 30
animDuration = 500
animDelay = 100
dotsColor = resources.getColor(R.color.green)
interpolator = LinearInterpolator()
}
containerLL.addView(tashie)
}

private fun initLazyLoader() {
var lazyLoader = LazyLoader(this, 15, 5, ContextCompat.getColor(this, R.color.purple_selected))
var lazyLoader = LazyLoader(this, 15, 5,
ContextCompat.getColor(this, R.color.loader_selected),
ContextCompat.getColor(this, R.color.loader_selected),
ContextCompat.getColor(this, R.color.loader_selected))
.apply {
animDuration = 500
firstDelayDuration = 100
Expand Down Expand Up @@ -83,7 +96,7 @@ class MainActivity : AppCompatActivity() {


var cirLoader = CircularDotsLoader(this@MainActivity)
cirLoader.setPadding(20,20,20,20)
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
Expand All @@ -95,34 +108,4 @@ class MainActivity : AppCompatActivity() {

containerLL.addView(cirLoader)
}

override fun onCreateOptionsMenu(menu: Menu): Boolean {
val inflater = menuInflater
inflater.inflate(R.menu.main_menu, menu)
return true
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.show_dialog -> {
/*if (colorSwitch) {
loader.firstShadowColor = ContextCompat.getColor(this, R.color.pink_selected)
loader.secondShadowColor = ContextCompat.getColor(this, R.color.pink_default)
} else {
loader.firstShadowColor = ContextCompat.getColor(this, R.color.purple_selected)
loader.secondShadowColor = ContextCompat.getColor(this, R.color.purple_default)
}
colorSwitch = !colorSwitch*/
showAlertDialog();
return true
}
else -> return super.onOptionsItemSelected(item)
}
}

private fun showAlertDialog() {
val dotsDialog = DotsLoaderDialog()
//dotsDialog.setCancelable(false);
dotsDialog.show(supportFragmentManager, "dotsDialog")
}
}
32 changes: 29 additions & 3 deletions app/src/main/java/com/agrawalsuneet/loaders/MainActivityJava.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,53 @@
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.animation.LinearInterpolator;
import android.widget.LinearLayout;

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

/**
* Created by suneet on 9/22/17.
*/

public class MainActivityJava extends AppCompatActivity{
public class MainActivityJava extends AppCompatActivity {

LinearLayout containerLL;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

LazyLoader loader = new LazyLoader(this);
loader.setDotsColor(ContextCompat.getColor(this,R.color.blue_selected));
loader.setDotsColor(ContextCompat.getColor(this, R.color.blue_selected));
loader.setDotsDist(20);
loader.setDotsRadius(30);
loader.setAnimDuration(500);
loader.setFirstDelayDuration(100);
loader.setSecondDelayDuration(200);
loader.setInterpolator(new LinearInterpolator());


TashieLoader tashie = new TashieLoader(this);
tashie.setNoOfDots(8);
tashie.setDotsRadius(20);
tashie.setDotsDist(10);
tashie.setDotsColor(ContextCompat.getColor(this, R.color.blue_selected));
tashie.setAnimDuration(500);
tashie.setAnimDelay(100);
tashie.setInterpolator(new LinearInterpolator());

containerLL.addView(tashie);

SlidingLoader sliding = new SlidingLoader(this, 40, 10,
ContextCompat.getColor(this, R.color.red),
ContextCompat.getColor(this, R.color.yellow),
ContextCompat.getColor(this, R.color.green));
sliding.setAnimDuration(1000);
sliding.setDistanceToMove(12);

containerLL.addView(sliding);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView

import com.agrawalsuneet.dotsloader.ui.LinearDotsLoader
import com.agrawalsuneet.dotsloader.loaders.LinearDotsLoader
import com.agrawalsuneet.loaders.R

/**
Expand Down
Loading

0 comments on commit 17cef07

Please sign in to comment.