예제 #1
0
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.fragment_message, container, false);
    loadMoreListView = (LoadMoreListView) rootView.findViewById(R.id.lv_product);
    pending_view = (RelativeLayout) rootView.findViewById(R.id.pending_view);
    swipeLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_container);
    swipeLayout.setOnRefreshListener(this);
    loadMoreListView.setOnLoadMoreListener(this);
    // 加载颜色是循环播放的,只要没有完成刷新就会一直循环,color1>color2>color3>color4
    /*swipeLayout.setColorScheme(android.R.color.white,
    android.R.color.holo_green_light,
    android.R.color.holo_orange_light, android.R.color.holo_red_light); */

    swipeLayout.setColorScheme(
        android.R.color.holo_red_light,
        android.R.color.holo_green_light,
        android.R.color.holo_blue_bright,
        android.R.color.holo_orange_light);
    pending_view = (RelativeLayout) rootView.findViewById(R.id.pending_view);

    initDate();
    initListener();
    return rootView;
  }