小编Nip*_* Kc的帖子

在recyclerview的末尾添加进度条

在我的应用程序中,我发送了一个齐射请求,该请求一个接一个地获取列表项,而不是一次全部获取。我想在获取数据时在recyclerview的末尾实现一个进度条。类'updateAdapter'更新了适配器,我正在考虑使进度条在recyclerview滚动侦听器中可见。但是我不知道如何在我的代码中执行此操作。

updateAdapter.java

  //THIS CLASS UPDATES THE RECYCLER VIEW

    public class updateAdapter{

    private FetchWpApi fetch;

    private int totalItemCount;
    private int prevLastvisible=0;
    private int fpage=1;
    private Context context;
    private RecyclerView recyclerView;
    private ArrayList<sItem> list= new ArrayList<>();
    private LinearLayoutManager manager;
    private ProgressBar progressBar;

    //CONSTRUCTOR FOR updateAdapter
    public updateAdapter(RecyclerView recyclerView, final Context context, String url, LinearLayoutManager manager){
        this.context=context;
        this.recyclerView=recyclerView;
        fetch=new FetchWpApi(url,context);
        this.manager=manager;
    }

    public void fetchAndPut()
    {
        if(recyclerView.getAdapter()==null) {
            fetch.fetchApiData(fpage, new FetchWpApi.Callback() {
                @Override
                public void onSuccess(sItem sitem) {
                    list.add(sitem);
                    if (list.size() == 1 …
Run Code Online (Sandbox Code Playgroud)

java android android-recyclerview

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

Twitter 不允许我添加 127.0.0.1 作为回调 URL?

在此输入图像描述

我正在尝试使用 twitter 实现 OAuth 身份验证。要在本地测试,我需要添加回调 URL ( http://127.0.0.1/... ) ,但是当我输入本地主机 URL 时,它会显示“无效的网站 url” 。

文档callback-urls指出这应该是有效的。

(PS 我对 Google 做了同样的事情,其中​​接受了本地主机 URL( http://127.0.0.1/... ))

twitter oauth

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

在django中将URL中的多个参数作为GET请求发送?

我从jquery发送GET请求:

http://127.0.0.1:8000/viewspecs/itemdetails?param1="+variable1+"&param2="+ variable2
Run Code Online (Sandbox Code Playgroud)

django中此部分的urls.py文件类似于:

url(r'^viewspecs/itemdetails?param1=(?P<specs_search_item>[\w\+%_ ./-]+)&param2=(?P<item_price>[0-9])$', views.specsView),
Run Code Online (Sandbox Code Playgroud)

当我访问该地址时,我得到一个页面而不是(404)错误.为什么?

django

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

标签 统计

android ×1

android-recyclerview ×1

django ×1

java ×1

oauth ×1

twitter ×1