Skip to content

Commit

Permalink
Merge pull request #14 from SimformSolutionsPvtLtd/develop
Browse files Browse the repository at this point in the history
🐞 #11 Bugfix
  • Loading branch information
shwetachauhan-simform authored Aug 5, 2021
2 parents 38cfa3c + ebea0ec commit bfd4710
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The best feature is Lottie animations in refresh view, it uses lottie animations

```groovy
dependencies {
implementation 'com.github.SimformSolutionsPvtLtd:SSPullToRefresh:1.2'
implementation 'com.github.SimformSolutionsPvtLtd:SSPullToRefresh:1.3'
}
```
2. Wrap your refreshing view ( RecyclerView, listView etc..) with SSPullToRefreshLayout
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/com/simform/demo/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class MainActivity : AppCompatActivity() {
override fun onRefresh() {
GlobalScope.launch {
delay(5000)
ssPullRefresh.setRefreshing(false)
runOnUiThread {
ssPullRefresh.setRefreshing(false)
}
MainScope().launch {
adapter.randomizeData()
Toast.makeText(this@MainActivity,"Refresh Complete",Toast.LENGTH_SHORT).show()
Expand All @@ -51,6 +53,9 @@ class MainActivity : AppCompatActivity() {
ssPullRefresh.setRepeatCount(SSPullToRefreshLayout.RepeatCount.INFINITE)
//set style of RefreshLayout : NORMAL, FLOAT, PINNED
ssPullRefresh.setRefreshStyle(SSPullToRefreshLayout.RefreshStyle.NORMAL)

ssPullRefresh.setRefreshInitialOffset(100f)
ssPullRefresh.setRefreshStyle(SSPullToRefreshLayout.RefreshStyle.FLOAT)
}

private fun setUpRecyclerView() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ class SSPullToRefreshLayout(context: Context?, attrs: AttributeSet? = null) :
mTargetOrRefreshViewOffsetY / mRefreshTargetOffset
)
}
if (mRefreshView.visibility != VISIBLE) {
if (mCurrentTouchOffsetY != 0f && mRefreshView.visibility != VISIBLE) {
mRefreshView.visibility = VISIBLE
}
invalidate()
Expand Down

0 comments on commit bfd4710

Please sign in to comment.