Преглед на файлове

Merge branch 'sheep_develop' of 10.8.230.114:xmy_android/small_sheep_android into sheep_develop

hanjing преди 7 години
родител
ревизия
d85af08db7
променени са 20 файла, в които са добавени 515 реда и са изтрити 35 реда
  1. 17 0
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  2. 22 2
      app/src/main/java/com/sheep/gamegroup/model/entity/Release_task.java
  3. 105 0
      app/src/main/java/com/sheep/gamegroup/module/game/adapter/AdpGameWelfareAndMoneyReward.java
  4. 34 0
      app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtGameCenter.java
  5. 5 4
      app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtGameWelfare.java
  6. 18 2
      app/src/main/java/com/sheep/gamegroup/util/DrawablesHelper.java
  7. 5 1
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  8. 10 10
      app/src/main/java/com/sheep/gamegroup/util/TimeUtil.java
  9. 33 7
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMain.java
  10. 21 5
      app/src/main/java/com/sheep/gamegroup/view/activity/MiddleSchemeAct.java
  11. 2 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/Config.java
  12. 1 0
      app/src/main/java/org/afinal/simplecache/ApiKey.java
  13. BIN
      app/src/main/res/drawable-xxhdpi/tab_big_yq.png
  14. 3 3
      app/src/main/res/drawable/drawable_selector_askgetmoney.xml
  15. 113 0
      app/src/main/res/layout/act_bottom_bar.xml
  16. 1 0
      app/src/main/res/layout/hp_game_welfare_entrance.xml
  17. 115 0
      app/src/main/res/layout/item_money_reward.xml
  18. 8 0
      app/src/main/res/layout/item_money_reward_and_top.xml
  19. BIN
      app/src/main/res/mipmap-xxhdpi/ic_mr_vip.png
  20. 2 1
      view/src/main/res/values/dimens.xml

+ 17 - 0
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -270,6 +270,11 @@ public interface ApiService {
     @GET(ApiKey.GET_ALL_WELFARE)
     Observable<BaseMessage> getAppWelfare(@Query("page") int page, @Query("per_page") int per_page, @Query("app_id") int app_id);
     /**
+     * 获取游戏对应的福利与赏金福利
+     */
+    @GET(ApiKey.GET_ALL_WELFARE_AND_MONEY_REWARD)
+    Observable<BaseMessage> getAppWelfareAndMoneyReward(@Query("page") int page, @Query("per_page") int per_page, @Query("app_id") int app_id);
+    /**
      * 获取游戏福利专区中的全部福利
      */
     @GET(ApiKey.GET_MY_WELFARE)
@@ -1832,4 +1837,16 @@ public interface ApiService {
     Observable<BaseMessage> postUserForm(@Body JSONObject jsonObject);
 
 //---------------------------end 小绵羊3.5.0新增 ---------------------------------------
+
+    /**
+     * 判断用户是否是会长
+     */
+    @GET("app/user/is_president/{invitation_code}")
+    Observable<BaseMessage> getUserIsPresident(@Path("invitation_code") String invitation_code);
+
+    /**
+     * 通过绵羊号判断用户是否是会长或会长下面用户
+     */
+    @GET("app/user/is_shou_you")
+    Observable<BaseMessage> getUserIsShouYou(@Query("invitation_code") String invitation_code);
 }

+ 22 - 2
app/src/main/java/com/sheep/gamegroup/model/entity/Release_task.java

@@ -2,6 +2,7 @@ package com.sheep.gamegroup.model.entity;
 
 import android.text.TextUtils;
 
+import com.chad.library.adapter.base.entity.MultiItemEntity;
 import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.sheep.gamegroup.helper.DownloadHelper;
 import com.sheep.gamegroup.util.TimeUtil;
@@ -52,7 +53,7 @@ import java.util.Locale;
  * ) ENGINE=InnoDB AUTO_INCREMENT=1589 DEFAULT CHARSET=utf8 COMMENT='发布任务';
  */
 
