当前位置: 首页>>代码示例>>Java>>正文


Java SwipeRefreshLayout.setRefreshing方法代码示例

本文整理汇总了Java中android.support.v4.widget.SwipeRefreshLayout.setRefreshing方法的典型用法代码示例。如果您正苦于以下问题:Java SwipeRefreshLayout.setRefreshing方法的具体用法?Java SwipeRefreshLayout.setRefreshing怎么用?Java SwipeRefreshLayout.setRefreshing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.widget.SwipeRefreshLayout的用法示例。


在下文中一共展示了SwipeRefreshLayout.setRefreshing方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateView

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View layout = inflater.inflate(R.layout.chat_fragment_group, container, false);

    listGroup = GroupDB.getInstance(getContext()).getListGroups();
    recyclerListGroups = (RecyclerView) layout.findViewById(R.id.recycleListGroup);
    mSwipeRefreshLayout = (SwipeRefreshLayout) layout.findViewById(R.id.swipeRefreshLayout);
    mSwipeRefreshLayout.setOnRefreshListener(this);
    GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 2);
    recyclerListGroups.setLayoutManager(layoutManager);
    adapter = new ListMovieAdapter(getContext(), listGroup);
    recyclerListGroups.setAdapter(adapter);


    if(listGroup.size() == 0){
        //Ket noi server hien thi group
        mSwipeRefreshLayout.setRefreshing(true);
        getListGroup();
    }
    return layout;
}
 
开发者ID:ansarisufiyan777,项目名称:Show_Chat,代码行数:23,代码来源:TVFragment.java

示例2: bindView

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
protected void bindView(){
    //初始化啊Map UIi相关
    mRlMapUiContainer = (RelativeLayout) findViewById(R.id.rl_map_ui_group);
    mBtnMapStyleChange = (Button) findViewById(R.id.btn_change_map_style);
    mBtnActivityLayoutChange = (Button) findViewById(R.id.btn_quit_map_ui);
    mTvMoveDistance = (TextView) findViewById(R.id.tv_duration_distance);
    mTvMoveDuration = (TextView) findViewById(R.id.tv_duration_time);

    mBtnMapStyleChange.setOnClickListener(this);
    mBtnActivityLayoutChange.setOnClickListener(this);

    mLocationProgressLayout = (SwipeRefreshLayout) findViewById(R.id.spl_refresh_view);
    mLocationProgressLayout.setRefreshing(true);
    mLocationProgressLayout.setColorSchemeColors(getResources().getColor(R.color.colorAccent),
            getResources().getColor(R.color.colorPrimary));

}
 
开发者ID:stdnull,项目名称:RunMap,代码行数:18,代码来源:MovementTrackActivity.java

示例3: setUpActivity

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
protected void setUpActivity(String title, int navDrawerId, boolean withFab, boolean withRefresh) {
    getActivity().setTitle(title);
    if (mListener != null) {
        mListener.checkNavigationDrawerItem(navDrawerId);
    }
    FloatingActionButton fab = (FloatingActionButton) getActivity().findViewById(R.id.fab);
    if (withFab) {
        fab.show();
    } else {
        fab.hide();
    }
    fab.setOnClickListener(null);
    SwipeRefreshLayout srl = (SwipeRefreshLayout) getActivity().findViewById(R.id.swipe_container);
    srl.setEnabled(withRefresh);
    srl.setRefreshing(false);
    srl.setOnRefreshListener(null);
}
 
开发者ID:gbl08ma,项目名称:underlx,代码行数:18,代码来源:TopFragment.java

示例4: onCreate

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_ithome);

  toolbar = (Toolbar) findViewById(R.id.toolbar);
  toolbar.setTitle(R.string.ithome);
  toolbar.setNavigationOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      ITHomeActivity.this.finish();
    }
  });
  toolbar.setOnClickListener(new DoubleClickBackToContentTopListener(this));

  refreshLayout = (SwipeRefreshLayout) findViewById(R.id.refresh_layout);
  listView = (ListView) findViewById(R.id.list_view);
  adapter = new SimpleAdapter(this, data, R.layout.list_view_item_ithome, new String[]{"title", "href"}, new int[]{R.id.title, R.id.href});
  listView.setAdapter(adapter);
  loadMoreFooter = new LoadMoreFooter(this, listView, this);

  refreshLayout.setOnRefreshListener(this);
  listView.setOnItemClickListener(this);

  refreshLayout.setRefreshing(true);
  initData();

}
 
