聊天页

This commit is contained in:
oujunhui
2020-04-18 19:28:37 +08:00
parent 285292a005
commit f7f06a3ee9
36 changed files with 55 additions and 41 deletions

View File

@@ -14,13 +14,14 @@ import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.support.v7.widget.AppCompatImageView;
import android.util.AttributeSet;
import android.widget.ImageView;
import com.yizhuan.erban.R;
public class CircleImageView extends ImageView {
public class CircleImageView extends AppCompatImageView {
private static final ScaleType SCALE_TYPE = ScaleType.CENTER_CROP;

View File

@@ -46,11 +46,9 @@ import com.qiyukf.unicorn.api.Unicorn;
import com.qiyukf.unicorn.api.msg.MsgTypeEnum;
import com.qiyukf.unicorn.api.msg.UnicornMessage;
import com.yizhuan.erban.R;
import com.yizhuan.erban.common.widget.CircleImageView;
import com.yizhuan.erban.ui.im.recent.adapter.RecentContactAdapter;
import com.yizhuan.xchat_android_core.customer_server.CustomerServerModel;
import com.yizhuan.xchat_android_core.customer_server.event.CustomerServerMsgEvent;
import com.yizhuan.xchat_android_core.manager.IMMessageManager;
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
import org.greenrobot.eventbus.EventBus;

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#F4F4F4" />
<corners android:radius="19dp"/>
</shape>

View File

@@ -14,7 +14,7 @@
android:layout_width="50dp"
android:layout_height="50dp"
app:civ_border_color="@color/appColor"
app:civ_border_width="5dp"
app:civ_border_width="1dp"
tools:src="@drawable/default_avatar"/>

View File

@@ -73,6 +73,7 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/messageListView"
style="@style/recycler_view"
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
@@ -120,6 +121,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:visibility="gone"
android:layout_margin="10dp">
<ImageView

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 966 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 898 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 966 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 898 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -13,6 +13,6 @@
android:topLeftRadius="4dp"
android:topRightRadius="20dp"/>
<solid android:color="@color/white"/>
<solid android:color="#EFEBFF"/>
</shape>

View File

@@ -13,6 +13,6 @@
android:bottomRightRadius="20dp"
android:bottomLeftRadius="20dp"/>
<solid android:color="#00D5E8"/>
<solid android:color="#F4F4F4"/>
</shape>

View File

@@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/nim_message_input_voice_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/nim_message_input_voice_normal" android:state_focused="true"/>
<item android:drawable="@drawable/nim_message_input_voice_normal"/>
<item android:drawable="@drawable/nim_message_input_voice_pressed" android:state_focused="true"/>
<item android:drawable="@drawable/nim_message_input_voice_pressed"/>
</selector>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/nim_message_input_keyboard_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/nim_message_input_keyboard_pressed" android:state_focused="true"/>
<item android:drawable="@drawable/nim_message_input_keyboard" android:state_pressed="true"/>
<item android:drawable="@drawable/nim_message_input_keyboard" android:state_focused="true"/>
<item android:drawable="@drawable/nim_message_input_keyboard"/>
</selector>

View File

@@ -5,6 +5,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/nim_message_view_bottom"
android:gravity="center_vertical"
android:paddingBottom="@dimen/bottom_component_margin_vertical"
android:paddingTop="@dimen/bottom_component_margin_vertical">
@@ -12,23 +13,22 @@
android:id="@+id/switchLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/editTextMessage"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/bottom_component_margin_horizontal"
android:layout_marginRight="@dimen/bottom_component_margin_horizontal">
<ImageView
android:id="@+id/buttonAudioMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="29dp"
android:layout_height="29dp"
android:background="@drawable/nim_message_button_bottom_audio_selector"
android:contentDescription="@string/empty"
android:scaleType="center" />
<ImageView
android:id="@+id/buttonTextMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_width="29dp"
android:layout_height="29dp"
android:background="@drawable/nim_message_button_bottom_text_selector"
android:contentDescription="@string/empty"
android:scaleType="center" />
@@ -39,9 +39,9 @@
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/switchLayout"
android:layout_marginRight="@dimen/bottom_component_margin_horizontal"
android:layout_toLeftOf="@+id/emoji_button"
android:layout_toRightOf="@+id/switchLayout">
android:layout_marginEnd="@dimen/bottom_component_margin_horizontal"
android:layout_toStartOf="@+id/emoji_button"
android:layout_toEndOf="@+id/switchLayout">
<Button
@@ -61,14 +61,19 @@
android:textColor="@color/black"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/bottom_component_margin_horizontal"
android:layout_toLeftOf="@+id/emoji_button"
android:layout_toRightOf="@+id/switchLayout"
android:layout_marginEnd="@dimen/bottom_component_margin_horizontal"
android:layout_toStartOf="@+id/emoji_button"
android:layout_toEndOf="@+id/switchLayout"
android:autoLink="web|email|phone"
android:maxLength="40"
android:layout_centerVertical="true"
android:imeOptions="actionSend"
android:inputType="text"
android:background="@color/white"
android:hint="@string/message_hint"
android:textColorHint="#C6C6C6"
android:paddingStart="@dimen/dp_10"
android:paddingEnd="10dp"
android:background="@drawable/bg_message_input"
android:minHeight="35dp"
android:maxHeight="72dp"
android:maxLines="4"
@@ -76,11 +81,11 @@
<ImageView
android:id="@+id/emoji_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/audioTextSwitchLayout"
android:layout_marginRight="@dimen/bottom_component_margin_horizontal"
android:layout_toLeftOf="@+id/sendLayout"
android:layout_width="29dp"
android:layout_height="29dp"
android:layout_marginEnd="@dimen/bottom_component_margin_horizontal"
android:layout_toStartOf="@+id/sendLayout"
android:layout_centerVertical="true"
android:background="@drawable/nim_message_button_bottom_emoji_selector"
android:contentDescription="@string/empty"
android:scaleType="center" />
@@ -89,14 +94,14 @@
android:id="@+id/sendLayout"
android:layout_width="43dp"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/audioTextSwitchLayout"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/bottom_component_margin_horizontal">
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/bottom_component_margin_horizontal">
<ImageView
android:id="@+id/buttonMoreFuntionInText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="29dp"
android:layout_height="29dp"
android:layout_gravity="center"
android:background="@drawable/nim_message_input_plus"
android:contentDescription="@string/empty"
@@ -105,9 +110,7 @@
<TextView
android:id="@+id/buttonSendMessage"
android:layout_width="43dp"
android:layout_height="25dp"
android:layout_gravity="bottom"
android:layout_marginBottom="5dp"
android:layout_height="29dp"
android:background="@drawable/nim_message_button_bottom_send_selector"
android:contentDescription="@string/empty"
android:gravity="center"

View File

@@ -66,7 +66,7 @@
<dimen name="min_bubble_height">49dip</dimen>
<dimen name="resend_button_margin_bottom">3dip</dimen>
<dimen name="first_load_button_bottom">10dip</dimen>
<dimen name="bottom_component_margin_horizontal">6dip</dimen>
<dimen name="bottom_component_margin_horizontal">10dip</dimen>
<dimen name="bottom_component_margin_vertical">8dip</dimen>
<dimen name="bubble_layout_margin_vertical">10dip</dimen>
<dimen name="bubble_time_layout_margin_top">18dip</dimen>

View File

@@ -225,5 +225,6 @@
<string name="fts_prefix_hit">前缀匹配高亮检索结果</string>
<string name="msg_search">全文检索</string>
<string name="msg_search_limit">全文检索显示条数</string>
<string name="message_hint">请输入消息</string>
</resources>

View File

@@ -352,7 +352,7 @@ public abstract class ChatRoomMsgViewHolderBase extends RecyclerViewHolder<BaseM
return;
}
LinearLayout bodyContainer = (LinearLayout) view.findViewById(R.id.message_item_body);
LinearLayout bodyContainer = view.findViewById(R.id.message_item_body);
// 调整container的位置
int index = isReceivedMessage() ? 0 : 3;

View File

@@ -475,7 +475,7 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
return;
}
if (actionPanelBottomLayout == null || actionPanelBottomLayout.getVisibility() == View.GONE) {
moreFuntionButtonInInputBar.setBackgroundResource(R.drawable.ic_chat_close);
moreFuntionButtonInInputBar.setBackgroundResource(R.drawable.nim_message_input_plus_pressed);
showActionPanelLayout();
} else {
moreFuntionButtonInInputBar.setBackgroundResource(R.drawable.nim_message_input_plus);
@@ -978,7 +978,7 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
moreFuntionButtonInInputBar.setEnabled(false);
sendMessageButtonInInputBar.setEnabled(false);
} else {
messageEditText.setHint("");
messageEditText.setHint("请输入消息");
messageEditText.setFocusable(true);
messageEditText.setFocusableInTouchMode(true);
messageEditText.setEnabled(true);

View File

@@ -367,7 +367,7 @@ public abstract class MsgViewHolderBase extends RecyclerViewHolder<BaseMultiItem
return;
}
LinearLayout bodyContainer = (LinearLayout) view.findViewById(R.id.message_item_body);
LinearLayout bodyContainer = view.findViewById(R.id.message_item_body);
// 调整container的位置
int index = isReceivedMessage() ? 0 : 3;