Browse Source

调整交易帖UI

Junqin Wang 8 years ago
parent
commit
215ae40d7e

+ 1 - 1
app/res/drawable/style_rounded_corner_editext.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
     <corners android:radius="8dp"/>
-    <stroke android:color="@color/color_grey_555555"
+    <stroke android:color="@color/green_4DC0A4"
         android:width="1dp" />
 </shape>

+ 1 - 0
app/res/layout/trade_list_item.xml

@@ -92,6 +92,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="置顶101"
+            android:textColor="@color/green_4DC0A4"
             android:background="@drawable/style_rounded_corner_editext"
             android:padding="4dp"
             android:layout_marginLeft="0dp"

+ 16 - 7
app/src/com/sheishuo/app/core_module/trade/view/adapter/TradeItemAdapter.java

@@ -25,6 +25,7 @@ import com.sheishuo.app.common.util.img.ImgUtil;
 import com.sheishuo.app.common.views.GridViewAdapter;
 import com.sheishuo.app.common.views.ImgGridView;
 import com.sheishuo.app.common.views.PartlyHighLightTextView;
+import com.sheishuo.app.core_module.trade.model.TradeModel;
 import com.sheishuo.app.core_module.trade.view.ui.activity.TradeChangePriorityActivity;
 import com.sheishuo.app.login.beans.LoginBean;
 import com.sheishuo.app.main.fragment.TradeListFragment;
@@ -79,12 +80,20 @@ public class TradeItemAdapter extends RecyclerView.Adapter<TradeItemAdapter.Trad
         //设置交易帖内容和地区标注
         holder.content.setText(bean.getMsg());
         String highLightStr = "";
-        if (!bean.getCity().isEmpty()){
-            highLightStr = "[" + bean.getCity() + "]";
-        }
+
         if (!bean.getDistrict().isEmpty()){
             highLightStr = highLightStr + "[" + bean.getDistrict() + "]";
+        }else {
+            highLightStr = highLightStr + "[全国]";
         }
+
+        if (Integer.valueOf(bean.getType()) == TradeModel.TYPE_SELL){
+            highLightStr = highLightStr + "[出售]";
+        }else if(Integer.valueOf(bean.getType()) == TradeModel.TYPE_BUY){
+            highLightStr = highLightStr + "[求购]";
+        }
+
+
         if (!highLightStr.isEmpty()){
             holder.content.addHightlightStr(highLightStr,R.color.green_4DC0A4);
         }
@@ -96,16 +105,16 @@ public class TradeItemAdapter extends RecyclerView.Adapter<TradeItemAdapter.Trad
         //判断有无置顶加权
         switch (bean.getPriority_type()){
             case PRIORITY_DISTRICT:
-                holder.priority.setText("地区 " + bean.getPriority());
+                holder.priority.setText("地区x" + bean.getPriority());
                 break;
             case PRIORITY_CITY:
-                holder.priority.setText("城市 " + bean.getPriority());
+                holder.priority.setText("城市x" + bean.getPriority());
                 break;
             case PRIORITY_PROVINCE:
-                holder.priority.setText("省份 " + bean.getPriority());
+                holder.priority.setText("省份x" + bean.getPriority());
                 break;
             case PRIORITY_COUNTRY:
-                holder.priority.setText("国家 " + bean.getPriority());
+                holder.priority.setText("国家x" + bean.getPriority());
                 break;
         }