Parcourir la source

修复几个bug

zengjiebin il y a 7 ans
Parent
commit
b12e0572ea

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

@@ -472,7 +472,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         //recyclerView 解决滑动不流畅问题
         recyclerview.setHasFixedSize(true);
         recyclerview.setNestedScrollingEnabled(false);
-        tryMakeMoneyAdp = new TryMakeMoneyAdp(activity);
+        tryMakeMoneyAdp = new TryMakeMoneyAdp(activity, 1);//1代表来自主页
         for (int i = 0; i < 2; i++) {
             tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.NONE, null));
         }

+ 11 - 12
app/src/main/java/com/sheep/gamegroup/presenter/SmallSheepPresenter.java

@@ -116,22 +116,21 @@ public class SmallSheepPresenter implements SmallSheepContract.Persenter {
                     }
                 });
     }
-    private SheepSubscriber<BaseMessage> bulletinSs = new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
-        @Override
-        public void onError(BaseMessage baseMessage) {
-            view.failbulletin(baseMessage);
-        }
-
-        @Override
-        public void onNext(BaseMessage baseMessage) {
-            view.successbulletin(baseMessage);
-        }
-    };
     @Override
     public void bulletin(Object o) {
         apiService.bulletin(1,10)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(bulletinSs);
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        view.failbulletin(baseMessage);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        view.successbulletin(baseMessage);
+                    }
+                });
     }
 }

+ 0 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/ActFindInformation.java

@@ -170,8 +170,6 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
         TextView find_information_game_name = (TextView)itemView.findViewById(R.id.find_information_game_name);
         TextView find_information_game_surplus = (TextView)itemView.findViewById(R.id.find_information_game_surplus);
         TextView find_information_game_time = (TextView)itemView.findViewById(R.id.find_information_game_time);
-        TextView find_information_game_yuan = (TextView)itemView.findViewById(R.id.find_information_game_yuan);
-        TextView find_information_game_task_bottom = (TextView)itemView.findViewById(R.id.find_information_game_task_bottom);
         TextView find_information_game_task_center = (TextView)itemView.findViewById(R.id.find_information_game_task_center);
         GlideImageLoader.setGameImage(find_information_game_icon, findApp.getIcon());
         ViewUtil.setText(find_information_game_name, findApp.getName());
@@ -181,8 +179,6 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
             ViewUtil.setText(find_information_game_time, String.format(Locale.CHINA, "开放时间:%s", TimeUtil.TimeStamp2Date(findApp.getDownload_at(), "yyyy-MM-dd\u0020HH:mm")));
         else
             ViewUtil.setText(find_information_game_time, String.format(Locale.CHINA, "厂商:%s\u0020包体大小:%sM", findApp.getManufacturer(),findApp.getPackage_size()));
-        find_information_game_yuan.setVisibility(View.GONE);
-        find_information_game_task_bottom.setVisibility(View.GONE);
         find_information_game_task_center.setVisibility(View.VISIBLE);
 
         updateView(this,findApp, find_information_game_task_center);

+ 15 - 11
app/src/main/java/com/sheep/gamegroup/view/adapter/AdListAdapter.java

@@ -167,17 +167,21 @@ public class AdListAdapter extends android.support.v7.widget.RecyclerView.Adapte
             appViewHolder.mDownloadTv.setText("继续体验");
         } else {
             String downloadState = ACache.get(SheepApp.getInstance()).getAsString(String.format(Locale.CHINA, "%s%s", AdManager.class.getSimpleName(), data.getId()));
-            switch (downloadState){
-                case "onDownloadStart":
-                    appViewHolder.mDownloadTv.setText("正在下载");
-                    break;
-                case "onDownloadSuccess":
-                    appViewHolder.mDownloadTv.setText("立即安装");
-                    break;
-                case "onDownloadFail":
-                default:
-                    appViewHolder.mDownloadTv.setText("立即下载");
-                    break;
+            if(downloadState == null){
+                appViewHolder.mDownloadTv.setText("立即下载");
+            } else {
+                switch (downloadState) {
+                    case "onDownloadStart":
+                        appViewHolder.mDownloadTv.setText("正在下载");
+                        break;
+                    case "onDownloadSuccess":
+                        appViewHolder.mDownloadTv.setText("立即安装");
+                        break;
+                    case "onDownloadFail":
+                    default:
+                        appViewHolder.mDownloadTv.setText("立即下载");
+                        break;
+                }
             }
         }
     }

