Skip to content

Commit

Permalink
1、显示发信人昵称 2、添加忽略文件规则
Browse files Browse the repository at this point in the history
  • Loading branch information
soulofhan committed Nov 1, 2018
1 parent 227fe8b commit 7cd81f2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
.gradle/
.idea/
LANTalk.iml
local.properties

# Mobile Tools for Java (J2ME)
.mtj.tmp/
Expand Down
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
app.iml
3 changes: 2 additions & 1 deletion app/src/main/java/com/andeddo/lanchat/ChatAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ public View getView(int position, View convertView, ViewGroup parent) {
} else {
//显示接收消息
convertView = View.inflate(context,R.layout.chat_dialog_left_item,null);
// holderView.tv_name = convertView.findViewById(R.id.tv_name); //绑定接收昵称TextView
holderView.tv_name = convertView.findViewById(R.id.tv_name); //绑定接收昵称TextView
holderView.tv_chat_message = convertView.findViewById(R.id.tv_chat_message); //绑定消息显示TextView
holderView.tv_name.setText(entity.getName());
holderView.tv_chat_message.setText(entity.getChatMsg()); //显示消息
}
if(isTip){
Expand Down
27 changes: 23 additions & 4 deletions app/src/main/res/layout/chat_dialog_left_item.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
Expand All @@ -8,16 +9,34 @@
android:id="@+id/iv_chat_image_left"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_gravity="top"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
android:src="@drawable/message_background" />

<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="28dp"
android:gravity="center"
android:text="@string/tv_default"
android:textSize="8sp"
tools:ignore="SmallSp" />

<TextView
android:id="@+id/tv_chat_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="26dp"
android:layout_marginTop="12dp"
android:background="@drawable/acn"
android:text="@string/tv_default" />

</LinearLayout>
</RelativeLayout>
4 changes: 3 additions & 1 deletion app/src/main/res/layout/chat_dialog_right_item.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
Expand All @@ -13,7 +14,8 @@
android:layout_marginEnd="28dp"
android:gravity="center"
android:text="@string/tv_default"
android:textSize="8dp" />
android:textSize="8sp"
tools:ignore="SmallSp" />

<TextView
android:id="@+id/tv_chat_me_message"
Expand Down

0 comments on commit 7cd81f2

Please sign in to comment.