Skip to content

Commit 812fa2b

Browse files
nishchal-vyashwantgowla-simform
authored andcommitted
UNT-T15621: 📚 Update README.md
1 parent d729ad7 commit 812fa2b

File tree

5 files changed

+83
-15
lines changed

5 files changed

+83
-15
lines changed

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<a href="https://www.simform.com/"><img src="https://github.com/SimformSolutionsPvtLtd/SSToastMessage/blob/master/simformBanner.png"></a>
22
# SSPullToRefresh
33
## Pull to Refresh with custom animations
4-
[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)][git-repo-url] [![](https://jitpack.io/v/SimformSolutionsPvtLtd/SSPullToRefresh.svg)](https://jitpack.io/#SimformSolutionsPvtLtd/SSPullToRefresh) [![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.7.10-blue.svg)](https://kotlinlang.org) [![Platform](https://img.shields.io/badge/Platform-Android-green.svg?style=flat)](https://www.android.com/) [![API](https://img.shields.io/badge/API-17%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=17)
4+
[![](https://jitpack.io/v/SimformSolutionsPvtLtd/SSPullToRefresh.svg)](https://jitpack.io/#SimformSolutionsPvtLtd/SSPullToRefresh) [![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.7.10-blue.svg)](https://kotlinlang.org) [![Platform](https://img.shields.io/badge/Platform-Android-green.svg?style=flat)](https://www.android.com/) [![API](https://img.shields.io/badge/API-17%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=17)
55

66
SSPullToRefresh makes PullRefresh easy to use, you can provide your own custom animations or set simple gifs on refresh view.
77
The best feature is Lottie animations in refresh view, it uses lottie animations to render high quality animations on pull refresh.
88

99
## Features
1010

1111
- Simple and easy to use (no complex animations to deal with)
12-
- Customize the animation view by providing your own custom RefreshView (need to subclass SSAnimationView)
12+
- Customize the animation view by providing your own custom interactive RefreshViews (need to implement [RefreshCallbacks][RefreshCallbacksFile])
1313
- Set Gif animations in refresh view
1414
- Import lottie json in assets folder and apply animation (as simple as that)
1515
- Customize repeatMode, repeatCount and Interpolator on different points of animations
@@ -18,11 +18,15 @@ The best feature is Lottie animations in refresh view, it uses lottie animations
1818

1919
| Default refreshView | Gif animation | Wave animation (Custom class) |
2020
|--|--|--|
21-
| <a href="gifs/default.gif">![](gifs/default.gif)</a> | <a href="https://github.com/SimformSolutionsPvtLtd/SSPullToRefresh/blob/529aabcc07246c0d9220f9e93ad85d8509c130f0/sspulltorefresh/src/main/java/com/simform/refresh/SSPullToRefreshLayout.kt#L237">![](gifs/gif.gif)</a> | <a href="app/src/main/java/com/simform/demo/WaveAnimation.kt">![](gifs/wave.gif)</a> |
21+
| ![](gifs/default.gif) | <a href="sspulltorefresh/src/main/java/com/simform/refresh/SSPullToRefreshLayout.kt#L227">![](gifs/gif.gif)</a> | <a href="app/src/main/java/com/simform/demo/WaveAnimation.kt">![](gifs/wave.gif)</a> |
2222

2323
| Lottie animation 1 | Lottie animation 2 | Lottie animation 3 |
2424
|--|--|--|
25-
| <a href="https://github.com/SimformSolutionsPvtLtd/SSPullToRefresh/blob/529aabcc07246c0d9220f9e93ad85d8509c130f0/sspulltorefresh/src/main/java/com/simform/refresh/SSPullToRefreshLayout.kt#L228">![](gifs/plane.gif)</a> | <a href="https://github.com/SimformSolutionsPvtLtd/SSPullToRefresh/blob/529aabcc07246c0d9220f9e93ad85d8509c130f0/sspulltorefresh/src/main/java/com/simform/refresh/SSPullToRefreshLayout.kt#L228">![](gifs/clock.gif)</a> | <a href="https://github.com/SimformSolutionsPvtLtd/SSPullToRefresh/blob/529aabcc07246c0d9220f9e93ad85d8509c130f0/sspulltorefresh/src/main/java/com/simform/refresh/SSPullToRefreshLayout.kt#L228">![](gifs/virus.gif)</a> |
25+
| <a href="sspulltorefresh/src/main/java/com/simform/refresh/SSPullToRefreshLayout.kt#L218">![](gifs/plane.gif)</a> | <a href="sspulltorefresh/src/main/java/com/simform/refresh/SSPullToRefreshLayout.kt#L218">![](gifs/clock.gif)</a> | <a href="sspulltorefresh/src/main/java/com/simform/refresh/SSPullToRefreshLayout.kt#L218">![](gifs/virus.gif)</a> |
26+
27+
| Custom view with user interactions |
28+
|--|
29+
| <a href="app/src/main/java/com/simform/demo/CustomView.kt">![](gifs/userinteractive.gif)</a> |
2630

2731
# How it works:
2832

@@ -113,8 +117,8 @@ ssPullRefresh.setRefreshStyle(SSPullToRefreshLayout.RefreshStyle.NORMAL)
113117
```
114118
* To customize the whole refresh view you need to inherit SSAnimationView for your custom class and override the methods needed
115119

116-
Here is an example class
117-
[WaveAnimation][WaveAnimationFile].
120+
Here is an example class
121+
[WaveAnimation][WaveAnimationFile].
118122
* Provide your CustomView by setRefreshView() method
119123
```kotlin
120124
ssPullRefresh.setRefreshView(WaveAnimation(this))
@@ -187,12 +191,13 @@ SOFTWARE.
187191

188192
[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)
189193

190-
[git-repo-url]: <https://github.com/SimformSolutionsPvtLtd/SSPullToRefresh.git>
191-
[lottie-repo-url]: <https://github.com/airbnb/lottie-android.git>
192-
[stargazers]: <https://github.com/SimformSolutionsPvtLtd/SSPullToRefresh/stargazers>
193-
[Contributing Guide]: <https://github.com/SimformSolutionsPvtLtd/SSPullToRefresh/blob/main/CONTRIBUTING.md>
194-
[GitHub Issues]: <https://github.com/SimformSolutionsPvtLtd/SSPullToRefresh/issues>
195-
[RecyclerRefreshLayout]: <https://github.com/dinuscxj/RecyclerRefreshLayout?utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=3383>
196-
[gif-lib-repo]: <https://github.com/koral--/android-gif-drawable.git>
197-
[SSCustomPullToRefresh]: <https://github.com/SimformSolutionsPvtLtd/SSCustomPullToRefresh.git>
198-
[WaveAnimationFile]: app/src/main/java/com/simform/demo/WaveAnimation.kt
194+
[git-repo-url]: <https://github.com/SimformSolutionsPvtLtd/SSPullToRefresh.git>
195+
[lottie-repo-url]: <https://github.com/airbnb/lottie-android.git>
196+
[stargazers]: <https://github.com/SimformSolutionsPvtLtd/SSPullToRefresh/stargazers>
197+
[Contributing Guide]: <https://github.com/SimformSolutionsPvtLtd/SSPullToRefresh/blob/main/CONTRIBUTING.md>
198+
[GitHub Issues]: <https://github.com/SimformSolutionsPvtLtd/SSPullToRefresh/issues>
199+
[RecyclerRefreshLayout]: <https://github.com/dinuscxj/RecyclerRefreshLayout?utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=3383>
200+
[gif-lib-repo]: <https://github.com/koral--/android-gif-drawable.git>
201+
[SSCustomPullToRefresh]: <https://github.com/SimformSolutionsPvtLtd/SSCustomPullToRefresh.git>
202+
[WaveAnimationFile]: app/src/main/java/com/simform/demo/WaveAnimation.kt
203+
[RefreshCallbacksFile]: sspulltorefresh/src/main/java/com/simform/refresh/RefreshCallbacks.kt
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package com.simform.demo
2+
3+
import android.content.Context
4+
import android.util.AttributeSet
5+
import android.view.LayoutInflater
6+
import android.widget.FrameLayout
7+
import android.widget.Toast
8+
import com.example.pulltorefresh.databinding.LayoutBinding
9+
import com.simform.refresh.RefreshCallbacks
10+
11+
class CustomView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
12+
FrameLayout(context, attrs), RefreshCallbacks {
13+
14+
private var binding: LayoutBinding
15+
16+
init {
17+
val inflater = LayoutInflater.from(context)
18+
binding = LayoutBinding.inflate(inflater, this, true)
19+
binding.button.setOnClickListener {
20+
Toast.makeText(context, "Loading Action", Toast.LENGTH_SHORT).show()
21+
}
22+
}
23+
24+
override fun reset() {
25+
}
26+
27+
override fun refreshing() {
28+
}
29+
30+
override fun refreshComplete() {
31+
}
32+
33+
override fun pullToRefresh() {
34+
}
35+
36+
override fun releaseToRefresh() {
37+
}
38+
39+
override fun pullProgress(pullDistance: Float, pullProgress: Float) {
40+
}
41+
}

app/src/main/res/layout/layout.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto">
4+
5+
<androidx.constraintlayout.widget.ConstraintLayout
6+
android:layout_width="match_parent"
7+
android:layout_height="match_parent"
8+
android:background="@color/blue">
9+
10+
<Button
11+
android:id="@+id/button"
12+
android:layout_width="wrap_content"
13+
android:layout_height="wrap_content"
14+
android:text="@string/loading"
15+
app:layout_constraintBottom_toBottomOf="parent"
16+
app:layout_constraintEnd_toEndOf="parent"
17+
app:layout_constraintStart_toStartOf="parent"
18+
app:layout_constraintTop_toTopOf="parent" />
19+
</androidx.constraintlayout.widget.ConstraintLayout>
20+
21+
</layout>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<resources>
22
<string name="app_name">SSPullToRefresh</string>
33
<string name="hello">Hii</string>
4+
<string name="loading">Loading</string>
45
</resources>

gifs/userinteractive.gif

880 KB
Loading

0 commit comments

Comments
 (0)