+ 24 - 4
app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java

@@ -80,6 +80,7 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
     @Inject
     TryMakeMoneyPresenter presenter;
     private Context context;
+    private int from;// 1 来自主页
     private int type = 0;//0:推荐 1:热门 2:预约 3:游戏推荐
     private int is_succession;//0:一般任务 1:连续任务
 
@@ -87,6 +88,11 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
         super(context);
         this.context = context;
     }
+    public TryMakeMoneyAdp(Context context, int from) {
+        super(context);
+        this.context = context;
+        this.from = from;
+    }
 
     @Override
     public int getViewIdByType(int type) {
@@ -564,8 +570,15 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
                 }
                 viewHolder.itemView.setTag(TAG_ID_TEMP, etyList.get(i).getId());
                 ((TextView) viewHolder.itemView.findViewById(R.id.item_name_tv)).setText(taskReleaseEty.getName() + "");
-                TaskHelper.setTaskTypeText((TextView) viewHolder.itemView.findViewById(R.id.item_num_tv), taskReleaseEty);
-                TaskHelper.setNumText((TextView) viewHolder.itemView.findViewById(R.id.item_num_tv1), taskReleaseEty);
+                switch (from) {
+                    case 1://来自主页
+                        TaskHelper.setTaskTypeText((TextView) viewHolder.itemView.findViewById(R.id.item_num_tv), taskReleaseEty);
+                        TaskHelper.setNumText((TextView) viewHolder.itemView.findViewById(R.id.item_num_tv1), taskReleaseEty);
+                        break;
+                    default:
+                        TaskHelper.setNumText((TextView) viewHolder.itemView.findViewById(R.id.item_num_tv), taskReleaseEty);
+                        break;
+                }
                 ((TextView) viewHolder.itemView.findViewById(R.id.item_money)).setText("+" + taskReleaseEty.getBonus() + "元");
 
                 GlideImageLoader.setGameImage((ImageView) viewHolder.itemView.findViewById(R.id.item_icon_iv), taskEty.getIcon());
@@ -743,8 +756,15 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
 
 
                 ((TextView)viewHolder.itemView.findViewById(R.id.item_name_tv)).setText(taskReleaseEty.getName()+"");
