Search in sources :

Example 1 with FriendAdapter

use of me.yluo.ruisiapp.adapter.FriendAdapter in project Ruisi by freedom10086.

the class FriendActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_friend);
    initToolBar(true, "我的好友");
    friends = findViewById(R.id.recycler_view);
    datas = new ArrayList<>();
    backUpdatas = new ArrayList<>();
    totalDatas = new ArrayList<>();
    adapter = new FriendAdapter(this, datas, this);
    friends.setHasFixedSize(true);
    LinearLayoutManager lm = new LinearLayoutManager(this);
    friends.addItemDecoration(new MyListDivider(this, MyListDivider.VERTICAL));
    friends.setLayoutManager(lm);
    friends.addOnScrollListener(new LoadMoreListener(lm, this, 12));
    friends.setAdapter(adapter);
    search_input = findViewById(R.id.search_input);
    search_input.setHint("查找好友");
    search_card = findViewById(R.id.search_card);
    final String url = "home.php?mod=space&do=friend&mobile=2";
    new GetDataTask().execute(url);
    search_input.setOnEditorActionListener(this);
    addToolbarMenu(R.drawable.ic_search_white_24dp).setOnClickListener(this);
    findViewById(R.id.btn_back).setOnClickListener(this);
    findViewById(R.id.start_search).setOnClickListener(this);
    search_card.setVisibility(View.INVISIBLE);
    search_input.addTextChangedListener(this);
}
Also used : MyListDivider(me.yluo.ruisiapp.widget.MyListDivider) LoadMoreListener(me.yluo.ruisiapp.listener.LoadMoreListener) FriendAdapter(me.yluo.ruisiapp.adapter.FriendAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 FriendAdapter (me.yluo.ruisiapp.adapter.FriendAdapter)1 LoadMoreListener (me.yluo.ruisiapp.listener.LoadMoreListener)1 MyListDivider (me.yluo.ruisiapp.widget.MyListDivider)1