标签: swiperefreshlayout

使用CoordinatorLayout中的WebView SwipeRefreshLayout

这是我的xml布局:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/coordinatorLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
            <include
                android:id="@+id/toolbar"
                layout="@layout/tool_bar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_scrollFlags="scroll|enterAlways" />
    </android.support.design.widget.AppBarLayout>

    <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/swipeContainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <WebView
            android:id="@+id/web_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />

    </android.support.v4.widget.SwipeRefreshLayout>
</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)

不幸的是,当webView滚动时,工具栏没有隐藏.

如何将WebView与SwipeRefreshLayout和可隐藏工具栏一起使用?

对不起我的英语不好.

android webview swiperefreshlayout android-toolbar coordinator-layout

1
推荐指数
1
解决办法
2348
查看次数

endless recyclerview along with load onscroll from server in recyclerview using cardview to load images and text

I have implemented recyclerview using cardview to fetch images and text from my server using this tutorial: http://www.simplifiedcoding.net/android-custom-listview-with-images-using-recyclerview-and-volley/.

I have successfully fetched the data and modified the code according to my requirement, now i want to implement swipe to refresh and endless scrolling similar to Instagram application. I have tried a lot of tutorials and SO questions however i am unable to implement any of them.

I am partially successfully implementing swipe-to-refresh but the app exits with an inconsistency …

android infinite-scroll swiperefreshlayout android-cardview android-recyclerview

1
推荐指数
1
解决办法
9774
查看次数

onRefresh Android SwipeRefreshLayout 不调用我的方法

我正在学习 android 滑动刷新布局。我在 swipeRefreshLayout“setRefreshing(true)”上发布 runabble,然后在 onRefresh 方法上我编写了 fetchMovie()。但 fetchMovie() 没有调用。如何修复它?

package com.example.zihadrizkyef.belajarswiperefresh;

import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;

import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonArrayRequest;
import com.example.zihadrizkyef.belajarswiperefresh.app.MyApplication;
import com.example.zihadrizkyef.belajarswiperefresh.helper.Movie;
import com.example.zihadrizkyef.belajarswiperefresh.helper.SwipeListAdapter;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity implements SwipeRefreshLayout.OnRefreshListener {
    private String TAG = MainActivity.class.getSimpleName();
    private String URL_TOP_250 = "http://api.androidhive.info/json/imdb_top_250.php?offset=";
    private SwipeRefreshLayout swipeRefreshLayout;
    private ListView listView;
    private SwipeListAdapter adapter;
    private List<Movie> movieList;
    private int …
Run Code Online (Sandbox Code Playgroud)

android swiperefreshlayout

1
推荐指数
1
解决办法
2573
查看次数

在 AppBarLayout 的 Toolbar 下制作 SwipeRefreshLayout

SwipeRefreshLayout用作布局的根元素,因为我需要刷新屏幕上的所有内容。布局如下:

<SwipeRefreshLayout>
    <CoordinatorLayout>
        <ViewPager />
        <AppBarLayout>
            <Toolbar />
            <FrameLayout>
                ...
            </FrameLayout>
        <TabLayout />
    </CoordinatorLayout>
</SwipeRefreshLayout>
Run Code Online (Sandbox Code Playgroud)

当我在布局上向下滑动时,刷新圈SwipeRefreshLayout出现在屏幕顶部,位于Toolbar. 所以我使用SwipeRefreshLayout#setProgressViewOffset让圆圈从工具栏高度的偏移量开始,但是当刷新完成时,圆圈会在消失之前奇怪地挂在工具栏上一会儿:截图

如何在工具栏下制作刷新圆圈?

android swiperefreshlayout android-toolbar android-appbarlayout

1
推荐指数
1
解决办法
3234
查看次数

将 SwipeRefreshLayout 微调器放置在低于容器的位置

如何在不移动内容的情况下将微调器放置在 swipeRefreshLayout 较低的位置,这会是填充调整吗?

android swiperefreshlayout

1
推荐指数
1
解决办法
281
查看次数