Selaa lähdekoodia

添加首页homeList中三种新的标签:热门、最新、福利
验证homeList中龙猫的方法修改为标题以龙猫开头

zengjiebin 7 vuotta sitten
vanhempi
commit
db92d8ac77

+ 3 - 4
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -532,8 +532,8 @@ public class CommonUtil {
 
         }
     }
-
-    public static final String LONG_MAO_APP_NAME = "龙猫竞猜";
+    //以龙猫开头的则认为是龙猫app
+    public static final String LONG_MAO_APP_NAME = "龙猫";
     public static final String LONG_MAO_APP_PACKAGE_NAME = "com.cfyl.galesaur.guess";
     public static final String LONG_MAO_APP_URI = "guess://longmao";
 
@@ -545,8 +545,7 @@ public class CommonUtil {
      * @return 判断到已经安装,返回false
      */
     private boolean checkLongMao(Activity activity, HomeListEntity entity) {
-        if (TextUtils.equals(entity.getTitle(), LONG_MAO_APP_NAME) && PackageUtil.isAppInstalled(SheepApp.getInstance(), LONG_MAO_APP_PACKAGE_NAME)) {
-
+        if (entity.getTitle() != null && entity.getTitle().startsWith(LONG_MAO_APP_NAME) && PackageUtil.isAppInstalled(SheepApp.getInstance(), LONG_MAO_APP_PACKAGE_NAME)) {
             try {
                 PackageUtil.startApp(SheepApp.getInstance(), LONG_MAO_APP_PACKAGE_NAME);
             } catch (Exception ignore) {

+ 22 - 1
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -1660,6 +1660,20 @@ public class ViewUtil {
             default:
 
                 break;
+            case 1:
+                textView.setVisibility(View.VISIBLE);
+                textView.setBackgroundResource(R.drawable.shape_red_stroke_rectangle_no_lb);
+                textView.setTextColor(context.getResources().getColor(R.color.red_FD2D54));
+                textView.setText("热门");
+                textView.setPadding(padding2, padding1, padding2, padding1);
+                break;
+            case 2:
+                textView.setVisibility(View.VISIBLE);
+                textView.setBackgroundResource(R.drawable.shape_red_stroke_rectangle_no_lb);
+                textView.setTextColor(context.getResources().getColor(R.color.red_FD2D54));
+                textView.setText("最新");
+                textView.setPadding(padding2, padding1, padding2, padding1);
+                break;
             case 3:
                 textView.setVisibility(View.VISIBLE);
                 textView.setBackgroundResource(R.drawable.shape_red_stroke_rectangle_no_lb);
@@ -1669,11 +1683,18 @@ public class ViewUtil {
                 break;
             case 4:
                 textView.setVisibility(View.VISIBLE);
-                textView.setBackgroundResource(R.drawable.shape_red_f07422_stroke_retangle_no_lb);
+                textView.setBackgroundResource(R.drawable.shape_f07422_stroke_retangle_no_lb);
                 textView.setTextColor(context.getResources().getColor(R.color.red_F07422));
                 textView.setText("活跃");
                 textView.setPadding(padding2, padding1, padding2, padding1);
                 break;
+            case 5:
+                textView.setVisibility(View.VISIBLE);
+                textView.setBackgroundResource(R.drawable.shape_f07422_stroke_retangle_no_lb);
+                textView.setTextColor(context.getResources().getColor(R.color.red_F07422));
+                textView.setText("福利");
+                textView.setPadding(padding2, padding1, padding2, padding1);
+                break;
         }
 
     }

app/src/main/res/drawable/shape_red_f07422_stroke_retangle_no_lb.xml → app/src/main/res/drawable/shape_f07422_stroke_retangle_no_lb.xml