Răsfoiți Sursa

Apex Mobile
优化detail 显示

Ray Zhang 8 ani în urmă
părinte
comite
f8c48a4baf

+ 4 - 1
Apex Mobile/app/src/main/java/com/usai/apex/DetailFragment.java

@@ -464,7 +464,7 @@ public class DetailFragment extends Fragment implements OnClickListener /*
 						ConstraintLayout listitem = (ConstraintLayout) inflater
 								.inflate(R.layout.detail_tracking_cell, null);
 
-						ViewGroup.LayoutParams lp1=listitem.getLayoutParams();
+
 						ImageView icon = (ImageView)  listitem
 								.findViewById(R.id.iv_icon);
 
@@ -488,7 +488,10 @@ public class DetailFragment extends Fragment implements OnClickListener /*
 						// tvitem.setBackgroundResource(R.drawable.detail_item);
 					//	listitem.removeView(tvitem);
 
+						int px=commonUtil.dp2px(getActivity(),56);
+						listitem.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, px, 1));
 						listview.addView(listitem);
+//						ViewGroup.LayoutParams lp1=listitem.getLayoutParams();
 					}
 
 				}

+ 22 - 0
Apex Mobile/app/src/main/res/drawable/border.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
+    <!--&lt;!&ndash; 渐变 &ndash;&gt;-->
+    <!--&lt;!&ndash;<gradient android:angle="180" android:endColor="#FFCCCCCC"&ndash;&gt;-->
+    <!--&lt;!&ndash;android:startColor="@android:color/white" />&ndash;&gt;-->
+    <!--&lt;!&ndash; 描边 &ndash;&gt;-->
+    <!--<stroke android:width="1dp" android:color="@android:color/darker_gray" />-->
+
+
+
+    <!-- 描边 -->
+    <stroke android:width="0.3dp" android:color="@android:color/darker_gray" />
+
+    <!-- 实心填充 -->
+    <solid android:color="@android:color/white" />
+
+    <!--&lt;!&ndash; 圆角 &ndash;&gt;-->
+    <!--<corners android:bottomLeftRadius="8dip"-->
+        <!--android:bottomRightRadius="8dip" android:topLeftRadius="8dip"-->
+        <!--android:topRightRadius="8dip" />-->
+
+</shape>

+ 5 - 5
Apex Mobile/app/src/main/res/layout/detail_fragment.xml

@@ -15,8 +15,8 @@
             android:id="@+id/ll_root"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:background="@android:color/holo_blue_bright"
-            android:orientation="vertical" >
+            android:background="@color/white"
+            android:orientation="vertical">
 
             <TextView
                 android:id="@+id/tv_empty"
@@ -31,11 +31,11 @@
                 android:id="@+id/ll_refresh"
                 android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
-                
+
+                android:background="#FFF5F5F5"
                 android:gravity="center_horizontal"
                 android:orientation="vertical"
-                android:background="#FFF5F5F5"
-                android:visibility="gone" >
+                android:visibility="gone">
 
                 <TextView
                     android:id="@+id/tv_ver"

+ 15 - 9
Apex Mobile/app/src/main/res/layout/group_tag.xml

@@ -1,18 +1,24 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/constraintLayout"
     android:layout_width="match_parent"
-    android:layout_height="match_parent" 
-    android:background="@drawable/detail_tag">
-    
+    android:layout_height="wrap_content"
+    android:background="@android:color/darker_gray">
+
 
     <TextView
         android:id="@+id/tv_group"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_alignParentTop="true"
-        android:drawableLeft="@android:drawable/arrow_down_float"
+        android:layout_marginBottom="4dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="4dp"
         android:text="TextView"
-        android:textAppearance="?android:attr/textAppearanceMedium" />
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        />
 
-</RelativeLayout>
+</android.support.constraint.ConstraintLayout>

+ 10 - 8
Apex Mobile/app/src/main/res/layout/keymapping_item.xml

@@ -8,21 +8,23 @@
         android:id="@+id/tv_key"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:text="Key"
+        android:layout_weight="1"
+        android:background="@drawable/border"
         android:gravity="center_vertical"
-        android:layout_weight="1" 
-        android:textStyle="bold"
+        android:padding="8dp"
+        android:text="Key"
         android:textColor="#FF000000"
-        android:background="@drawable/detail_item"/>
+        android:textStyle="bold" />
 
     <TextView
         android:id="@+id/tv_value"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:gravity="center_vertical"
-        android:text="Value" 
         android:layout_weight="1"
-        android:textColor="#FF000000"
-        android:background="@drawable/detail_item"/>
+        android:background="@drawable/border"
+        android:gravity="center_vertical"
+        android:padding="8dp"
+        android:text="Value"
+        android:textColor="#FF000000" />
 
 </LinearLayout>

+ 4 - 3
Apex Mobile/app/src/main/res/layout/list_item.xml

@@ -9,8 +9,9 @@
         android:layout_height="wrap_content"
         android:layout_alignParentLeft="true"
         android:layout_alignParentTop="true"
-        android:text="TextView" 
-        android:textColor="#FF000000"
-        android:background="@drawable/detail_item"/>
+        android:background="@drawable/border"
+        android:padding="8dp"
+        android:text="TextView"
+        android:textColor="#FF000000" />
 
 </RelativeLayout>

BIN
Apex Mobile/captures/com.usai.apex_2018.02.28_14.38.li