use of me.yluo.ruisiapp.adapter.ChatListAdapter in project Ruisi by freedom10086.
the class ChatActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat);
smileyPicker = new MySmileyPicker(this);
list = findViewById(R.id.list);
input = findViewById(R.id.ed_comment);
btnSend = findViewById(R.id.btn_send);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getApplicationContext());
adapter = new ChatListAdapter(this, datas);
adapter.disableLoadMore();
list.setLayoutManager(layoutManager);
list.setAdapter(adapter);
Bundle bundle = this.getIntent().getExtras();
initToolBar(true, bundle.getString("username"));
addToolbarMenu(R.drawable.ic_refresh_24dp).setOnClickListener(view -> refresh());
url = bundle.getString("url");
handler = new EmotionInputHandler(input, (enable, s) -> btnSend.setEnabled(enable));
smileyPicker.setListener((str, a) -> handler.insertSmiley(str, a));
findViewById(R.id.btn_emotion).setOnClickListener(view -> {
smileyPicker.showAtLocation(view, Gravity.BOTTOM, 32, DimmenUtils.dip2px(ChatActivity.this, 80));
});
btnSend.setOnClickListener(view -> send_click());
getData(true);
}
Aggregations