swiperefreshlayout

How to set SwipeRefreshLayout refreshing property using android data binding?

橙三吉。 提交于 2019-11-30 04:42:41
I am using android data binding library. If I want to make a view visible I can write something like this: <TextView android:id="@+id/label_status" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:text="@{habitListViewModel.message}" app:visibility="@{habitListViewModel.hasError ? View.VISIBLE : View.GONE}" /> Is there an option to bind to a refresh property of swipeRefreshLayout in a similar (xml) way? Currently I am setting it in code by calling setRefreshing(true/false) but would love to make it in xml to be consistent. UPDATED: As

SwipeRefreshLayout no animation on fragment creation

↘锁芯ラ 提交于 2019-11-30 04:23:14
问题 I'm using android.support.v4.widget.SwipeRefreshLayout with android.support.v7.widget.RecyclerView . On fragment view creation I need to show SwipeRefreshLayout animation. But when I call setRefreshing(true) nothing happens. But when I refresh data animation changes. I suppose that the animation isn't showing without child inside SwipeRefreshLayout . How to show this animation in the best way? 回答1: This is a reported bug (reported here) and a workaround is available: mSwipeRefreshLayout

How to use the SwipeRefreshLayout?

て烟熏妆下的殇ゞ 提交于 2019-11-30 01:53:42
Background Google has recently published an update to its support library , which now has a new " SwipeRefreshLayout " view. The view allows to wrap another view, while supporting swiping down in order to perform a refresh operation. screenshot: The problem Google hasn't provided a sample (at least not one that I can find, yet), so I've tried using it myself. At first I got a crash (NPE) whenever I swiped, but then I've found out that's because I didn't provide a "OnRefreshListener" for it. But I still don't get how to use it, let alone customize it Here's the XML of the layout file: <android

Android support v4 SwipeRefreshLayout empty view issue

眉间皱痕 提交于 2019-11-29 16:56:07
问题 SwipeRefresh is not working after setting an empty view for listview which is the only child of a SwipeRefresh layout. How to solve this issue? 回答1: Here is the solution: You can simply use this view hierarchy : <FrameLayout ...> <android.support.v4.widget.SwipeRefreshLayout ...> <ListView android:id="@android:id/list" ... /> </android.support.v4.widget.SwipeRefreshLayout> <TextView android:id="@android:id/empty" ... android:text="@string/empty_list"/> </FrameLayout> Then, in code, you just

How to set SwipeRefreshLayout refreshing property using android data binding?

删除回忆录丶 提交于 2019-11-29 01:53:24
问题 I am using android data binding library. If I want to make a view visible I can write something like this: <TextView android:id="@+id/label_status" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:text="@{habitListViewModel.message}" app:visibility="@{habitListViewModel.hasError ? View.VISIBLE : View.GONE}" /> Is there an option to bind to a refresh property of swipeRefreshLayout in a similar (xml) way? Currently I am setting it in code

How to use the SwipeRefreshLayout?

爷,独闯天下 提交于 2019-11-28 22:45:40
问题 Background Google has recently published an update to its support library, which now has a new "SwipeRefreshLayout" view. The view allows to wrap another view, while supporting swiping down in order to perform a refresh operation. screenshot: The problem Google hasn't provided a sample (at least not one that I can find, yet), so I've tried using it myself. At first I got a crash (NPE) whenever I swiped, but then I've found out that's because I didn't provide a "OnRefreshListener" for it. But

SwipeRefreshLayout: Swipe progress animation

大兔子大兔子 提交于 2019-11-28 20:44:52
I'm quite new to android and I'm exploring the sample code on google website. The code I'm on currently is the SwipeRefreshLayout: http://developer.android.com/samples/SwipeRefreshLayoutBasic/index.html In the code, we see the SwipeRefreshLayout being executed for a listview, so in other words, if you drag down the list view, the method is triggered and the listview refreshes itself. <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/swiperefresh" android:layout_width="match_parent" android:layout_height="match_parent">

SwipeRefreshLayout behind ActionBar

一笑奈何 提交于 2019-11-28 18:13:12
When using a SwipeRefreshLayout in combination with a overlay mode ActionBar, the loading animation will be displayed behind the actionbar, making it almost invisible. Is there anything I can do to show it on top of the actionbar? In the Material Design version of the appcompat-v7 library (v21.0.0), SwipeRefreshLayout gets a method to set the Progress View offset. https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html#setProgressViewOffset(boolean,%20int,%20int) public void setProgressViewOffset (boolean scale, int start, int end) The refresh indicator

Android: CoordinatorLayout and SwipeRefreshLayout

南笙酒味 提交于 2019-11-28 16:50:17
I try to implement auto hiding toolbar feature from the new support library 22.2.0. Without SwipeRefreshLayout is working fine: But when I re add this layout, toolbar overlap the recyclerview: Code: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

How to adjust the swipe down distance in SwipeRefreshLayout?

谁说我不能喝 提交于 2019-11-28 16:34:17
I implemented SwipeRefreshLayout in my app. I need to change the height which has to be scrolled down to call onRefresh() method. Which method should I use to add a custom height ? Implementation of SwipeRefreshLayout private SwipeRefreshLayout swipeLayout; In oncreate swipeLayout = (SwipeRefreshLayout)view.findViewById(R.id.swipe_container); swipeLayout.setOnRefreshListener(this); swipeLayout.setColorScheme(android.R.color.holo_blue_dark, android.R.color.holo_green_dark, android.R.color.holo_purple, android.R.color.holo_orange_dark); swipeLayout.setSoundEffectsEnabled(true); Implementing an