开发者ID:tomoya92,项目名称:android-apps,代码行数:29,代码来源:ITHomeActivity.java

示例5: onCreate

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_toutiaoio);

  toolbar = (Toolbar) findViewById(R.id.toolbar);
  toolbar.setTitle(R.string.toutiaoio);
  toolbar.setNavigationOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      TouTiaoIOActivity.this.finish();
    }
  });
  toolbar.setOnClickListener(new DoubleClickBackToContentTopListener(this));

  refreshLayout = (SwipeRefreshLayout) findViewById(R.id.refresh_layout);
  listView = (ListView) findViewById(R.id.list_view);
  adapter = new MyBaseAdapter<Map<String, Object>>(this, data) {
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      ViewHolder holder = ViewHolder.get(context, convertView, parent, R.layout.list_view_item_toutiaoio, position);
      Map<String, Object> map = _data.get(position);
      holder.setText(R.id.title, map.get("title").toString())
          .setText(R.id.replyCount, map.get("replyCount").toString())
          .setText(R.id.source, map.get("source").toString());
      holder.setNetImage(R.id.avatar, map.get("avatar").toString());
      return holder.getConvertView();
    }
  };
  listView.setAdapter(adapter);
  loadMoreFooter = new LoadMoreFooter(this, listView, this);

  refreshLayout.setOnRefreshListener(this);
  listView.setOnItemClickListener(this);

  refreshLayout.setRefreshing(true);
  initData();
}
 
开发者ID:tomoya92,项目名称:android-apps,代码行数:39,代码来源:TouTiaoIOActivity.java

示例6: onStart

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
@Override
public void onStart() {
    super.onStart();
    swipeLayout = (SwipeRefreshLayout) getView().findViewById(R.id.swiperefresh);
    //Famoso migué
    swipeLayout.setRefreshing(true);
    //Seta as corzinhas do loading (Fun)
    swipeLayout.setColorSchemeResources(R.color.loadingColor_1, R.color.loadingColor_2, R.color.loadingColor_3);
    swipeLayout.setOnRefreshListener(
            new SwipeRefreshLayout.OnRefreshListener() {
                @Override
                public void onRefresh() {

                    //Executa a atualização dos tweets
                    //Apenas se a thread não está sendo executada
                        try {
                            new MegaChecker().execute("");
                        } catch (Exception e) {
                            Toast.makeText(getContext(), R.string.verifique, Toast.LENGTH_SHORT).show();
                            swipeLayout.setRefreshing(false);
                        }
                    }
            }

    );
    new MegaChecker().execute("");
}
 
开发者ID:secompufscar,项目名称:app_secompufscar,代码行数:28,代码来源:TwitterHashtag.java

示例7: setSwipeRefreshLoadedState

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
/**
 * 设置顶部加载完毕的状态
 */
private void setSwipeRefreshLoadedState(
        SwipeRefreshLayout mSwipeRefreshLayout) {
    mState = STATE_NOMORE;
    if (mSwipeRefreshLayout != null) {
        mSwipeRefreshLayout.setRefreshing(false);
        mSwipeRefreshLayout.setEnabled(true);
    }
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:12,代码来源:TeamDiaryDetailFragment.java

示例8: setSwipeRefreshLoadedState

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
/**
 * 设置顶部加载完毕的状态
 */
private void setSwipeRefreshLoadedState(
        SwipeRefreshLayout mSwipeRefreshLayout) {
    BaseFragment.mState = BaseFragment.STATE_NOMORE;
    if (mSwipeRefreshLayout != null) {
        mSwipeRefreshLayout.setRefreshing(false);
        mSwipeRefreshLayout.setEnabled(true);
    }
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:12,代码来源:DiaryPageContentView.java

示例9: onCreateView

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
@Override
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_tencent_huati, container, false);

  refreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refresh_layout);
  listView = (ListView) view.findViewById(R.id.list_view);
  adapter = new MyBaseAdapter<Map<String, Object>>(getActivity(), data) {
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      ViewHolder holder = ViewHolder.get(context, convertView, parent, R.layout.list_view_item_tencent_huati, position);
      Map<String, Object> map = data.get(position);
      holder.setText(R.id.title, map.get("n_title").toString())
          .setText(R.id.desc, map.get("n_describe").toString())
          .setText(R.id.author, map.get("n_use_user").toString())
          .setText(R.id.time, FormatUtil.getRelativeTimeSpanString(
              FormatUtil.string2Date(map.get("n_pushtime").toString(), FormatUtil.DATETIME)
          ));
      holder.setNetImage(R.id.thumbnails, map.get("n_pic").toString());
      return holder.getConvertView();
    }
  };
  listView.setAdapter(adapter);
  loadMoreFooter = new LoadMoreFooter(getActivity(), listView, this);

  refreshLayout.setOnRefreshListener(this);
  listView.setOnItemClickListener(this);
  refreshLayout.setRefreshing(true);

  return view;
}
 
