liuzhenxing1118 2 жил өмнө
parent
commit
4f7ce133c9

+ 2 - 1
app/src/main/java/com/xplora/xpchat/adapter/RecyclerAdapter.java

@@ -50,7 +50,8 @@ public class RecyclerAdapter extends RecyclerView.Adapter<GridView> {
     }
 
     public void setAppViewHolder(@NonNull GridView viewHolder, int index, GridModel gridModel) {
-        viewHolder.mTitle.setText(gridModel.title);
+        String s = gridModel.title.length() <= 7 ? gridModel.title : gridModel.title.substring(0, 7) + "...";
+        viewHolder.mTitle.setText(s);
 
         if (viewHolder.mCountButton != null) {
             if (gridModel.count <= 0) {

+ 1 - 1
app/src/main/java/com/xplora/xpchat/manager/DatabaseUtils.java

@@ -385,7 +385,7 @@ public class DatabaseUtils {
         for (int i = 0; i < 10; i++) {
             ContactBean bean = new ContactBean();
             bean.userId = "2000";
-            bean.name = "gwandmagm";
+            bean.name = "gwagghammmmds";
             bean.unRead = 5;
             arrayList.add(bean);
         }

+ 2 - 1
app/src/main/java/com/xplora/xpchat/view/ChatItem.java

@@ -109,7 +109,8 @@ public class ChatItem {
         if (mNameTv != null) {
             ContactBean contactBean = messageBean.contactBean;
             if (contactBean != null) {
-                mNameTv.setText(contactBean.name);
+                String s = contactBean.name.length() <= 7 ? contactBean.name : contactBean.name.substring(0, 7) + "...";
+                mNameTv.setText(s);
             }
         }
     }

+ 1 - 4
app/src/main/res/layout/item_contacts.xml

@@ -21,15 +21,12 @@
             />
 
         <TextView
-            android:layout_width="45dp"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="app name"
             android:textColor="@color/white"
             android:textSize="8dp"
             android:gravity="center"
             android:id="@+id/title"
-            android:ellipsize="end"
-            android:maxLines="1"
             />
     </LinearLayout>
 

+ 1 - 3
app/src/main/res/layout/item_other_emoji.xml

@@ -14,15 +14,13 @@
         >
         <TextView
             android:id="@+id/mNameTv"
-            android:layout_width="47dp"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginStart="15dp"
             android:fontFamily="Roboto"
             android:textFontWeight="500"
             android:textSize="9dp"
             android:textColor="@color/white"
-            android:ellipsize="end"
-            android:maxLines="1"
             />
 
         <TextView

+ 1 - 3
app/src/main/res/layout/item_other_photo.xml

@@ -14,15 +14,13 @@
         >
         <TextView
             android:id="@+id/mNameTv"
-            android:layout_width="47dp"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginStart="15dp"
             android:fontFamily="Roboto"
             android:textFontWeight="500"
             android:textSize="9dp"
             android:textColor="@color/white"
-            android:ellipsize="end"
-            android:maxLines="1"
             />
 
         <TextView

+ 1 - 3
app/src/main/res/layout/item_other_text.xml

@@ -14,15 +14,13 @@
         >
         <TextView
             android:id="@+id/mNameTv"
-            android:layout_width="47dp"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginStart="15dp"
             android:fontFamily="Roboto"
             android:textFontWeight="500"
             android:textSize="9dp"
             android:textColor="@color/white"
-            android:ellipsize="end"
-            android:maxLines="1"
             />
 
         <TextView

+ 1 - 3
app/src/main/res/layout/item_other_video.xml

@@ -14,15 +14,13 @@
         >
         <TextView
             android:id="@+id/mNameTv"
-            android:layout_width="47dp"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginStart="15dp"
             android:fontFamily="Roboto"
             android:textFontWeight="500"
             android:textSize="9dp"
             android:textColor="@color/white"
-            android:ellipsize="end"
-            android:maxLines="1"
             />
 
         <TextView

+ 1 - 3
app/src/main/res/layout/item_other_voice.xml

@@ -15,15 +15,13 @@
         >
         <TextView
             android:id="@+id/mNameTv"
-            android:layout_width="47dp"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginStart="15dp"
             android:fontFamily="Roboto"
             android:textFontWeight="500"
             android:textSize="9dp"
             android:textColor="@color/white"
-            android:ellipsize="end"
-            android:maxLines="1"
             />
 
         <TextView