Merge pull request #670 from azisuazusa/664_pull_to_refresh
#664 pull to refresh feature
This commit is contained in:
commit
b3db967632
|
@ -92,6 +92,10 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||
refreshCalDAVCalendars(false)
|
||||
}
|
||||
|
||||
swipe_refresh_layout.setOnRefreshListener {
|
||||
refreshCalDAVCalendars(false)
|
||||
}
|
||||
|
||||
if (!checkViewIntents()) {
|
||||
return
|
||||
}
|
||||
|
@ -129,6 +133,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||
search_placeholder_2.setTextColor(config.textColor)
|
||||
calendar_fab.setColors(config.textColor, getAdjustedPrimaryColor(), config.backgroundColor)
|
||||
search_holder.background = ColorDrawable(config.backgroundColor)
|
||||
swipe_refresh_layout.isEnabled = config.caldavSync
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
|
@ -368,6 +373,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||
if (showCalDAVRefreshToast) {
|
||||
toast(R.string.refreshing_complete)
|
||||
}
|
||||
swipe_refresh_layout.isRefreshing = false
|
||||
}
|
||||
}, CALDAV_SYNC_DELAY)
|
||||
}
|
||||
|
|
|
@ -6,10 +6,17 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragments_holder"
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipe_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragments_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyFloatingActionButton
|
||||
android:id="@+id/calendar_fab"
|
||||
|
|
Loading…
Reference in New Issue