Explorar el Código

优化界面显示

weizhengliang hace 3 años
padre
commit
e312bdb5be

+ 18 - 0
common/src/main/code/com/wdkl/ncs/android/lib/widget/MarqueeTextView.kt

@@ -0,0 +1,18 @@
+package com.wdkl.ncs.android.lib.widget
+
+import android.content.Context
+import android.util.AttributeSet
+import android.widget.TextView
+
+class MarqueeTextView : TextView {
+
+    constructor(context: Context) : super(context)
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
+
+    constructor(context: Context, attrs: AttributeSet, def: Int) : super(context, attrs, def)
+
+    override fun isFocused(): Boolean {
+        return true
+    }
+}

+ 10 - 22
home/src/main/res/layout/adapter_channel_im_records_item.xml

@@ -24,28 +24,6 @@
                 android:text=""
                 android:textSize="18sp" />
 
-            <LinearLayout
-                android:layout_width="wrap_content"
-                android:layout_height="match_parent"
-                android:layout_marginTop="5dp"
-                android:layout_marginEnd="10dp"
-                android:layout_weight="1"
-                android:gravity="right"
-                android:orientation="horizontal">
-
-                <TextView
-                    android:id="@+id/im_call_time_tv"
-                    android:layout_width="wrap_content"
-                    android:layout_height="match_parent"
-                    android:layout_gravity="center_vertical"
-                    android:layout_marginStart="5dp"
-                    android:gravity="right"
-                    android:orientation="horizontal"
-                    android:text=""
-                    android:textSize="14sp" />
-
-            </LinearLayout>
-
         </LinearLayout>
 
         <LinearLayout
@@ -56,6 +34,16 @@
             android:gravity="right"
             android:orientation="horizontal">
 
+            <TextView
+                android:id="@+id/im_call_time_tv"
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_weight="1"
+                android:layout_gravity="center_vertical"
+                android:layout_marginStart="10dp"
+                android:text=""
+                android:textSize="14sp" />
+
             <ImageView
                 android:id="@+id/im_treatment_state_imagev"
                 android:layout_width="30dp"

+ 6 - 2
home/src/main/res/layout/watch_activity_home2.xml

@@ -124,7 +124,7 @@
                             android:layout_marginTop="10dp"
                             android:src="@drawable/hu_shi_to_xiang" />
 
-                        <TextView
+                        <com.wdkl.ncs.android.lib.widget.MarqueeTextView
                             android:id="@+id/watch_name_tv"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
@@ -132,7 +132,11 @@
                             android:paddingStart="5dp"
                             android:paddingEnd="5dp"
                             android:textColor="#ffffff"
-                            android:textSize="16sp" />
+                            android:textSize="16sp"
+                            android:singleLine="true"
+                            android:ellipsize="marquee"
+                            android:focusable="true"
+                            android:focusableInTouchMode="true"/>
 
                         <TextView
                             android:id="@+id/watch_role_name_tv"