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

优化主页homelist显示局中

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

+ 6 - 11
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -1266,16 +1266,12 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
      * 新手任务
      */
     private void addNewTask(){
-//        if(onResumeCount == 0 && CommonUtil.getInstance().addNewTask(activity,userEntity) && homeListEntitysGridview != null)//第一次才调用
-        {
-            HomeListEntity homeListEntity = new HomeListEntity();
-            homeListEntity.setTitle("新手任务");
-            homeListEntity.setDesc("新手任务");
-            homeListEntity.setJump("-1");
-            homeListEntity.setIcon(R.mipmap.homepage_xinshourw+"");
-            homeListEntitys.add(0, homeListEntity);
-
-        }
+        HomeListEntity homeListEntityNewTask = new HomeListEntity();
+        homeListEntityNewTask.setTitle("新手任务");
+        homeListEntityNewTask.setDesc("新手任务");
+        homeListEntityNewTask.setJump("-1");
+        homeListEntityNewTask.setIcon(R.mipmap.homepage_xinshourw+"");
+        homeListEntitys.add(0, homeListEntityNewTask);
         if(homeListEntitys.size() > 8){
             HomeListEntity homeListEntity = new HomeListEntity();
             homeListEntity.setTitle("查看更多");
@@ -1284,7 +1280,6 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             homeListEntity.setIcon(R.mipmap.homepage_chakangd+"");
             homeListEntitys.add(7, homeListEntity);
         }
-        onResumeCount++;
         setValueList(false);
     }
 

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

@@ -1266,6 +1266,7 @@ public class ViewUtil {
     public void showGridviewStatues(Context context, TextView textView, HomeListEntity entity){
         textView.setVisibility(View.INVISIBLE);
 
+        int padding = textView.getContext().getResources().getDimensionPixelSize(R.dimen.content_padding_2);
         switch (entity.getTag()){
             default:
 
@@ -1275,12 +1276,14 @@ public class ViewUtil {
                 textView.setBackgroundResource(R.drawable.shape_red_stroke_rectangle_no_lb);
                 textView.setTextColor(context.getResources().getColor(R.color.red_FD2D54));
                 textView.setText("现金");
+                textView.setPadding(4 * padding, padding, 4 * padding, padding);
                 break;
             case 4:
                 textView.setVisibility(View.VISIBLE);
                 textView.setBackgroundResource(R.drawable.shape_red_f07422_stroke_retangle_no_lb);
                 textView.setTextColor(context.getResources().getColor(R.color.red_F07422));
                 textView.setText("活跃");
+                textView.setPadding(4 * padding, padding, 4 * padding, padding);
                 break;
         }
 

+ 1 - 2
app/src/main/res/layout/adp_homelist_gridview_new.xml

@@ -4,14 +4,13 @@
     android:layout_height="match_parent"
     android:orientation="horizontal"
     android:paddingBottom="@dimen/content_padding_10"
-    android:paddingEnd="@dimen/content_padding_10"
-    android:paddingStart="@dimen/content_padding_10"
     android:paddingTop="@dimen/content_padding_10">
 
     <LinearLayout
         android:id="@+id/linearlayout"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:layout_centerHorizontal="true"
         android:orientation="vertical"
         android:gravity="center"
         android:layout_marginTop="@dimen/content_padding_4">