与Android中socket.io聊天应用程序的Supernova表情库集成
我正在通过socket.io在android上制作聊天应用程序,其中包括recylerview/adapter和model类。我还成功地分别添加了表情库,但我想在同一活动中添加表情库和recyclerview。你能指导我如何在同一页(活动)上完成吗。我们将非常感谢您的回复 我遵循这些指南 聊天视图的布局文件与Android中socket.io聊天应用程序的Supernova表情库集成,android,android-recyclerview,socket.io,emoji,Android,Android Recyclerview,Socket.io,Emoji,我正在通过socket.io在android上制作聊天应用程序,其中包括recylerview/adapter和model类。我还成功地分别添加了表情库,但我想在同一活动中添加表情库和recyclerview。你能指导我如何在同一页(活动)上完成吗。我们将非常感谢您的回复 我遵循这些指南 聊天视图的布局文件 <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.Coordinato
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/contentRoot1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorchatbg"
android:orientation="vertical">
<LinearLayout
android:id="@+id/contentRoot"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/layout_header"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:layout_alignParentTop="true"
android:background="@color/voilacabs">
<RelativeLayout
android:id="@+id/layout_back_arrow"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingLeft="@dimen/margin_15"
android:paddingRight="@dimen/margin_15">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:src="@drawable/back_arrow" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/margin_10"
android:layout_toRightOf="@+id/layout_back_arrow"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/txt_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Username"
android:textColor="@color/white"
android:textSize="16dp" />
<TextView
android:id="@+id/txt_typing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Typing..."
android:textColor="@color/white"
android:textSize="16dp"
android:visibility="gone" />
</LinearLayout>
</RelativeLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<android.support.v7.widget.RecyclerView
android:id="@+id/messageRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none" />
<View
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_gravity="bottom"
android:background="@drawable/shadow_top" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="2dp">
<ImageView
android:id="@+id/buttonEmoji"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:padding="8dp"
android:src="@drawable/chat_smilly" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/buttonEmoji"
android:layout_weight="1">
<hani.momanii.supernova_emoji_library.Helper.EmojiconEditText
android:id="@+id/editTextMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:emojiconSize="28sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/lauout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/editTextMessage"
android:orientation="horizontal">
<ImageView
android:id="@+id/buttonMessage"
android:layout_width="40dp"
android:layout_height="40dp"
android:padding="8dp"
android:src="@drawable/chat_send" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
private EmojIconActions emojIcon;
edMessage = (EmojiconEditText) findViewById(R.id.editTextMessage);
btEmoji = (ImageView) findViewById(R.id.buttonEmoji);
emojIcon = new EmojIconActions(this, contentRoot, edMessage, btEmoji);
emojIcon.ShowEmojIcon();