开发者ID:tomoya92,项目名称:android-apps,代码行数:32,代码来源:TencentHuaTiFragment.java

示例10: onCreate

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_newsbrother);

  toolbar = (Toolbar) findViewById(R.id.toolbar);
  toolbar.setTitle(R.string.newsbrother);
  toolbar.setNavigationOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      NewsBrotherActivity.this.finish();
    }
  });
  toolbar.setOnClickListener(new DoubleClickBackToContentTopListener(this));

  refreshLayout = (SwipeRefreshLayout) findViewById(R.id.refresh_layout);
  listView = (ListView) findViewById(R.id.list_view);
  adapter = new MyBaseAdapter<Map<String, Object>>(this, data) {
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      ViewHolder holder = ViewHolder.get(NewsBrotherActivity.this, convertView, parent, R.layout.list_view_item_newsbrother, position);
      Map map = _data.get(position);
      holder.setText(R.id.title, map.get("title").toString())
          .setText(R.id.author, map.get("author").toString())
          .setText(R.id.time, map.get("time").toString());
      return holder.getConvertView();
    }
  };
  listView.setAdapter(adapter);
  loadMoreFooter = new LoadMoreFooter(this, listView, this);

  refreshLayout.setOnRefreshListener(this);
  listView.setOnItemClickListener(this);

  refreshLayout.setRefreshing(true);
  initData();

}
 
开发者ID:tomoya92,项目名称:android-apps,代码行数:39,代码来源:NewsBrotherActivity.java

示例11: onCreateView

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_segmentfault, container, false);

  listView = (ListView) view.findViewById(R.id.list_view);
  refreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refresh_layout);
  adapter = new MyBaseAdapter<Map<String, String>>(getActivity(), data) {
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      ViewHolder holder = ViewHolder.get(context, convertView, parent, R.layout.list_view_item_segmentfault, position);
      Map<String, String> map = data.get(position);
      holder.setText(R.id.title, map.get("title"))
          .setText(R.id.desc, map.get("desc"))
          .setText(R.id.author, map.get("author"))
          .setText(R.id.catagray, map.get("catagray"))
          .setText(R.id.rank, map.get("rank"))
          .setText(R.id.time, map.get("time"));
      holder.setNetImage(R.id.avatar, map.get("avatar"));
      return holder.getConvertView();
    }
  };
  listView.setAdapter(adapter);
  loadMoreFooter = new LoadMoreFooter(getActivity(), listView, this);

  refreshLayout.setOnRefreshListener(this);
  listView.setOnItemClickListener(this);

  refreshLayout.setRefreshing(true);

  return view;
}
 
开发者ID:tomoya92,项目名称:android-apps,代码行数:33,代码来源:SegmentFaultRecommendFragment.java

示例12: onCreateView

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
@Override
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_tencent_shehui, container, false);

  refreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refresh_layout);
  listView = (ListView) view.findViewById(R.id.list_view);
  adapter = new MyBaseAdapter<Map<String, Object>>(getActivity(), data) {
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      ViewHolder holder = ViewHolder.get(context, convertView, parent, R.layout.list_view_item_tencent_news, position);
      Map<String, Object> map = data.get(position);
      holder.setText(R.id.title, map.get("title").toString())
          .setText(R.id.abstract_content, map.get("abstract").toString())
          .setText(R.id.time, FormatUtil.getRelativeTimeSpanString(
              new Date((long) (((double) map.get("timestamp")) * 1000))
          ));
      holder.setNetImage(R.id.thumbnails, ((List) map.get("thumbnails_qqnews")).get(0).toString());
      return holder.getConvertView();
    }
  };
  listView.setAdapter(adapter);
  loadMoreFooter = new LoadMoreFooter(getActivity(), listView, this);

  refreshLayout.setOnRefreshListener(this);
  listView.setOnItemClickListener(this);
  refreshLayout.setRefreshing(true);

  return view;
}
 
