Procházet zdrojové kódy

优化比一比按钮大小

zengjiebin před 7 roky
rodič
revize
62cc7c92a4

+ 5 - 4
app/src/main/java/com/sheep/gamegroup/module/game/adapter/AdpGameGroupGameCompare.java

@@ -25,10 +25,10 @@ public class AdpGameGroupGameCompare extends BaseQuickAdapter<Applications, Base
         super(R.layout.item_game_group_game_compare, data);
     }
 
-    public static final boolean canDownload = false;
+    public static boolean canDownload = false;
     @Override
     protected void convert(BaseViewHolder helper, Applications item) {
-        TextView item_gggc_download_tv = helper.itemView.findViewById(R.id.item_gggc_download_tv);
+        TextView item_gggc_download_tv = helper.getView(R.id.item_gggc_download_tv);
         View item_gggc_v_line = helper.itemView.findViewById(R.id.item_gggc_v_line);
         TextView item_gggc_vip_tv = helper.itemView.findViewById(R.id.item_gggc_vip_tv);
         TextView item_gggc_name_tv = helper.itemView.findViewById(R.id.item_gggc_name_tv);
@@ -42,8 +42,9 @@ public class AdpGameGroupGameCompare extends BaseQuickAdapter<Applications, Base
             item.getFindAppHelper().updateDownloadTaskView(true, item, item_gggc_download_tv);
             item_gggc_download_tv.setTag("PUBLIC_TAG_PREFIX_TEXTVIEW_LIST" + item.getDownload_link());
         }
-        ViewUtil.setVisibility(item_gggc_vip_tv, item.hasGameDiscountId());
-        ViewUtil.setVisibility(item_gggc_v_line, item.hasGameDiscountId());
+        boolean showVipTv = item.hasGameDiscountId();
+        ViewUtil.setVisibility(item_gggc_vip_tv, showVipTv);
+        ViewUtil.setVisibility(item_gggc_v_line, showVipTv);
         ViewUtil.setText(item_gggc_name_tv, item.getGameFrom());
         ViewUtil.setText(item_gggc_info_tv, item.getSimpleInfo());
         ViewUtil.setText(item_gggc_score_tv, NumberFormatUtils.retain1(item.getScore())+"分");

+ 7 - 0
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -17,6 +17,7 @@ import android.media.MediaPlayer;
 import android.net.Uri;
 import android.os.Build;
 import android.provider.MediaStore;
+import android.support.annotation.DimenRes;
 import android.support.annotation.LayoutRes;
 import android.support.annotation.Nullable;
 import android.support.annotation.StringRes;
@@ -340,6 +341,12 @@ public class ViewUtil {
             view.setChecked(checked);
     }
 
+    public static void setTextSize(TextView textView, int tsType, int textSize) {
+        if(textView != null){
+            textView.setTextSize(tsType, textSize);
+        }
+    }
+
     /**
      * 主页抢任务,更换任务时,获取新的任务
      *

+ 1 - 1
app/src/main/res/layout/item_game_group_game_compare.xml

@@ -45,7 +45,7 @@
         android:id="@+id/item_gggc_ll1"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginEnd="110dp"
+        android:layout_marginEnd="100dp"
         android:gravity="center_vertical"
         android:orientation="horizontal"
         app:layout_constraintBottom_toTopOf="@id/item_gggc_ll2"

+ 3 - 3
app/src/main/res/values/dd_styles.xml

@@ -515,13 +515,13 @@
     </style>
     <!-- 会员通道textView 样式-->
     <style name="style_vip_td_tv">
-        <item name="android:layout_width">80dp</item>
-        <item name="android:layout_height">30dp</item>
+        <item name="android:layout_width">70dp</item>
+        <item name="android:layout_height">22dp</item>
         <item name="android:background">@drawable/shape_vip_gradient_rectangle_15</item>
         <item name="android:gravity">center</item>
         <item name="android:text">会员通道</item>
         <item name="android:textColor">#714E36</item>
-        <item name="android:textSize">14sp</item>
+        <item name="android:textSize">12sp</item>
     </style>
 
     <style name="style_vip_td_tv2">