Search in sources :

Example 1 with ChatListAdapter

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);
}
Also used : Context(android.content.Context) Bundle(android.os.Bundle) UrlUtils(me.yluo.ruisiapp.utils.UrlUtils) EmotionInputHandler(me.yluo.ruisiapp.widget.emotioninput.EmotionInputHandler) ResponseHandler(me.yluo.ruisiapp.myhttp.ResponseHandler) Intent(android.content.Intent) HashMap(java.util.HashMap) GetId(me.yluo.ruisiapp.utils.GetId) MySmileyPicker(me.yluo.ruisiapp.widget.MySmileyPicker) ArrayList(java.util.ArrayList) KeyboardUtil(me.yluo.ruisiapp.utils.KeyboardUtil) Element(org.jsoup.nodes.Element) Map(java.util.Map) View(android.view.View) HttpUtil(me.yluo.ruisiapp.myhttp.HttpUtil) Log(android.util.Log) TextResponseHandler(me.yluo.ruisiapp.myhttp.TextResponseHandler) DimmenUtils(me.yluo.ruisiapp.utils.DimmenUtils) AsyncTask(android.os.AsyncTask) ChatListAdapter(me.yluo.ruisiapp.adapter.ChatListAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) R(me.yluo.ruisiapp.R) RecyclerView(android.support.v7.widget.RecyclerView) Gravity(android.view.Gravity) List(java.util.List) ChatListData(me.yluo.ruisiapp.model.ChatListData) Document(org.jsoup.nodes.Document) Jsoup(org.jsoup.Jsoup) Elements(org.jsoup.select.Elements) Nullable(android.support.annotation.Nullable) Snackbar(android.support.design.widget.Snackbar) UnsupportedEncodingException(java.io.UnsupportedEncodingException) EditText(android.widget.EditText) ChatListAdapter(me.yluo.ruisiapp.adapter.ChatListAdapter) MySmileyPicker(me.yluo.ruisiapp.widget.MySmileyPicker) Bundle(android.os.Bundle) RecyclerView(android.support.v7.widget.RecyclerView) EmotionInputHandler(me.yluo.ruisiapp.widget.emotioninput.EmotionInputHandler) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

Context (android.content.Context)1 Intent (android.content.Intent)1 AsyncTask (android.os.AsyncTask)1 Bundle (android.os.Bundle)1 Nullable (android.support.annotation.Nullable)1 Snackbar (android.support.design.widget.Snackbar)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 Log (android.util.Log)1 Gravity (android.view.Gravity)1 View (android.view.View)1 EditText (android.widget.EditText)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 R (me.yluo.ruisiapp.R)1 ChatListAdapter (me.yluo.ruisiapp.adapter.ChatListAdapter)1 ChatListData (me.yluo.ruisiapp.model.ChatListData)1