-                TaskHelper.setTaskTypeText((TextView) viewHolder.itemView.findViewById(R.id.item_num_tv), taskReleaseEty);
-                TaskHelper.setNumText((TextView) viewHolder.itemView.findViewById(R.id.item_num_tv1), taskReleaseEty);
+                switch (from) {
+                    case 1://来自主页
+                        TaskHelper.setTaskTypeText((TextView) viewHolder.itemView.findViewById(R.id.item_num_tv), taskReleaseEty);
+                        TaskHelper.setNumText((TextView) viewHolder.itemView.findViewById(R.id.item_num_tv1), taskReleaseEty);
+                        break;
+                    default:
+                        TaskHelper.setNumText((TextView) viewHolder.itemView.findViewById(R.id.item_num_tv), taskReleaseEty);
+                        break;
+                }
                 ((TextView)viewHolder.itemView.findViewById(R.id.item_money)).setText("+"+ taskReleaseEty.getBonus() +"元");
                 if(!taskReleaseEty.getDeadline().equals("永久")){
                     ((TextView)viewHolder.itemView.findViewById(R.id.item_date_tv)).setText(

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

@@ -15,7 +15,7 @@
         android:layout_marginTop="@dimen/content_padding"
         android:layout_marginBottom="@dimen/content_padding"
         android:background="@color/theme_app_divider_color"/>
-    <include layout="@layout/find_information_bottom_item"/>
+    <include layout="@layout/find_information_bottom_item_game"/>
     <include layout="@layout/find_item_bottom"/>
 
 </LinearLayout>

+ 3 - 0
app/src/main/res/layout/find_information_bottom_item.xml

@@ -81,6 +81,7 @@
         android:text="@string/app_name"
         android:textColor="@color/red"
         android:textSize="17sp"
+        android:layout_marginTop="5dp"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
 
@@ -88,6 +89,7 @@
         android:id="@+id/find_information_game_task_top"
         style="@style/style_button_find"
         android:text="接受任务"
+        android:layout_marginTop="5dp"
         android:visibility="gone"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
@@ -105,6 +107,7 @@
         android:id="@+id/find_information_game_task_bottom"
         style="@style/style_button_find"
         android:text="接受任务"
+        android:layout_marginBottom="5dp"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toEndOf="@+id/find_information_game_name_ll" />

+ 69 - 0
app/src/main/res/layout/find_information_bottom_item_game.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@color/white">
+
+    <ImageView
+        android:id="@+id/find_information_game_icon"
+        android:layout_width="70dp"
+        android:layout_height="70dp"
+        android:src="@mipmap/icon"
+        app:layout_constraintStart_toStartOf="parent"/>
+
+    <TextView
+        android:id="@+id/find_information_game_name"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:maxLines="2"
+        android:text="小绵羊小绵羊小绵羊小绵羊小小绵羊小绵羊小绵羊小绵羊小小绵羊小绵羊小绵羊小绵羊小小绵羊小绵羊小绵羊小绵羊小"
+        android:textColor="#444444"
+        android:textSize="14sp"
+        android:layout_marginStart="@dimen/content_padding"
+        android:layout_marginEnd="@dimen/content_padding"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toTopOf="@+id/find_information_game_time"
+        app:layout_constraintEnd_toStartOf="@+id/find_information_game_task_center"
+        app:layout_constraintStart_toEndOf="@+id/find_information_game_icon" />
+    <TextView
+        android:id="@+id/find_information_game_time"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:text="@string/app_name"
+        android:textColor="#cc8e8e8e"
+        android:gravity="start"
+        android:textSize="10sp"
+        android:layout_marginStart="@dimen/content_padding"
+        android:layout_marginEnd="@dimen/content_padding"
+        app:layout_constraintTop_toBottomOf="@+id/find_information_game_name"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toStartOf="@+id/find_information_game_task_center"
+        app:layout_constraintStart_toEndOf="@+id/find_information_game_icon" />
+
+    <TextView
+        android:id="@+id/find_information_game_task_center"
+        style="@style/style_button_find"
+        android:text="接受任务"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <TextView
+        android:id="@+id/find_information_game_task_end_time"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="@dimen/content_padding_4"
+        android:layout_marginStart="@dimen/content_padding_4"
+        android:layout_marginTop="55dp"
+        android:background="@drawable/shape_ash_stroke_white_solid_rectangle"
+        android:gravity="center"
+        android:text="@string/app_name"
+        android:lines="1"
+        android:textColor="#989898"
+        android:textSize="12sp"
+        android:visibility="gone"
+        app:layout_constraintEnd_toEndOf="@+id/find_information_game_icon"
+        app:layout_constraintStart_toStartOf="@+id/find_information_game_icon"
+        app:layout_constraintTop_toTopOf="parent" />
+</android.support.constraint.ConstraintLayout>

+ 1 - 0
app/src/main/res/layout/textview_layout.xml

@@ -9,6 +9,7 @@
         android:id="@+id/textview"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:textIsSelectable="true"
         android:layout_marginBottom="@dimen/content_padding_small">
 
     </TextView>

+ 1 - 0
app/src/main/res/layout/xpersion_info_act_layout.xml

@@ -66,6 +66,7 @@
 
             <TextView
                 android:id="@+id/personal_info_code"
+                android:textIsSelectable="true"
                 style="@style/style_item_end" />
 
         </LinearLayout>