Просмотр исходного кода

非新年皮肤情况下,homelist大小调整

zengjiebin лет назад: 7
Родитель
Сommit
a61d436fa0

+ 11 - 1
app/src/main/java/com/sheep/gamegroup/absBase/AbsObserver.java

@@ -1,6 +1,9 @@
 package com.sheep.gamegroup.absBase;
 
+import android.app.Activity;
+
 import com.sheep.gamegroup.util.TestUtil;
+import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 
 import io.reactivex.Observer;
@@ -23,7 +26,14 @@ public class AbsObserver<T> implements Observer<T> {
 
     @Override
     public void onError(Throwable e) {
-        if(TestUtil.isDev()) G.showToast(e.getMessage());
+        if(TestUtil.isDev()) {
+            Activity activity = SheepApp.getInstance().getCurrentActivity();
+            if(activity != null){
+                activity.runOnUiThread(() -> G.showToast(e));
+            } else {
+                e.printStackTrace();
+            }
+        }
     }
 
     @Override

+ 5 - 0
app/src/main/java/com/sheep/gamegroup/module/home/adapter/AdpHomeList.java

@@ -21,6 +21,11 @@ import java.util.List;
  */
 public class AdpHomeList<T extends IHomeList> extends BaseQuickAdapter<T, BaseViewHolder> {
 
+
+    public AdpHomeList(int layoutResId, @Nullable List<T> data) {
+        super(layoutResId, data);
+    }
+
     public AdpHomeList(@Nullable List<T> data) {
         super(R.layout.item_my_list_but, data);
     }

+ 1 - 3
app/src/main/java/com/sheep/gamegroup/module/skin/util/SkinUtil.java

@@ -127,8 +127,6 @@ public class SkinUtil {
             return Plugin.skin_new_year;
         } else if(isChristmas(year, month, day)){//元旦
             return Plugin.skin_christmas;
-        } else if(TestUtil.isTest()){
-            return Plugin.skin_new_year;
         }
         return null;
     }
@@ -138,7 +136,7 @@ public class SkinUtil {
     }
 
     private static boolean isNewYear(int year, int month, int day) {
-        return year == 2019 && month == 2 && day > 3 && day < 20;
+        return year == 2019 && month == 2 && day < 20;// && day < 3;
     }
 
     public static String getSkinPath(String skinName) {

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java

@@ -922,7 +922,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
         tryMakeMoneyAdp.addPresenter(tryMakeMoneyPresenter);
         recyclerview.setAdapter(tryMakeMoneyAdp);
 
-        adpHomeList = new AdpHomeList<>(homeListList);
+        adpHomeList = new AdpHomeList<>(SkinUtil.isLoadNewYearSkin() ? R.layout.new_year_item_my_list_but : R.layout.item_my_list_but, homeListList);
 
         GridLayoutManager manager = new GridLayoutManager(SheepApp.getInstance(), 4);
         home_list_rv.setHasFixedSize(true);

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

@@ -10,7 +10,7 @@
         android:id="@+id/my_item_img"
         android:layout_width="match_parent"
         android:layout_marginEnd="5dp"
-        android:layout_height="53dp"
+        android:layout_height="47dp"
         android:scaleType="fitCenter"
         android:src="@drawable/icon" />
 

+ 41 - 0
app/src/main/res/layout/new_year_item_my_list_but.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/my_item_but"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:paddingTop="10dp"
+    android:paddingBottom="10dp">
+
+    <ImageView
+        android:id="@+id/my_item_img"
+        android:layout_width="match_parent"
+        android:layout_marginEnd="5dp"
+        android:layout_height="53dp"
+        android:scaleType="fitCenter"
+        android:src="@drawable/icon" />
+
+    <TextView
+        android:id="@+id/my_item_text"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/my_item_img"
+        android:layout_marginTop="5dp"
+        android:layout_marginEnd="5dp"
+        android:singleLine="true"
+        android:gravity="center"
+        android:text="试玩赚钱"
+        android:textColor="@color/black_6_3"
+        android:textSize="13sp" />
+
+    <TextView
+        android:id="@+id/my_item_tag"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentTop="true"
+        android:layout_alignParentEnd="true"
+        android:layout_marginEnd="5dp"
+        android:gravity="center"
+        android:text="试玩"
+        android:textColor="@color/black_6_3"
+        android:textSize="7sp" />
+</RelativeLayout>