Browse Source

预设 text 高度

liuzhenxing1118 2 years ago
parent
commit
4663057f3f

+ 3 - 0
app/src/main/java/com/xplora/xpchat/activity/PagerActivity.java

@@ -939,6 +939,9 @@ public class PagerActivity extends BaseActivity implements Listener.PlayListener
             return;
         new Thread(()->{
             for (int i = 0; i < arrayList.size(); i++) {
+                //屏蔽array size 变化
+                if (i >= arrayList.size())
+                    return;
                 Object value = arrayList.get(i);
                 if (value == null)
                     continue;

+ 12 - 20
app/src/main/res/layout/item_title_center.xml

@@ -1,27 +1,19 @@
 <?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"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     >
 
-    <FrameLayout
+    <TextView
+        android:id="@+id/item_title"
         android:layout_width="match_parent"
-        android:layout_height="38dp"
-        android:layout_gravity="center"
-        android:layout_marginLeft="25dp"
-        android:layout_marginRight="25dp"
-        >
+        android:layout_height="45dp"
+        android:fontFamily="Roboto"
+        android:textStyle="bold"
+        android:textColor="@color/white"
+        android:textSize="12sp"
+        android:textAlignment="center"
+        android:gravity="center"
+        />
 
-        <TextView
-            android:id="@+id/item_title"
-            android:layout_width="match_parent"
-            android:layout_height="34dp"
-            android:gravity="center"
-            android:fontFamily="Roboto"
-            android:textFontWeight="700"
-            android:textColor="@color/white"
-            android:textSize="12sp"
-            />
-    </FrameLayout>
-
-</LinearLayout>
+</RelativeLayout>