-public class Release_task implements Serializable {
+public class Release_task implements Serializable, MultiItemEntity {
     private float bonus;// 0,
     private float vip_bonus;// 0,
     private String create_time;// 0,
@@ -471,6 +472,14 @@ public class Release_task implements Serializable {
     public String getRewardMsg() {
         return String.format(Locale.CHINA, "+%s元%s", getBonusText(), getRewardTypeNameMsg());
     }
+    /**
+     * +5元
+     *
+     * @return
+     */
+    public String getRewardMsgSimple() {
+        return String.format(Locale.CHINA, "+%s元", getBonusText());
+    }
 
 
     //以下为福利相关方法
@@ -522,10 +531,14 @@ public class Release_task implements Serializable {
     public CharSequence getWelfareValue() {
         return new SpannableSb().append("价值:").append(String.format(Locale.CHINA, "¥%s", bonus), "#FD2D54").getSsb();
     }
-    //获取福利的价值
+    //获取福利剩余时间
     public CharSequence getRemainderTime() {
         return new SpannableSb().append("剩余时间:").append(TimeUtil.getDurationText2(Long.valueOf(deadline) - System.currentTimeMillis() / 1000L)).getSsb();
     }
+    //获取福利剩余时间
+    public CharSequence getRemainderTime2() {
+        return new SpannableSb().append("有效期:").append(NumberFormatUtils.parseInteger(deadline, 0) > 0 ? TimeUtil.TimeStamp2Date(Long.valueOf(deadline), "yyyy-MM-dd") : "永久").getSsb();
+    }
 
     //获取级别,其对应资源中的R.drawable.ic_welfare_level_1
     public int getLevel() {
@@ -534,4 +547,11 @@ public class Release_task implements Serializable {
     public boolean isVipWelfare(){
         return vip == 1;
     }
+
+
+
+    @Override
+    public int getItemType() {//游戏详情中赏金任务与福利列表用到,只显示这两种类型
+        return task.getTask_type() == 1020 ? 1020 : 1019;
+    }
 }

+ 105 - 0
app/src/main/java/com/sheep/gamegroup/module/game/adapter/AdpGameWelfareAndMoneyReward.java

@@ -0,0 +1,105 @@
+package com.sheep.gamegroup.module.game.adapter;
+
+import android.support.annotation.Nullable;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.sheep.gamegroup.model.entity.Release_task;
+import com.sheep.gamegroup.model.entity.TaskEty;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.List;
+
+/**
+ * Created by realicing on 2019/3/28.
+ * realicing@sina.com
+ * 玩转游戏详情中 福利或赏金福利
+ */
+public class AdpGameWelfareAndMoneyReward extends BaseMultiItemQuickAdapter<Release_task, BaseViewHolder> {
+    public AdpGameWelfareAndMoneyReward(@Nullable List<Release_task> data) {
+        super(data);
+        addItemType(1019, R.layout.item_all_welfare);
+        addItemType(1020, R.layout.item_money_reward_and_top);
+    }
+
+    @Override
+    protected void convert(BaseViewHolder holder, Release_task release_task) {
+        switch (holder.getItemViewType()){
+            case 1019:
+                convert1019(holder, release_task);
+                break;
+            case 1020:
+                convert1020(holder, release_task);
+                break;
+        }
+    }
+    //福利
+    private void convert1019(BaseViewHolder holder, Release_task release_task) {
+        ImageView item_icon_iv = holder.itemView.findViewById(R.id.item_icon_iv);
+        ImageView item_level_iv = holder.itemView.findViewById(R.id.item_level_iv);
+        TextView item_name_tv = holder.itemView.findViewById(R.id.item_name_tv);
+        TextView item_time_tv = holder.itemView.findViewById(R.id.item_time_tv);
+        TextView item_info_tv = holder.itemView.findViewById(R.id.item_info_tv);
+        TextView item_value_tv = holder.itemView.findViewById(R.id.item_value_tv);
+//        TextView item_btn_tv = holder.itemView.findViewById(R.id.item_btn_tv);
+        TextView item_vip_tv = holder.itemView.findViewById(R.id.item_vip_tv);
+
+        if (release_task == null) {
+            return;
+        }
+        TaskEty taskEty = release_task.getTask();
+        if (taskEty == null) {
+            return;
+        }
+        ViewUtil.setGameImage(item_icon_iv, taskEty.getIcon());
+        ViewUtil.setImageLevel(item_level_iv, release_task.getLevel());
+        ViewUtil.setText(item_name_tv, release_task.getName());
+        ViewUtil.setText(item_time_tv, release_task.getRemainderTime());
+        ViewUtil.setText(item_info_tv, release_task.getWelfareInfo());
+        ViewUtil.setText(item_value_tv, release_task.getWelfareValue());
+        ViewUtil.setVisibility(item_vip_tv, release_task.isVipWelfare());
+        ViewUtil.setOnClickListener(holder.itemView, view -> Jump2View.getInstance().goEntity(release_task));
+    }
+    //赏金任务
+    private void convert1020(BaseViewHolder viewHolder, Release_task release_task) {
+        //top
+//        TextView hp_gwe_tv1 = viewHolder.itemView.findViewById(R.id.hp_gwe_tv1);
+        TextView hp_gwe_tv2 = viewHolder.itemView.findViewById(R.id.hp_gwe_tv2);
+        ImageView hp_gwe_iv = viewHolder.itemView.findViewById(R.id.hp_gwe_iv);
+        ViewUtil.setText(hp_gwe_tv2, "该任务奖励,只可消费不可提现");
+        ViewUtil.setVisibility(hp_gwe_iv, false);
+
+        //content
+        ImageView item_icon_iv = viewHolder.itemView.findViewById(R.id.item_icon_iv);
+        TextView item_name_tv = viewHolder.itemView.findViewById(R.id.item_name_tv);
+        TextView item_time_tv = viewHolder.itemView.findViewById(R.id.item_time_tv);
+        TextView item_info_tv = viewHolder.itemView.findViewById(R.id.item_info_tv);
+        TextView item_value_tv = viewHolder.itemView.findViewById(R.id.item_value_tv);
+//        TextView item_btn_tv = viewHolder.itemView.findViewById(R.id.item_btn_tv);
+        TextView item_vip_tv = viewHolder.itemView.findViewById(R.id.item_vip_tv);
+        ImageView item_vip_iv = viewHolder.itemView.findViewById(R.id.item_vip_iv);
+
+        if (release_task == null) {
+            return;
+        }
+        TaskEty taskEty = release_task.getTask();
+        if (taskEty == null) {
+            return;
+        }
+        ViewUtil.setGameImage(item_icon_iv, taskEty.getIcon());
+        ViewUtil.setVisibility(item_vip_iv, release_task.isVipWelfare());
+        ViewUtil.setText(item_name_tv, taskEty.getDesc());
+        ViewUtil.setText(item_time_tv, release_task.getName());
+        ViewUtil.setText(item_info_tv, release_task.getRemainderTime());
+        ViewUtil.setText(item_value_tv, release_task.getRewardMsgSimple());
+        ViewUtil.setVisibility2(item_value_tv, !release_task.isVipWelfare());
+        ViewUtil.setText(item_vip_tv, release_task.getVipBonusText());
+        ViewUtil.setOnClickListener(viewHolder.itemView, view -> Jump2View.getInstance().goEntity(release_task));
+
+
+    }
+}

+ 34 - 0
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtGameCenter.java

@@ -2,13 +2,18 @@ package com.sheep.gamegroup.module.game.fragment;
 
 import android.support.design.widget.TabLayout;
 import android.support.v4.view.ViewPager;
+import android.text.TextUtils;
 import android.view.KeyEvent;
 import android.view.View;
 import android.widget.Button;
 import android.widget.ImageButton;
 
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.entity.WebParams;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.KeyEventUtil;
 import com.sheep.gamegroup.util.ViewUtil;
@@ -22,6 +27,10 @@ import com.sheep.jiuyan.samllsheep.utils.G;
 
 import butterknife.BindView;
 import butterknife.OnClick;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+import rx.functions.Action1;
+
 /**
  * Created by realicing on 2019/1/18.
  * realicing@sina.com
@@ -51,6 +60,8 @@ public class FgtGameCenter extends BaseFragment {
     ImageButton searchBtn;
     @BindView(R.id.my_walfare_btn)
     Button myWalfareBtn;
+    @BindView(R.id.fgt_gc_hb_500_yuan_drl)
+    View fgt_gc_hb_500_yuan_drl;
 
 
     private void initView() {
@@ -80,6 +91,29 @@ public class FgtGameCenter extends BaseFragment {
 
             }
         });
+        ViewUtil.setVisibility(fgt_gc_hb_500_yuan_drl, false);
+        CommonUtil.getInstance().callActionWithUserInfo(userEntity -> {
+            String code = userEntity.getParent_code();
+            if(TextUtils.isEmpty(code)){
+                code = userEntity.getInvitation_code();
+            }
+        SheepApp.getInstance().getNetComponent().getApiService().getUserIsShouYou(code)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        boolean result = baseMessage.getData(Boolean.class);
+                        ViewUtil.setVisibility(fgt_gc_hb_500_yuan_drl, result);
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        ViewUtil.setVisibility(fgt_gc_hb_500_yuan_drl, false);
+                    }
+                });
+        });
+
     }
 
     private void initData() {

+ 5 - 4
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtGameWelfare.java

@@ -12,6 +12,7 @@ import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.module.game.adapter.AdpAllWelfare;
 import com.sheep.gamegroup.module.game.adapter.AdpGameWelfare;
+import com.sheep.gamegroup.module.game.adapter.AdpGameWelfareAndMoneyReward;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.ListUtil;
@@ -36,7 +37,7 @@ import io.reactivex.schedulers.Schedulers;
 /**
  * Created by realicing on 2019/3/28.
  * realicing@sina.com
- * 小绵羊3.5.3 新增 -- 玩转游戏 福利
+ * 小绵羊3.5.3 新增 -- 玩转游戏详情中 福利或赏金福利列表
  */
 public class FgtGameWelfare extends BaseRefreshLoadMoreFragment {
 
@@ -62,7 +63,7 @@ public class FgtGameWelfare extends BaseRefreshLoadMoreFragment {
         recyclerView.setHasFixedSize(true);
         recyclerView.setNestedScrollingEnabled(false);
         recyclerView.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
-        AdpGameWelfare adapter = new AdpGameWelfare(list);
+        AdpGameWelfareAndMoneyReward adapter = new AdpGameWelfareAndMoneyReward(list);
         adapter.bindToRecyclerView(recyclerView);
         adapter.setEmptyView(R.layout.include_empty_view);
         initData();
@@ -147,12 +148,12 @@ public class FgtGameWelfare extends BaseRefreshLoadMoreFragment {
     }
 
     private String getKey() {
-        return ApiKey.pageKeyUrl(ApiKey.GET_ALL_WELFARE, page, per_page) + "&app_id="+appId;
+        return ApiKey.pageKeyUrl(ApiKey.GET_ALL_WELFARE_AND_MONEY_REWARD, page, per_page) + "&app_id="+appId;
     }
 
     //从网络获取发布的任务列表
     private void getReleaseFromNetWork() {
-        SheepApp.getInstance().getNetComponent().getApiService().getAppWelfare(page, per_page, appId)
+        SheepApp.getInstance().getNetComponent().getApiService().getAppWelfareAndMoneyReward(page, per_page, appId)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {

+ 18 - 2
app/src/main/java/com/sheep/gamegroup/util/DrawablesHelper.java

@@ -27,6 +27,7 @@ public class DrawablesHelper {
     private WeakReference<TextView> mViewWeakReference;
     private int mWidth;
     private int mHeight;
+    private float radio = 0;
     private @DrawableRes
     int mDrawable;
 
@@ -53,6 +54,11 @@ public class DrawablesHelper {
         mDrawable = drawable;
         return this;
     }
+    public DrawablesHelper drawable(@DrawableRes int drawable, float radio){
+        mDrawable = drawable;
+        this.radio = radio;
+        return this;
+    }
 
     public void commit(){
         TextView textView = mViewWeakReference.get();
@@ -60,8 +66,11 @@ public class DrawablesHelper {
             Drawable drawable;
             if(mWidth != 0 && mHeight != 0){
                 drawable = getDrawable(textView.getContext(), mDrawable, mWidth, mHeight);
+            } else if(radio > 0){
+                drawable = getDrawable(textView.getContext(), mDrawable, radio);
+            } else {
+                drawable = getDrawable(textView.getContext(), mDrawable);
             }
-            else drawable = getDrawable(textView.getContext(), mDrawable);
 
             Drawable[] compoundDrawables = textView.getCompoundDrawables();
             switch (mDirection){
@@ -115,9 +124,16 @@ public class DrawablesHelper {
         return drawable;
     }
 
+    private static Drawable getDrawable(Context context, int drawableResId, float radio) {
+        Drawable drawable = ContextCompat.getDrawable(context,drawableResId);
+        if(drawable != null)
+            drawable.setBounds(0,0,(int)(drawable.getIntrinsicWidth() * radio),(int)(drawable.getIntrinsicHeight() * radio));
+        return drawable;
+    }
     private static Drawable getDrawable(Context context, int drawableResId) {
         Drawable drawable = ContextCompat.getDrawable(context,drawableResId);
-        drawable.setBounds(0,0,drawable.getIntrinsicWidth(),drawable.getIntrinsicHeight());
+        if(drawable != null)
+            drawable.setBounds(0,0,drawable.getIntrinsicWidth(),drawable.getIntrinsicHeight());
         return drawable;
     }
 

+ 5 - 1
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -1841,6 +1841,10 @@ public class Jump2View {
                     goWeb(SheepApp.getInstance().getCurrentActivity(), new WebParams(Config.getUrlByPath(Config.PATH_WELFARE_DETAIL
                             , "id", item.getId(), "device_id", DeviceUtil.getDeviceId(SheepApp.getInstance()), "app_version", String.valueOf(BuildConfig.VERSION_CODE))).setTitle(item.getName()));
                     break;
+                case 1020:
+                    goWeb(SheepApp.getInstance().getCurrentActivity(), new WebParams(Config.getUrlByPath(Config.PATH_MONEY_REWARD_DETAIL
+                            , "id", item.getId(), "device_id", DeviceUtil.getDeviceId(SheepApp.getInstance()), "app_version", String.valueOf(BuildConfig.VERSION_CODE))).setTitle(item.getName()));
+                    break;
                 default:
                     goTaskDetailView(SheepApp.getInstance().getCurrentActivity(), item.getId());
                     break;
@@ -2935,7 +2939,7 @@ public class Jump2View {
      * 小绵羊3.4.10新增 -- 游戏组游戏详情 界面
      */
     public void goPlayGameDetailAndCheckWelfare(Activity activity, Intent intent, int appId) {
-        SheepApp.getInstance().getNetComponent().getApiService().getAppWelfare(1, DataUtil.PER_PAGE, appId)
+        SheepApp.getInstance().getNetComponent().getApiService().getAppWelfareAndMoneyReward(1, DataUtil.PER_PAGE, appId)
                         .subscribeOn(Schedulers.io())
                         .observeOn(AndroidSchedulers.mainThread())
                         .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {

+ 10 - 10
app/src/main/java/com/sheep/gamegroup/util/TimeUtil.java

@@ -287,14 +287,14 @@ public class TimeUtil {
     // 将Unix时间戳转变为日期,如调用TimeStampToDate("1252639886", "yyyy-MM-dd
     // HH:mm:ss")返回值:2009-11-09 11:31:26
 
-    public String TimeStamp2Date(Long timestamp, String formats) {
-        String date = "";
-        try {
-            date = new java.text.SimpleDateFormat(formats).format(new java.util.Date(timestamp));
-
-        } catch (NumberFormatException e) {
-
-        }
-        return date;
-    }
+//    public String TimeStamp2Date(Long timestamp, String formats) {
+//        String date = "";
+//        try {
+//            date = new java.text.SimpleDateFormat(formats).format(new java.util.Date(timestamp));
+//
+//        } catch (NumberFormatException e) {
+//
+//        }
+//        return date;
+//    }
 }

+ 33 - 7
app/src/main/java/com/sheep/gamegroup/view/activity/ActMain.java

@@ -7,6 +7,7 @@ import android.support.annotation.Nullable;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentTransaction;
 import android.text.TextUtils;
+import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.View;
 import android.widget.FrameLayout;
@@ -21,6 +22,7 @@ import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.helper.DownloadHelper;
 import com.sheep.gamegroup.model.entity.Container;
+import com.sheep.gamegroup.model.entity.Lp;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.ShowRedDot;
 import com.sheep.gamegroup.util.ActionUtil;
@@ -28,13 +30,16 @@ import com.sheep.gamegroup.util.ChannelContent;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.DownloadUtil;
+import com.sheep.gamegroup.util.DrawablesHelper;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.MainTab;
 import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.util.viewHelper.LayoutParamsUtil;
 import com.sheep.gamegroup.view.dialog.DialogGameOrTaskOrGift;
 import com.sheep.gamegroup.view.fragment.FgtPersonalCenter;
 import com.sheep.jiuyan.samllsheep.R;
@@ -144,7 +149,7 @@ public class ActMain extends BaseActYmPermissionCheck {
 
     @Override
     protected int getLayoutId() {
-        return R.layout.act_main;
+        return R.layout.act_bottom_bar;
     }
 
     @Override
@@ -204,10 +209,14 @@ public class ActMain extends BaseActYmPermissionCheck {
             } else {
                 transaction.hide(fragment);
             }
-            View view = tab_container.getChildAt(index * 2 + 1);
+            View view = tab_container.getChildAt(index);
             if (view instanceof TextView) {
                 ((TextView) view).setText(mainTab.getStringId());
-//                new DrawablesHelper((TextView) view).direction(DrawablesHelper.TOP).drawable(mainTab.getDrawableId()).commit();
+                if(mainTab.getDrawableId() == R.drawable.drawable_selector_askgetmoney) {
+//                    166x137 204x170
+                    new DrawablesHelper((TextView) view).direction(DrawablesHelper.TOP).drawable(mainTab.getDrawableId(), 150 / 170.0f).commit();
+//                    testView = view;
+                }
             }
             tabs.add(view);
             final int position = index;
@@ -222,12 +231,29 @@ public class ActMain extends BaseActYmPermissionCheck {
             index++;
         }
         transaction.commitAllowingStateLoss();
-        //隐藏不显示的控件
-        for (int i = index * 2; i < tab_container.getChildCount() - 1; i++) {
-            tab_container.getChildAt(i).setVisibility(View.GONE);
-        }
         tabs.get(lastPosition).setActivated(true);
     }
+//    private View testView;
+//
+//    @Override
+//    public boolean onKeyDown(int keyCode, KeyEvent event) {
+//        switch (event.getKeyCode()){
+//            case KeyEvent.KEYCODE_8:
+//                addTestViewH(1);
+//                break;
+//            case KeyEvent.KEYCODE_2:
+//                addTestViewH(-1);
+//                break;
+//        }
+//        return super.onKeyDown(keyCode, event);
+//    }
+//
+//    private int defaultTestViewH = 65;
+//    private void addTestViewH(int add) {
+//        defaultTestViewH += add;
+//        LayoutParamsUtil.resetLayoutParams(testView, new Lp(G.DENSITY).setHeight(defaultTestViewH).setWidth((int) (defaultTestViewH * 204 / 170.0f)));
+//        LogUtil.println("addTestViewH add =", defaultTestViewH);
+//    }
 
     private void switchFragment(int position) {
         View lastTab = ListUtil.getItem(tabs, lastPosition);

+ 21 - 5
app/src/main/java/com/sheep/gamegroup/view/activity/MiddleSchemeAct.java

@@ -9,6 +9,7 @@ import android.support.annotation.Nullable;
 import android.text.TextUtils;
 
 import com.alibaba.fastjson.JSONObject;
+import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.sheep.gamegroup.model.api.BaseMessageConverter;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
@@ -18,6 +19,7 @@ import com.sheep.gamegroup.util.ActionUtil;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.LogUtil;
+import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
@@ -88,14 +90,14 @@ public class MiddleSchemeAct extends Activity {
                 break;
             //sheep://small.kfzs.com/xmy?type=bind_mobile
             //sheep://small.kfzs.com/xmy?type=bm
-            case "bm"://跳转福利界面
-            case "bind_mobile"://跳转福利界面
+            case "bm"://跳转绑定手机
+            case "bind_mobile"://跳转绑定手机
                 Jump2View.getInstance().goBindPhone(activity, null);
                 break;
             //sheep://small.kfzs.com/xmy?type=welfare
             //sheep://small.kfzs.com/xmy?type=wfa
-            case "welfare"://跳转福利界面
-            case "wfa"://跳转福利界面
+            case "welfare"://跳转原生福利专区
+            case "wfa"://跳转原生福利专区
                 Jump2View.getInstance().toActWelfareSpecialArea();
                 break;
             //sheep://small.kfzs.com/xmy?type=jhl&data={"Jump":"1"}
@@ -122,7 +124,14 @@ public class MiddleSchemeAct extends Activity {
                         G.showToast(e.getMessage());
                 }
                 break;
-            //sheep://small.kfzs.com/xmy?type=jss&data={"Type":1}
+                //跳转试玩赚钱
+                //sheep://small.kfzs.com/xmy?type=jss&data={"Type":1}
+                //跳转连续任务
+                //sheep://small.kfzs.com/xmy?type=jss&data={"Type":6}
+                //跳转办卡赚钱
+                //sheep://small.kfzs.com/xmy?type=jss&data={"Type":3}
+                //跳转游戏详情 "Id": 351, "name": "神都夜行录",
+                //sheep://small.kfzs.com/xmy?type=jss&data={"Type":16,"Ext":"{\"id\":351}"}
             case "jump_slide_show"://跳转banner(主页banner或者游戏banner)
             case "jss":
                 try {
@@ -138,6 +147,7 @@ public class MiddleSchemeAct extends Activity {
             //跳转绑定手机号
             //sheep://small.kfzs.com/xmy?type=run_app&className=com.sheep.gamegroup.view.activity.ChangeTelAct
             //sheep://small.kfzs.com/xmy?type=run&className=com.sheep.gamegroup.view.activity.ActInvitation 邀请赚钱界面
+            //sheep://small.kfzs.com/xmy?type=run&className=com.sheep.gamegroup.view.activity.ActSignCardRecord 我的战绩界面
             case "run_app":
             case "run":
                 String packageName = uri.getQueryParameter("packageName");
@@ -164,6 +174,12 @@ public class MiddleSchemeAct extends Activity {
                         .setBtnLeftText("取消").setBtnRightText("前往")
                         .setBtnRightOnClickListener(view -> Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), new WebParams(url).setTitle("爱奇艺会员VIP"))));
                 break;
+            //sheep://small.kfzs.com/xmy?type=startAlermApp&hour=7&min=5
+            case "startAlermApp":
+                int hour = NumberFormatUtils.parseInteger(uri.getQueryParameter("hour"), 7);
+                int min = NumberFormatUtils.parseInteger(uri.getQueryParameter("min"), 5);
+                SysAppUtil.startAlermApp(activity, activity.getString(R.string.smallsheep_checkin_task), hour, min);
+                break;
         }
 //                    LogUtil.println("ActMain", "checkScheme","url: " + url);
 //                    // scheme部分

+ 2 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/Config.java

@@ -82,6 +82,8 @@ public class Config {
     public static final String PATH_SBD_HOME = STATION_SUI_BIAN_DA + "/";
     //福利
     public static final String PATH_WELFARE_DETAIL = STATION_WELFARE + "/detail";
+    //赏金福利
+    public static final String PATH_MONEY_REWARD_DETAIL = STATION_WELFARE + "/money-reward-detail";
     //赏金任务列表
     public static final String PATH_WELFARE_MONEY_REWARD_LIST = STATION_WELFARE + "/money-reward-list";
     //邀请赚钱主页

+ 1 - 0
app/src/main/java/org/afinal/simplecache/ApiKey.java

@@ -99,6 +99,7 @@ public class ApiKey {
     public static final String FIND = "app/find";
     //获取全部福利
     public static final String GET_ALL_WELFARE = "app/release_task?platform=1&task_type=1019";
+    public static final String GET_ALL_WELFARE_AND_MONEY_REWARD = "app/release_task?platform=1&task_type=1019,1020";
     //获取我的福利
     public static final String GET_MY_WELFARE = "app/accepted_task?status=0&task_type=1019";
 

BIN
app/src/main/res/drawable-xxhdpi/tab_big_yq.png


+ 3 - 3
app/src/main/res/drawable/drawable_selector_askgetmoney.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <item android:drawable="@drawable/tab_click_yaoqing" android:state_activated="true"/>
-    <item android:drawable="@drawable/tab_click_yaoqing" android:state_pressed="true"/>
-    <item android:drawable="@drawable/tab_yaoqing"/>
+    <item android:drawable="@drawable/tab_big_yq" android:state_activated="true"/>
+    <item android:drawable="@drawable/tab_big_yq" android:state_pressed="true"/>
+    <item android:drawable="@drawable/tab_big_yq"/>
 
 </selector>

+ 113 - 0
app/src/main/res/layout/act_bottom_bar.xml

@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/main_layout"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:clipChildren="false">
+
+    <include
+        layout="@layout/main_frame_layout"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginBottom="@dimen/bottom_height" />
+
+
+    <View
+        android:id="@+id/tab_line"
+        android:layout_width="match_parent"
+        android:layout_height="1px"
+        android:layout_above="@id/tab_container"
+        android:background="#e6e6e6" />
+    <RadioGroup
+        android:id="@+id/tab_container"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/bottom_height"
+        android:layout_alignParentStart="true"
+        android:layout_alignParentBottom="true"
+        android:background="@color/white"
+        android:gravity="end"
+        android:orientation="horizontal">
+
+        <RadioButton
+            android:id="@+id/tab_1"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:background="#0000ffff"
+            android:button="@null"
+            android:drawableTop="@drawable/drawable_selector_task"
+            android:gravity="center"
+            android:paddingTop="@dimen/bottom_tab_pt"
+            android:text="@string/tab_viewpager_gamestore"
+            android:textColor="@color/selector_color_main_tab"
+            android:textSize="10sp" />
+
+        <RadioButton
+            android:id="@+id/tab_2"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:background="#000000ff"
+            android:button="@null"
+            android:drawableTop="@drawable/drawable_selector_game_center"
+            android:gravity="center"
+            android:paddingTop="@dimen/bottom_tab_pt"
+            android:text="@string/tab_viewpager_classification"
+            android:textColor="@color/selector_color_main_tab"
+            android:textSize="10sp" />
+
+        <RadioButton
+            android:id="@+id/tab_3"
+            android:layout_width="0dip"
+            android:layout_height="65dp"
+            android:layout_gravity="bottom"
+            android:layout_weight="1"
+            android:background="#0000ff00"
+            android:button="@null"
+            android:drawableTop="@drawable/drawable_selector_askgetmoney"
+            android:gravity="center"
+            android:text="@string/mine_hoggerel"
+            android:textColor="@color/selector_color_main_tab"
+            android:textSize="10sp" />
+
+        <RadioButton
+            android:id="@+id/tab_4"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:background="#00ffff00"
+            android:button="@null"
+            android:drawableTop="@drawable/drawable_selector_find"
+            android:gravity="center"
+            android:paddingTop="@dimen/bottom_tab_pt"
+            android:text="@string/main_tab_find"
+            android:textColor="@color/selector_color_main_tab"
+            android:textSize="10sp" />
+
+        <RadioButton
+            android:id="@+id/tab_5"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:background="#00ff0000"
+            android:button="@null"
+            android:drawableTop="@drawable/drawable_selector_personalcenter"
+            android:gravity="center"
+            android:paddingTop="@dimen/bottom_tab_pt"
+            android:text="@string/personal_center"
+            android:textColor="@color/selector_color_main_tab"
+            android:textSize="10sp" />
+
+    </RadioGroup>
+    <View
+        android:id="@+id/person_center_red_dot"
+        android:visibility="gone"
+        android:layout_width="8dp"
+        android:layout_height="8dp"
+        android:layout_marginBottom="@dimen/dp_40"
+        android:layout_marginEnd="16dp"
+        android:layout_alignParentEnd="true"
+        android:layout_alignParentBottom="true"
+        android:background="@drawable/shape_oval_red" />
+
+</RelativeLayout>

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

@@ -38,6 +38,7 @@
         app:layout_constraintStart_toEndOf="@id/hp_gwe_tv1" />
 
     <ImageView
+        android:id="@+id/hp_gwe_iv"
         android:layout_width="5dp"
         android:layout_height="wrap_content"
         android:adjustViewBounds="true"

+ 115 - 0
app/src/main/res/layout/item_money_reward.xml

@@ -0,0 +1,115 @@
+<?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">
+
+    <ImageView
+        android:id="@+id/item_icon_iv"
+        android:layout_width="89dp"
+        android:layout_height="89dp"
+        android:layout_marginStart="15dp"
+        android:layout_marginTop="11dp"
+        android:layout_marginBottom="19dp"
+        android:src="@mipmap/sheep_logo"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <TextView
+        android:id="@+id/item_name_tv"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="3dp"
+        android:layout_marginEnd="5dp"
+        android:ellipsize="end"
+        android:singleLine="true"
+        android:text="王者荣耀皮肤"
+        android:textColor="#ff333333"
+        android:textSize="14sp"
+        app:layout_constraintEnd_toStartOf="@id/item_value_tv"
+        app:layout_constraintStart_toEndOf="@id/item_icon_iv"
+        app:layout_constraintTop_toTopOf="@id/item_icon_iv" />
+
+    <TextView
+        android:id="@+id/item_time_tv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="5dp"
+        android:text="剩余时间:3天54小时12分"
+        android:textColor="#ff999999"
+        android:textSize="12sp"
+        app:layout_constraintBottom_toTopOf="@id/item_info_tv"
+        app:layout_constraintStart_toStartOf="@id/item_name_tv" />
+
+    <TextView
+        android:id="@+id/item_info_tv"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="5dp"
+        android:ellipsize="end"
+        android:singleLine="true"
+        android:text="内容:xx皮肤、xx皮肤"
+        android:textColor="#ff999999"
+        android:textSize="10sp"
+        app:layout_constraintBottom_toBottomOf="@id/item_icon_iv"
+        app:layout_constraintEnd_toStartOf="@id/item_vip_tv"
+        app:layout_constraintStart_toStartOf="@id/item_name_tv" />
+
+    <TextView
+        android:id="@+id/item_value_tv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="21dp"
+        android:layout_marginBottom="4dp"
+        android:text="+8元"
+        android:textColor="#ffff2d4b"
+        android:textSize="18sp"
+        app:layout_constraintBottom_toTopOf="@id/item_vip_tv"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="@id/item_btn_tv" />
+
+    <TextView
+        android:id="@+id/item_btn_tv"
+        style="@style/style_button_find"
+        android:layout_marginEnd="17dp"
+        android:text="查看详情"
+        app:layout_constraintBottom_toBottomOf="@id/item_icon_iv"
+        app:layout_constraintEnd_toEndOf="parent" />
+
+    <TextView
+        android:id="@+id/item_vip_tv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="21dp"
+        android:layout_marginBottom="4dp"
+        android:text="会员+9.6元"
+        android:textColor="#ffc3995e"
+        android:textSize="12sp"
+        app:layout_constraintBottom_toTopOf="@id/item_btn_tv"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="@id/item_btn_tv" />
+
+    <ImageView
+        android:id="@+id/item_vip_iv"
+        android:layout_width="28dp"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="4dp"
+        android:adjustViewBounds="true"
+        android:scaleType="fitXY"
+        android:src="@mipmap/ic_mr_vip"
+        app:layout_constraintBottom_toTopOf="@id/item_vip_tv"
+        app:layout_constraintEnd_toEndOf="@id/item_btn_tv"
+        app:layout_constraintStart_toStartOf="@id/item_btn_tv" />
+
+
+    <View
+        android:layout_width="0dp"
+        android:layout_height="1dp"
+        android:layout_marginStart="16dp"
+        android:layout_marginEnd="16dp"
+        android:background="#F2F2F2"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent" />
+</android.support.constraint.ConstraintLayout>

+ 8 - 0
app/src/main/res/layout/item_money_reward_and_top.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+    <include layout="@layout/hp_game_welfare_entrance"/>
+    <include layout="@layout/item_money_reward"/>
+</LinearLayout>

BIN
app/src/main/res/mipmap-xxhdpi/ic_mr_vip.png


+ 2 - 1
view/src/main/res/values/dimens.xml

@@ -3,7 +3,8 @@
     <!-- Default screen margins, per the Android Design guidelines. -->
     <dimen name="tab_width">45dp</dimen>
     <dimen name="tab_height">45dp</dimen>
-    <dimen name="bottom_height">49dp</dimen>
+    <dimen name="bottom_height">50dp</dimen>
+    <dimen name="bottom_tab_pt">6dp</dimen>
     <dimen name="tag_vertical_spacing">6.0dip</dimen>
     <dimen name="common_margin_10">10.0dip</dimen>