开发者ID:tomoya92,项目名称:android-apps,代码行数:31,代码来源:TencentSheHuiFragment.java

示例13: onCreateView

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
@Override
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_tencent_news, container, false);

  refreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refresh_layout);
  listView = (ListView) view.findViewById(R.id.list_view);
  adapter = new MyBaseAdapter<Map<String, Object>>(getActivity(), data) {
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      ViewHolder holder = ViewHolder.get(context, convertView, parent, R.layout.list_view_item_tencent_news, position);
      Map<String, Object> map = data.get(position);
      holder.setText(R.id.title, map.get("title").toString())
          .setText(R.id.abstract_content, map.get("abstract").toString())
          .setText(R.id.time, FormatUtil.getRelativeTimeSpanString(
              new Date((long) (((double) map.get("timestamp")) * 1000))
          ));
      holder.setNetImage(R.id.thumbnails, ((List) map.get("thumbnails_qqnews")).get(0).toString());
      return holder.getConvertView();
    }
  };
  listView.setAdapter(adapter);
  loadMoreFooter = new LoadMoreFooter(getActivity(), listView, this);

  refreshLayout.setOnRefreshListener(this);
  listView.setOnItemClickListener(this);
  refreshLayout.setRefreshing(true);

  return view;
}
 
开发者ID:tomoya92,项目名称:android-apps,代码行数:31,代码来源:TencentNewsFragment.java

示例14: setRefreshing

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
/**
 * Enable/Disable refreshing state of SwipeRefreshLayout
 *
 * @param swipeRefreshLayout
 * @param setRefresh
 */
public static void setRefreshing(SwipeRefreshLayout swipeRefreshLayout, boolean setRefresh) {
    if (swipeRefreshLayout != null) {
        boolean isRefreshing = swipeRefreshLayout.isRefreshing();

        if (setRefresh) {
            if (!isRefreshing) swipeRefreshLayout.setRefreshing(true);
        } else {
            if (isRefreshing) swipeRefreshLayout.setRefreshing(false);
        }
    }
}
 
开发者ID:teeeeeegz,项目名称:DuckDuckDefine-Android,代码行数:18,代码来源:ViewUtil.java

示例15: onCreate

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_tuicool);

  toolbar = (Toolbar) findViewById(R.id.toolbar);
  toolbar.setTitle(R.string.tuicool);
  toolbar.setNavigationOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      TuiCoolActivity.this.finish();
    }
  });
  toolbar.setOnClickListener(new DoubleClickBackToContentTopListener(this));

  refreshLayout = (SwipeRefreshLayout) findViewById(R.id.refresh_layout);
  listView = (ListView) findViewById(R.id.list_view);
  adapter = new MyBaseAdapter<Map<String, Object>>(this, data) {
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      ViewHolder holder = ViewHolder.get(context, convertView, parent, R.layout.list_view_item_tuicool, position);
      Map<String, Object> map = _data.get(position);
      holder.setText(R.id.title, map.get("title").toString())
          .setText(R.id.time, map.get("time").toString())
          .setText(R.id.source, map.get("source").toString());
      holder.setNetImage(R.id.img, map.get("img").toString());
      return holder.getConvertView();
    }
  };
  listView.setAdapter(adapter);
  loadMoreFooter = new LoadMoreFooter(this, listView, this);

  refreshLayout.setOnRefreshListener(this);
  listView.setOnItemClickListener(this);

  refreshLayout.setRefreshing(true);
  initData();
}
 
开发者ID:tomoya92,项目名称:android-apps,代码行数:39,代码来源:TuiCoolActivity.java


注:本文中的android.support.v4.widget.SwipeRefreshLayout.setRefreshing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。