<commit_before>package com.alumnigroup.app.acty;

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

import org.apache.http.Header;

import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.alumnigroup.api.RestClient;
import com.alumnigroup.api.UserAPI;
import com.alumnigroup.app.BaseActivity;
import com.alumnigroup.app.R;
import com.alumnigroup.entity.User;
import com.alumnigroup.utils.L;
import com.alumnigroup.widget.PullAndLoadListView;
import com.alumnigroup.widget.PullAndLoadListView.OnLoadMoreListener;
import com.alumnigroup.widget.PullToRefreshListView.OnRefreshListener;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.nostra13.universalimageloader.core.ImageLoader;

/**
 * 全站会员
 * 
 * @author create by vector<br>
 *         coded by <NAME>
 * 
 */
public class Allmember extends BaseActivity {
        private TextView tv_title;

        private View btn_back, btn_allmenmber, btn_myfriend;
        private PullAndLoadListView lv_allmember, lv_myfriend;
        private List<User> data_allmember = null, data_myfriend = null;
        private ViewPager viewpager;
        private List<View> views = new ArrayList<View>();
        private UserAPI api;
        private int page = 1;
        private MemberAdapter adapter_allmember, adapter_myfriend;
        private int currentStatus = 0; // 0代表从底部左边数起第一个处于显示状态

        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.acty_allmember);
                initData();
                initLayout();
        }

        @Override
        protected void initData() {
                api = new UserAPI();
                data_allmember = new ArrayList<User>();
                data_myfriend = new ArrayList<User>();
        }

        @Override
        protected void initLayout() {
                initViewPager();
                tv_title = (TextView) _getView(R.id.acty_head_tv_title);
                btn_back = _getView(R.id.acty_head_btn_back);
                btn_allmenmber = _getView(R.id.acty_allmember_footer_allmember);
                btn_myfriend = _getView(R.id.acty_allmember_footer_myfriend);

                btn_back.setOnClickListener(this);
                btn_allmenmber.setOnClickListener(this);
                btn_myfriend.setOnClickListener(this);

                adapter_allmember = new MemberAdapter(data_allmember);
                adapter_myfriend = new MemberAdapter(data_myfriend);

                lv_allmember.setAdapter(adapter_allmember);
                lv_myfriend.setAdapter(adapter_myfriend);

                lv_allmember.setOnRefreshListener(new OnRefreshListener() {

                        @Override
                        public void onRefresh() {
                                // page=1?
                                L.i("onRefresh--->load page=" + page + " load 1  ");
                                api.getAllMember(1, new AsyncHttpResponseHandler() {

                                        @Override
                                        public void onFailure(int statusCode, Header[] headers,
                                                        byte[] data, Throwable err) {
                                                toast("网络异常 错误码:" + statusCode);
                                                if (data != null)
                                                        L.i(new String(data));
                                                if (err != null)
                                                        L.i(err.toString());
                                                lv_allmember.onRefreshComplete();
                                                L.i("Finish Faild : onRefresh--->load page=" + page
                                                                + " load 1  ");
                                        }

                                        // page=1?
                                        @Override
                                        public void onSuccess(int statusCode, Header[] headers,
                                                        byte[] data) {
                                                page = 1;
                                                String json = new String(data);// jsonarray
                                                List<User> newData_allmember = User
                                                                .create_by_jsonarray(json);
                                                data_allmember.clear();
                                                data_allmember.addAll(newData_allmember);
                                                adapter_allmember.notifyDataSetChanged();
                                                lv_allmember.onRefreshComplete();
                                                L.i("Finish success! : onRefresh--->load page=" + page
                                                                + " load 1  ");
                                        }
                                });
                        }
                });

                lv_allmember.setOnLoadMoreListener(new OnLoadMoreListener() {

                        @Override
                        public void onLoadMore() {
                                L.i("load more--->load page=" + page + "  page+1 ="
                                                + (page + 1));
                                api.getAllMember(page + 1, new AsyncHttpResponseHandler() {
                                        
                                         
                                        @Override
                                        public void onFailure(int statusCode, Header[] headers,
                                                        byte[] data, Throwable err) {
                                                toast("网络异常 错误码:" + statusCode);
                                                if (data != null)
                                                        L.i(new String(data));
                                                if (err != null)<commit_msg>add notify in allmember..<commit_after>package com.alumnigroup.app.acty;

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

import org.apache.http.Header;

import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.alumnigroup.api.RestClient;
import com.alumnigroup.api.UserAPI;
import com.alumnigroup.app.BaseActivity;
import com.alumnigroup.app.R;
import com.alumnigroup.entity.User;
import com.alumnigroup.utils.L;
import com.alumnigroup.widget.PullAndLoadListView;
import com.alumnigroup.widget.PullAndLoadListView.OnLoadMoreListener;
import com.alumnigroup.widget.PullToRefreshListView.OnRefreshListener;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.nostra13.universalimageloader.core.ImageLoader;

/**
 * 全站会员
 * 
 * @author create by vector<br>
 *         coded by <NAME>
 * 
 */
public class Allmember extends BaseActivity {
        private TextView tv_title;

        private View btn_back, btn_allmenmber, btn_myfriend;
        private PullAndLoadListView lv_allmember, lv_myfriend;
        private List<User> data_allmember = null, data_myfriend = null;
        private ViewPager viewpager;
        private List<View> views = new ArrayList<View>();
        private UserAPI api;
        private int page = 1;
        private MemberAdapter adapter_allmember, adapter_myfriend;
        private int currentStatus = 0; // 0代表从底部左边数起第一个处于显示状态

        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.acty_allmember);
                initData();
                initLayout();
        }

        @Override
        protected void initData() {
                api = new UserAPI();
                data_allmember = new ArrayList<User>();
                data_myfriend = new ArrayList<User>();
        }

        @Override
        protected void initLayout() {
                initViewPager();
                tv_title = (TextView) _getView(R.id.acty_head_tv_title);
                btn_back = _getView(R.id.acty_head_btn_back);
                btn_allmenmber = _getView(R.id.acty_allmember_footer_allmember);
                btn_myfriend = _getView(R.id.acty_allmember_footer_myfriend);

                btn_back.setOnClickListener(this);
                btn_allmenmber.setOnClickListener(this);
                btn_myfriend.setOnClickListener(this);

                adapter_allmember = new MemberAdapter(data_allmember);
                adapter_myfriend = new MemberAdapter(data_myfriend);

                lv_allmember.setAdapter(adapter_allmember);
                lv_myfriend.setAdapter(adapter_myfriend);

                lv_allmember.setOnRefreshListener(new OnRefreshListener() {

                        @Override
                        public void onRefresh() {
                                // page=1?
                                L.i("onRefresh--->load page=" + page + " load 1  ");
                                api.getAllMember(1, new AsyncHttpResponseHandler() {

                                        @Override
                                        public void onFailure(int statusCode, Header[] headers,
                                                        byte[] data, Throwable err) {
                                                toast("网络异常 错误码:" + statusCode);
                                                if (data != null)
                                                        L.i(new String(data));
                                                if (err != null)
                                                        L.i(err.toString());
                                                lv_allmember.onRefreshComplete();
                                                L.i("Finish Faild : onRefresh--->load page=" + page
                                                                + " load 1  ");
                                        }

                                        // page=1?
                                        @Override
                                        public void onSuccess(int statusCode, Header[] headers,
                                                        byte[] data) {
                                                page = 1;
                                                //还要判断是否有error_code
                                                String json = new String(data);// jsonarray
                                                List<User> newData_allmember = User
                                                                .create_by_jsonarray(json);
                                                data_allmember.clear();
                                                data_allmember.addAll(newData_allmember);
                                                adapter_allmember.notifyDataSetChanged();
                                                lv_allmember.onRefreshComplete();
                                                L.i("Finish success! : onRefresh--->load page=" + page
                                                                + " load 1  ");
                                        }
                                });
                        }
                });

                lv_allmember.setOnLoadMoreListener(new OnLoadMoreListener() {

                        @Override
                        public void onLoadMore() {
                                L.i("load more--->load page=" + page + "  page+1 ="
                                                + (page + 1));
                                api.getAllMember(page + 1, new AsyncHttpResponseHandler() {
                                        
                                         
                                        @Override
                                        public void onFailure(int statusCode, Header[] headers,
                                                        byte[] data, Throwable err) {
                                                toast("网络异常 错误码:" + statusCode);
                                                if (data != null)
                                                        L.i(new String(data));
                                                if (err != null)
{'fraction_non_alphanumeric': 0.0743408951563458, 'fraction_numerical': 0.0027590435315757206, 'mean_word_length': 1.0828411811652034, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 132, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4551341', 'n_tokens_mistral': 2866, 'n_tokens_neox': 2720, 'n_words': 541}