swiperefreshlayout

How to invalidate ListView for new data when using ListAdapter

纵饮孤独 提交于 2019-12-11 21:16:47
问题 I am making use of a default listview in a fragment to show data that is being called from a URL. There is a SwipeRefreshLayout where the ListView is contained. However when I refresh, the old data is still in the listview and the new data is just added at the top of the list. Is there a way to invalidate the old data? I have made use of a ListAdapter which is created from the SimpleAdapter class like so: ListAdapter adapter = new SimpleAdapter(getActivity(), newsItemList, R.layout.list_item,

EnhancedListView SwipeRefreshLayout

醉酒当歌 提交于 2019-12-11 17:48:54
问题 I am using a SwipeRefreshLayout and an EnhancedListView to combine them like GMAIL-App. When I start to swipe horizontal I am still be able to swipe vertical. In this case the animation from EnhancedListView stuck and do not reset or swipe till the end if I do not complete the vertical (SwipeRefreshLayout) swipe. I can see, that first pull to refresh and then swipeToDismiss does not work. Only first swipe and then refresh. So i guess it is about beeing a parent element. Possible Solution i

ViewPager inside ScrollView inside SwipeRefreshLayout

假如想象 提交于 2019-12-11 10:05:48
问题 I have a layout which includes a SwipeRefreshLayout, a ScrollView and a ViewPager. The SwipeRefreshLayout is used to refresh the ViewPager and the ScrollView is because the ViewPager can have content that don't fits on display. When I try to scroll down nothing happens but I can see there is more content to show. When I scroll up the SwipeRefresh is invoked. My XML: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns

Add SwipeRefreshLayout to RecyclerView when it has an empty header

夙愿已清 提交于 2019-12-11 06:16:53
问题 I have added a headerView to my RecyclerView as described in the answer of this question: Is there an addHeaderView equivalent for RecyclerView? The header is an empty view which will be hidden under toolBar. <?xml version="1.0" encoding="utf-8"?> <View xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/header" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" /> The problem is the place of SwipeRefreshLayout. It will be started from

RecyclerView reload same data when refresh

坚强是说给别人听的谎言 提交于 2019-12-11 06:13:16
问题 I have a problem, when i swipe to refresh the data, the first swipe is ok but after that every swipe reload and add the same data over and over again, by the end i have a list with same items over and over... I'm using a loader. I tried to clear before but i don't understand what's wrong with my code, if someone could explain it to me. Thank You. Here my code : public abstract class NewsFragment extends Fragment implements LoaderManager.LoaderCallbacks<ArrayList<Articles>> { protected

How to stop swipetorefresh progressbar in webview?

∥☆過路亽.° 提交于 2019-12-11 04:55:55
问题 I'm new with Android development. I got trouble using SwipeToRefresh option in WebView . I'm trying to solve it from a mounth now and after trying several codes, it's not working. Also Youtube video is not playing in full screen from the WebView... Here's my question: How to hide SwipeToRefresh ProgressBar and stop running? Here is my MainActivity class: public class WebViewActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { private WebView

SwipeRefreshLayout with EmptyView nullPointerException

孤者浪人 提交于 2019-12-10 20:26:45
问题 Whenever I swipe down to refresh, I get a NullPointerException but it's not in my code , rather in the startRefresh() method from SwipeRefreshLayout. 07-14 11:55:06.714: E/AndroidRuntime(20484): java.lang.NullPointerException 07-14 11:55:06.714: E/AndroidRuntime(20484): at android.support.v4.widget.SwipeRefreshLayout.startRefresh(SwipeRefreshLayout.java:441) 07-14 11:55:06.714: E/AndroidRuntime(20484): at android.support.v4.widget.SwipeRefreshLayout.onTouchEvent(SwipeRefreshLayout.java:399)

Swipe to Delete Not working from the Top item of the listview but from the last item of list view

只愿长相守 提交于 2019-12-10 11:50:58
问题 I am Using the this as swipe to delete. but I am having problem in implementing only the delete menu item of the list. What I am doing is creating just one single delete Item. I really do not want to use any other item such like Open as shown in demo. here is my design <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match

SwipeRefreshLayout refresh animation doesn't stop

假装没事ソ 提交于 2019-12-10 02:56:32
问题 I've implemented a fragment which has a SwipeRefreshLayout as content view. Refresh animation is triggered at onRefresh but it never stops even if setRefreshing is set to false after retrieving the data from server. @Override public void onRefresh() { handler.post(refreshing); } private final Runnable refreshing = new Runnable(){ public void run(){ try { if(isRefreshing()){ handler.postDelayed(this, 1000); }else{ swipeLayout.setRefreshing(false); mainActivity.forceUpdate(); setLayout(); } }

使用SwipeRefreshLayout和RecyclerView实现仿“简书”下拉刷新和上拉加载

喜你入骨 提交于 2019-12-09 23:16:43
一、概述 我们公司目前开发的所有 Android APP都是遵循 iOS 风格设计的,这并不是一个好现象。我决定将Android 5.x控件引入最近开发的项目中,使用RecyclerView取代以往使用的ListView、GridView,使用SwipeRefreshLayout取代pull-to-refresh第三方库,打造更符合Material Design风格的APP。 本篇博客介绍的就是如何使用SwipeRefreshLayout和RecyclerView实现高仿简书Android端的下拉刷新和上拉加载更多的效果。 根据效果图可以发现,本案例实现了如下效果: 第一次进入页面显示SwipeRefreshLayout的下拉刷新效果 当内容铺满屏幕时,向下滑动显示“加载中…”效果并加载更多数据 当SwipeRefreshLayout正在下拉刷新时,将屏蔽加载更多操作 当加载更多数据时,屏蔽有可能的重复的上拉操作 当向上滑动RecyclerView时,隐藏Toolbar以获得更好的用户体验 二、代码实现 MainActivity package com.leohan.refresh; import android.os.Bundle; import android.os.Handler; import android.support.v4.widget