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

fixbug:礼包获取状态;礼包获取后通知;已安装APP状态;SDK登录未成功问题;退出登录UI没刷新问题

Sora 1 год назад
Родитель
Сommit
8e7689bde1
37 измененных файлов с 106 добавлено и 2701 удалено
  1. 1 25
      app/src/main/AndroidManifest.xml
  2. 1 1
      app/src/main/java/com/sheep/gamegroup/event/EventTypes.java
  3. 5 2
      app/src/main/java/com/sheep/gamegroup/gaiban/mainpage/mine/MineFragment.java
  4. 1 1
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  5. 0 1
      app/src/main/java/com/sheep/gamegroup/model/entity/UserEntity.java
  6. 17 4
      app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtDownloadManager.java
  7. 1 0
      app/src/main/java/com/sheep/gamegroup/module/login/LoginAct.java
  8. 0 530
      app/src/main/java/com/sheep/gamegroup/module/task/OldVideoTaskActivity.java
  9. 0 134
      app/src/main/java/com/sheep/gamegroup/module/task/VideoTaskActivity.java
  10. 0 248
      app/src/main/java/com/sheep/gamegroup/module/task/fragments/FgtVideoTaskBase.java
  11. 0 82
      app/src/main/java/com/sheep/gamegroup/module/task/fragments/FgtVideoTaskDK.java
  12. 0 127
      app/src/main/java/com/sheep/gamegroup/module/task/fragments/FgtVideoTaskYKY.java
  13. 0 108
      app/src/main/java/com/sheep/gamegroup/module/task/fragments/FgtVideoTaskZK.java
  14. 0 305
      app/src/main/java/com/sheep/gamegroup/module/task/fragments/FgtVideoTaskZKOld.java
  15. 0 61
      app/src/main/java/com/sheep/gamegroup/module/task/fragments/VideoTaskDialogUtil.java
  16. 0 6
      app/src/main/java/com/sheep/gamegroup/module/task/fragments/VideoTaskUtil.java
  17. 0 185
      app/src/main/java/com/sheep/gamegroup/module/task/helper/ADDownloader.java
  18. 0 176
      app/src/main/java/com/sheep/gamegroup/module/task/helper/ADVideoHelper.java
  19. 0 198
      app/src/main/java/com/sheep/gamegroup/module/task/helper/VideoAd.java
  20. 8 24
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  21. 5 2
      app/src/main/java/com/sheep/gamegroup/util/js/KFZSJs.java
  22. 5 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGiftDetail.java
  23. 0 8
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMain.java
  24. 29 10
      app/src/main/java/com/sheep/gamegroup/view/activity/ActSetting.java
  25. 11 11
      app/src/main/java/com/sheep/gamegroup/view/activity/PersonalInfoAct.java
  26. 1 294
      app/src/main/java/com/sheep/gamegroup/view/activity/SplashAct.java
  27. 3 14
      app/src/main/java/com/sheep/gamegroup/view/activity/TryMakeMoneyact.java
  28. 2 9
      app/src/main/java/com/sheep/gamegroup/view/adapter/GiftCenterAdapter.java
  29. 5 2
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGiftCenter.java
  30. 1 1
      app/src/main/java/com/sheep/jiuyan/samllsheep/Config.java
  31. 6 1
      app/src/main/java/com/sheep/jiuyan/samllsheep/utils/ClassFileHelper.java
  32. BIN
      app/src/main/res/drawable-xxhdpi/button_bg.9.png
  33. BIN
      app/src/main/res/drawable-xxhdpi/button_bg_gray.9.png
  34. 3 13
      app/src/main/res/layout/act_setting.xml
  35. 0 78
      app/src/main/res/layout/activity_video_task.xml
  36. 1 1
      app/src/main/res/layout/mine_fragment.xml
  37. 0 39
      app/src/main/res/layout/splash_activity.xml

+ 1 - 25
app/src/main/AndroidManifest.xml

@@ -35,6 +35,7 @@
     <uses-permission
         android:name="android.permission.PACKAGE_USAGE_STATS"
         tools:ignore="ProtectedPermissions" />
+    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
     <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <!-- 必须的权限配置 -->
     <uses-permission
         android:name="android.permission.READ_LOGS"
@@ -47,21 +48,12 @@
     <uses-permission android:name="android.permission.WRITE_CONTACTS" /> <!-- 读通话记录权限 -->
     <uses-permission android:name="android.permission.WRITE_CALL_LOG" />
     <uses-permission android:name="android.permission.READ_CALL_LOG" />
-
     <!--华硕设备必须-->
     <uses-permission android:name="com.asus.msa.SupplementaryDID.ACCESS" />
 
     <uses-feature android:name="android.hardware.camera" />
     <uses-feature android:name="android.hardware.camera.autofocus" />
 
-    <!--    <uses-sd-->
-    <!--            tools:overrideLibrary="com.bun.miitmdid"-->
-    <!--            tools:ignore="GradleOverrides"/>-->
-
-    <permission
-        android:name="android.permission.FLASHLIGHT"
-        android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
-        android:protectionLevel="normal" />
 
     <application
         android:name=".SheepApp"
@@ -80,27 +72,11 @@
         android:usesCleartextTraffic="true"
         tools:replace="android:appComponentFactory">
 
-        <provider
-            android:name="com.tencent.klevin.utils.FileProvider"
-            android:authorities="${applicationId}.klevin.fileProvider"
-            android:exported="false"
-            android:grantUriPermissions="true">
-            <meta-data
-                android:name="android.support.FILE_PROVIDER_PATHS"
-                android:resource="@xml/klevin_provider_paths" />
-        </provider>
-
-
         <service
             android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
             android:label="dexopt"
             android:process=":dexopt"></service>
 
-        <activity
-            android:name="com.sheep.gamegroup.module.task.VideoTaskActivity"
-            android:configChanges="keyboardHidden|navigation|orientation|screenSize"
-            android:screenOrientation="portrait"
-            android:theme="@style/AppThemeMain" />
 
         <activity
             android:name="com.sheep.gamegroup.module.qrcode.ScanQRCodeActivity"

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/event/EventTypes.java

@@ -62,5 +62,5 @@ public enum EventTypes {
 
     CHECK_VIP,
     USER_LOGIN,
-    USER_LOGOUT, USER_INFO,
+    USER_LOGOUT, USER_INFO, REFRESH_LIBAO_LIST,
 }

+ 5 - 2
app/src/main/java/com/sheep/gamegroup/gaiban/mainpage/mine/MineFragment.java

@@ -143,7 +143,11 @@ public class MineFragment extends BaseFragment {
                 @Override
                 public void call(UserEntity userEntity) {
                     GlideImageLoader.setAvatar(binding.ivAvatar, userEntity.getAvatar(), Color.argb(128, 255, 255, 255));
-                    binding.tvNickname.setText(userEntity.getNickname());
+                    String nickname = userEntity.getNickname();
+                    if (nickname == null || nickname.isEmpty()) {
+                        nickname = "昵称未设置";
+                    }
+                    binding.tvNickname.setText(nickname);
                 }
             });
         }
@@ -156,7 +160,6 @@ public class MineFragment extends BaseFragment {
                 initWidget();
                 break;
             case USER_LOGOUT:
-                UserInfoDataSource.getInstance().logout();
                 binding.tvNickname.setText("登录/注册");
                 binding.ivAvatar.setImageDrawable(getResources().getDrawable(R.drawable.logo));
                 break;

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

@@ -640,7 +640,7 @@ public interface ApiService {
     /**
      * 已经反馈
      */
-    @POST("v1/app/feedback")
+    @POST("v2/app/feedback")
     Observable<BaseMessage> feedback(@Body JSONObject jsonObject);
 
     /**

+ 0 - 1
app/src/main/java/com/sheep/gamegroup/model/entity/UserEntity.java

@@ -126,7 +126,6 @@ public class UserEntity implements Serializable {
     public String getNickname() {
         return nickname;
     }
-
     public void setNickname(String nickname) {
         this.nickname = nickname;
     }

+ 17 - 4
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtDownloadManager.java

@@ -5,6 +5,7 @@ import static com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp.PUBLIC_TAG_PREFIX
 import android.app.Activity;
 import android.content.Intent;
 import android.view.View;
+import android.view.ViewGroup;
 import android.widget.ProgressBar;
 import android.widget.TextView;
 
@@ -77,7 +78,6 @@ public class FgtDownloadManager extends BaseListFragment6<String> {
         tagList.add("下载游戏");
         tagList.add("猜你喜欢");
         apiRefresh = new AbsApiRefresh<DownLoadInfo>(this) {
-
             @Override
             public void initData() {
                 Observable.create((ObservableOnSubscribe<List<DownLoadInfo>>) emitter -> emitter.onNext(downloadUtil.getAllDownloadTasks()))
@@ -167,6 +167,22 @@ public class FgtDownloadManager extends BaseListFragment6<String> {
         };
         appFormGameCenterAdapter = new AdpGameCenter4_3(apiRefresh2.getList());
         return new BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_play_game_list, tagList) {
+            @Override
+            public int getItemViewType(int position) {
+                return super.getItemViewType(position);
+            }
+
+            @Override
+            protected BaseViewHolder onCreateDefViewHolder(ViewGroup parent, int viewType) {
+                BaseViewHolder baseViewHolder = super.onCreateDefViewHolder(parent, viewType);
+                RecyclerView recyclerView = baseViewHolder.getView(R.id.item_play_game_list_rv);
+                if (viewType == 0) {
+                    DividerItemDecoration itemDecoration = new DividerItemDecoration(getContext(), RecyclerView.VERTICAL);
+                    itemDecoration.setDrawable(getResources().getDrawable(R.drawable.divider_12dp));
+                    recyclerView.addItemDecoration(itemDecoration);
+                }
+                return baseViewHolder;
+            }
 
             @Override
             protected void convert(BaseViewHolder holder, String item) {
@@ -182,9 +198,6 @@ public class FgtDownloadManager extends BaseListFragment6<String> {
                     case 0:
                         binding.itemPlayGameListRl.setVisibility(View.GONE);
                         recyclerView.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
-                        DividerItemDecoration itemDecoration = new DividerItemDecoration(getContext(), RecyclerView.VERTICAL);
-                        itemDecoration.setDrawable(getResources().getDrawable(R.drawable.divider_12dp));
-                        recyclerView.addItemDecoration(itemDecoration);
                         recyclerView.setAdapter(downLoadInfoAdapter);
                         break;
                     case 1:

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/module/login/LoginAct.java

@@ -178,6 +178,7 @@ public class LoginAct extends BaseUMActivity implements LoginController {
         //登录成功记录设备信息
         ApiJSONUtil.postUserDeviceLog();
         EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.USER_LOGIN));
+        goMain(loginResult);
         finish();
     }
 

+ 0 - 530
app/src/main/java/com/sheep/gamegroup/module/task/OldVideoTaskActivity.java

@@ -1,530 +0,0 @@
-package com.sheep.gamegroup.module.task;
-
-import android.Manifest;
-import android.content.pm.PackageManager;
-import android.os.Build;
-import android.os.Bundle;
-import androidx.annotation.NonNull;
-import androidx.core.app.ActivityCompat;
-import androidx.core.content.ContextCompat;
-import android.text.TextUtils;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.WindowManager;
-import android.widget.Button;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.kfzs.duanduan.cardview.ScreenUtil;
-import com.kfzs.duanduan.utils.ApkUtils;
-import com.sheep.gamegroup.absBase.BaseActivity;
-import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.Release_task;
-import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
-import com.sheep.gamegroup.model.util.SheepSubscriber;
-import com.sheep.gamegroup.module.task.helper.ADDownloader;
-import com.sheep.gamegroup.module.task.helper.ADVideoHelper;
-import com.sheep.gamegroup.module.task.helper.VideoAd;
-import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.gamegroup.util.DeviceUtil;
-import com.sheep.gamegroup.util.GlideImageLoader;
-import com.sheep.gamegroup.util.Jump2View;
-import com.sheep.gamegroup.util.LocationUtils;
-import com.sheep.gamegroup.util.LogUtil;
-import com.sheep.gamegroup.util.UMConfigUtils;
-import com.sheep.gamegroup.util.ViewUtil;
-import com.sheep.gamegroup.view.customview.SheepGSYVideoView;
-import com.sheep.gamegroup.view.dialog.DialogProgress;
-import com.sheep.jiuyan.samllsheep.BuildConfig;
-import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.utils.G;
-import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
-import com.shuyu.gsyvideoplayer.GSYVideoManager;
-import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
-import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack;
-import com.shuyu.gsyvideoplayer.video.base.GSYVideoView;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import butterknife.BindView;
-import butterknife.OnClick;
-import io.reactivex.android.schedulers.AndroidSchedulers;
-import io.reactivex.schedulers.Schedulers;
-
-public class OldVideoTaskActivity extends BaseActivity {
-
-    @BindView(R.id.video_player_view)
-    SheepGSYVideoView videoPlayerView;
-    @BindView(R.id.mask_view)
-    View mask_view;
-    @BindView(R.id.desc_tv)
-    TextView desc_tv;
-    @BindView(R.id.name_tv)
-    TextView name_tv;
-    @BindView(R.id.action_btn)
-    Button action_btn;
-    @BindView(R.id.logo_iv)
-    ImageView logo_iv;
-    @BindView(R.id.countdown_view)
-    TextView countdown_view;
-
-    private int releaseTaskId = -1;
-
-    private Release_task releaseTask;
-    private TaskAcceptedEty acceptedTask;
-
-    private VideoAd currentVideoAd;
-    private int watchCount = 0;
-
-    @Override
-    protected int getLayoutId() {
-        return R.layout.activity_video_task;
-    }
-
-    @Override
-    public void onBackPressed() {
-        ViewUtil.showConfirmDialog(OldVideoTaskActivity.this,
-                "提示",
-                "你确定要放弃奖励吗?",
-                "放弃", "继续观看",
-                d -> giveUpTask(),
-                d -> LogUtil.logI("continue watch video")).show();
-    }
-
-    @Override
-    public void onCreate(Bundle b) {
-        super.onCreate(b);
-        getWindow().addFlags(
-                WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON |
-                        WindowManager.LayoutParams.FLAG_FULLSCREEN);
-    }
-
-    @Override
-    public void onWindowFocusChanged(boolean hasFocus) {
-        super.onWindowFocusChanged(hasFocus);
-        int flag = View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && G.checkDeviceHasNavigationBar(this)) {
-            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);//白色
-            flag |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
-                    View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
-                    View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | // hide
-                    View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
-        }
-        getWindow().getDecorView().setSystemUiVisibility(flag);
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-        videoPlayerView.onVideoResume();
-        configActionBtn();
-    }
-
-    @Override
-    public void onPause() {
-        super.onPause();
-        videoPlayerView.onVideoPause();
-    }
-
-    @Override
-    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
-        if (checkLocationPermission()) {
-            loadReleaseTask();
-        }
-    }
-
-    @Override
-    public void onDestroy() {
-        if (currentVideoAd != null) {
-            currentVideoAd.trigger(VideoAd.TYPE_VIDEO_CLOSE);
-        }
-        super.onDestroy();
-    }
-
-    @Override
-    public void initView() {
-        videoPlayerView.setShowControlView(false);
-        videoPlayerView.getBackButton().setVisibility(View.GONE);
-        videoPlayerView.getFullscreenButton().setVisibility(View.GONE);
-        videoPlayerView.getBottomProgressBar().setVisibility(View.GONE);
-
-        mask_view.setOnTouchListener((v, event) -> {
-            if (event.getAction() == MotionEvent.ACTION_UP && currentVideoAd != null) {
-                currentVideoAd.clickX = (int) event.getRawX();
-                currentVideoAd.clickY = (int) event.getRawY();
-                currentVideoAd.trigger(VideoAd.TYPE_CLICK);
-                if (videoPlayerView.getCurrentState() == GSYVideoView.CURRENT_STATE_PAUSE) {
-                    videoPlayerView.onVideoResume();
-                } else if (videoPlayerView.getCurrentState() == GSYVideoView.CURRENT_STATE_PLAYING) {
-                    videoPlayerView.onVideoPause();
-                }
-            }
-            return true;
-        });
-    }
-
-    @Override
-    public void initData() {
-        releaseTaskId = getIntent().getIntExtra("task_id", -1);
-        if (checkLocationPermission()) {
-            loadReleaseTask();
-        }
-    }
-
-    private void loadReleaseTask() {
-        CommonUtil.getInstance().getTaskDesc(releaseTaskId, rt -> {
-            if (rt == null) {
-                G.showToast("没有该任务");
-                finish();
-                return;
-            }
-            releaseTask = rt;
-            if (releaseTask.getAccepted_task_id() > 0) {
-                loadAcceptedTask();
-            } else {
-                LogUtil.logI("---------------没有接受任务---------------");
-                acceptTask();
-            }
-        });
-    }
-
-    private void loadAcceptedTask() {
-        CommonUtil.getInstance().getAcceptedTask(releaseTaskId, at -> {
-            if (at == null) {
-                acceptTask();
-                return;
-            }
-            acceptedTask = at;
-            if (watchCount == 0) {
-                loadAd();
-            } else {
-                ViewUtil.showConfirmDialog(OldVideoTaskActivity.this,
-                        "提示",
-                        "你需要观看" + releaseTask.getTask().getVideo_num() + "个视频, 即可获得" + releaseTask.getBonusText() + "元",
-                        "放弃", "继续观看",
-                        d -> giveUpTask(),
-                        d -> loadAd()).show();
-            }
-        });
-    }
-
-    private void loadAd() {
-        ADVideoHelper.loadVideoAD((ret, ad, msg) -> {
-            runOnUiThread(() -> {
-                if (ret) {
-                    currentVideoAd = ad;
-                    desc_tv.setText(currentVideoAd.desc);
-                    name_tv.setText(currentVideoAd.title);
-                    GlideImageLoader.circleImage(logo_iv, currentVideoAd.logo);
-                    playVideo();
-                    configActionBtn();
-                } else {
-                    ViewUtil.showConfirmDialog(OldVideoTaskActivity.this,
-                            "不好",
-                            "没获取到视频小片,需要再次获取吗?",
-                            "放弃", "重试",
-                            d -> giveUpTask(),
-                            d -> loadAd()).show();
-                }
-            });
-        });
-    }
-
-    private void configActionBtn() {
-        if (this.isDestroyed() || currentVideoAd == null || currentVideoAd.url == null) return;
-        if (!currentVideoAd.url.endsWith(".apk")) {
-            action_btn.setText("查看详情");
-            action_btn.setTag(0);
-        } else {
-            String path = ADDownloader.getUrlPath(currentVideoAd.url);
-            if (PackageUtil.isAppInstalled(SheepApp.getInstance(), currentVideoAd.package_name)) {
-                action_btn.setText("打开应用");
-                action_btn.setTag(1);
-            } else if (!TextUtils.isEmpty(path)) {
-                action_btn.setText("立即安装");
-                action_btn.setTag(2);
-                currentVideoAd.path = path;
-            } else {
-                action_btn.setText("下载应用");
-                action_btn.setTag(3);
-            }
-        }
-    }
-
-    @OnClick(R.id.action_btn)
-    public void onActionClick(View v) {
-        int action = (int) v.getTag();
-        switch (action) {
-            case 0:
-                jumpWeb();
-                break;
-            case 1:
-                openApp();
-                break;
-            case 2:
-                installApp();
-                break;
-            case 3:
-                downloadApp();
-                break;
-        }
-    }
-
-    private void playVideo() {
-        GSYVideoOptionBuilder gsyVideoOption = new GSYVideoOptionBuilder();
-        gsyVideoOption.setIsTouchWiget(false)
-                .setRotateViewAuto(true)
-                .setLockLand(true)
-                .setAutoFullWithSize(false)
-                .setShowFullAnimation(false)
-                .setUrl(currentVideoAd.videoUrl)
-                .setNeedLockFull(true)
-                .setCacheWithPlay(false)
-                .setGSYVideoProgressListener((progress, secProgress, currentPosition, duration) -> {
-                    countdown_view.setText("" + ((duration - currentPosition) / 1000));
-                })
-                .setVideoAllCallBack(new GSYSampleCallBack() {
-                    @Override
-                    public void onPrepared(String url, Object... objects) {
-                        super.onPrepared(url, objects);
-                        LogUtil.println("initPlay", "onPrepared", url, objects);
-                    }
-
-                    @Override
-                    public void onAutoComplete(String url, Object... objects) {
-                        super.onAutoComplete(url, objects);
-                        currentVideoAd.trigger(VideoAd.TYPE_VIDEO_END);
-                        watchCount++;
-                        if (watchCount >= releaseTask.getTask().getVideo_num()) {
-                            commitAutoTask();
-                        } else {
-                            ViewUtil.showConfirmDialog(OldVideoTaskActivity.this,
-                                    "提示",
-                                    "你需要观看" + (releaseTask.getTask().getVideo_num() - watchCount) + "个视频, 即可获得" + releaseTask.getBonusText() + "元",
-                                    "放弃", "继续观看",
-                                    d -> giveUpTask(),
-                                    d -> loadAd()).show();
-                        }
-                    }
-
-                    @Override
-                    public void onPlayError(String url, Object... objects) {
-                        super.onPlayError(url, objects);
-                        long curPosition = GSYVideoManager.instance().getCurPlayerManager().getCurrentPosition();
-                        LogUtil.println("initPlay", "onPlayError", url, curPosition);
-                    }
-                }).build(videoPlayerView);
-        videoPlayerView.startPlayLogic();
-        currentVideoAd.trigger(VideoAd.TYPE_VIDEO_START);
-    }
-
-    private void acceptTask() {
-        String device_id = DeviceUtil.getDeviceId(SheepApp.getInstance());
-        UMConfigUtils.Event.TASK_ACCEPT.onEvent("device_id", device_id, "release_task_id", releaseTaskId);
-        JSONObject object = new JSONObject();
-        object.put("device_id", device_id);
-        object.put("release_task_id", releaseTaskId);
-        object.put("create_time", System.currentTimeMillis() / 1000L);
-        object.put("app_version", String.valueOf(BuildConfig.VERSION_CODE));
-        SheepApp.getInstance()
-                .getNetComponent()
-                .getApiService()
-                .acceptedTask(object)
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        G.showToast(baseMessage.getErrorMsg());
-                    }
-
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        releaseTask.setIs_running(true);
-                        releaseTask.getTask().setRelease_task_id(releaseTask.getId());
-                        loadAcceptedTask();
-                    }
-                });
-    }
-
-    private void commitAutoTask() {
-        JSONObject params = new JSONObject();
-        String gps = LocationUtils.getInstance().getLongitudeLatitude();
-        params.put("gps", gps);
-        params.put("release_task_id", releaseTaskId);
-        params.put("create_time", System.currentTimeMillis() / 1000L);//这里添加时间戳,防止用户抓包后重复使用
-        SheepApp.getInstance().getNetComponent().getApiService().commitAutoTask(params)
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(getApplicationContext()) {
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        CommonUtil.getInstance().updateAutoCheck(null);
-                        //这里领取了奖励,要刷新用户信息
-                        CommonUtil.getInstance().updateUserInfo(null);
-                        String amount = releaseTask.getBonusText();
-                        try {
-                            Map h = JSON.parseObject(baseMessage.getData() + "");
-
-                            amount = h.get("amount") + "";
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        }
-
-                        ViewUtil.showMsgDialog(OldVideoTaskActivity.this, String.format(Locale.CHINA, "奖励已完成,获得奖励%s元", TextUtils.isEmpty(amount) ? releaseTask.getBonusText() : amount), "恭喜你", true);
-                    }
-
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        G.showToast(baseMessage);
-                        resubmitAutoCheck();
-                    }
-                });
-    }
-
-    private void giveUpTask() {
-        if(acceptedTask!=null) {
-            SheepApp.getInstance()
-                    .getNetComponent()
-                    .getApiService()
-                    .giveUpTask(acceptedTask.getId())
-                    .subscribeOn(Schedulers.io())
-                    .observeOn(AndroidSchedulers.mainThread())
-                    .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                        @Override
-                        public void onError(BaseMessage baseMessage) {
-                        }
-
-                        @Override
-                        public void onNext(BaseMessage baseMessage) {
-                        }
-                    });
-        }
-        finish();
-    }
-
-    private void resubmitAutoCheck() {
-        ViewUtil.showConfirmDialog(OldVideoTaskActivity.this,
-                "提示",
-                "提交任务失败,需要重新提交吗?",
-                "放弃", "重试",
-                d -> giveUpTask(),
-                d -> commitAutoTask()).show();
-    }
-
-    private void jumpWeb() {
-        if (currentVideoAd == null) return;
-        Jump2View.getInstance().goWeb(this, currentVideoAd.url);
-    }
-
-    private void openApp() {
-        if (currentVideoAd == null) return;
-        currentVideoAd.trigger(VideoAd.TYPE_ACTIVE);
-        currentVideoAd.trigger(VideoAd.TYPE_OPEN);
-        PackageUtil.startApp(this, currentVideoAd.package_name);
-    }
-
-    private void downloadApp() {
-        if (currentVideoAd == null) return;
-        videoPlayerView.onVideoPause();
-        currentVideoAd.trigger(VideoAd.TYPE_DOWNLOAD);
-        showDownloadDialog();
-    }
-
-    private void installApp() {
-        if (currentVideoAd == null) return;
-        currentVideoAd.trigger(VideoAd.TYPE_INSTALL);
-        ApkUtils.installApk(this, currentVideoAd.path);
-    }
-
-    private void installApp(VideoAd ad) {
-        if (ad == null) return;
-        ad.trigger(VideoAd.TYPE_INSTALL);
-        ApkUtils.installApk(this, ad.path);
-    }
-
-    private void showAppConfirmDialog(String title, String btnText, ViewUtil.OnConfirmDialogListener listener) {
-        View rootView = View.inflate(this, R.layout.video_ad_confirm, null);
-        ImageView app_logo_iv = rootView.findViewById(R.id.app_logo_iv);
-        TextView app_name_tv = rootView.findViewById(R.id.app_name_tv);
-        TextView app_desc_tv = rootView.findViewById(R.id.app_desc_tv);
-        int radius = ScreenUtil.dip2px(this, 8);
-        GlideImageLoader.roundedCornersImage(app_logo_iv, currentVideoAd.logo, radius);
-        app_name_tv.setText(currentVideoAd.title);
-        app_desc_tv.setText(currentVideoAd.desc);
-        videoPlayerView.onVideoPause();
-        ViewUtil.showConfirmDialog(this, title, rootView, "取消", btnText,
-                d -> {
-                    d.dismiss();
-                    videoPlayerView.onVideoResume();
-                },
-                listener).show();
-    }
-
-    private void showDownloadDialog() {
-        final DialogProgress progress = DialogProgress.showDialog(this, true);
-        progress.getAlertDialog().setOnDismissListener(d -> {
-
-        });
-        final VideoAd thisAd = currentVideoAd.clone();
-        new ADDownloader()
-                .setListener(new ADDownloader.ProgressListener() {
-
-                    @Override
-                    public void onProgress(long offset, long total) {
-                        LogUtil.logE(offset + " /// " + total);
-                        long percent = offset * 100 / total;
-                        runOnUiThread(() -> {
-                            if (progress.getAlertDialog().isShowing()) {
-                                progress.getTextView().setText(percent + "%");
-                            }
-                        });
-                    }
-
-                    @Override
-                    public void onStatus(String status, String msg) {
-                        runOnUiThread(() -> {
-                            if (OldVideoTaskActivity.this.isDestroyed()) return;
-                            if (progress.getAlertDialog().isShowing()) {
-                                progress.getAlertDialog().dismiss();
-                            }
-                            if ("COMPLETED".equals(status)) {
-                                thisAd.path = msg;
-                                configActionBtn();
-                                installApp(thisAd);
-                            } else {
-                                videoPlayerView.onVideoResume();
-                                LogUtil.logE(status + " /// " + msg);
-                            }
-                        });
-                    }
-                })
-                .init()
-                .start(currentVideoAd);
-
-    }
-
-    public boolean checkLocationPermission() {
-        List<String> permissions = new ArrayList<String>();
-        boolean result = true;
-        if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
-            permissions.add(Manifest.permission.ACCESS_COARSE_LOCATION);
-            result = false;
-        }
-        if (permissions.size() > 0) {
-            String[] permissionArrays = new String[permissions.size()];
-            permissionArrays = permissions.toArray(permissionArrays);
-            ActivityCompat.requestPermissions(this,
-                    permissionArrays,
-                    1111);
-        }
-        return result;
-    }
-
-}

+ 0 - 134
app/src/main/java/com/sheep/gamegroup/module/task/VideoTaskActivity.java

@@ -1,134 +0,0 @@
-package com.sheep.gamegroup.module.task;
-
-import android.Manifest;
-import android.content.pm.PackageManager;
-import android.os.Build;
-import android.os.Bundle;
-import androidx.annotation.NonNull;
-import androidx.core.app.ActivityCompat;
-import androidx.fragment.app.FragmentTransaction;
-import androidx.core.content.ContextCompat;
-import android.view.View;
-import android.view.WindowManager;
-import com.sheep.gamegroup.absBase.BaseActivity;
-import com.sheep.gamegroup.model.entity.Release_task;
-import com.sheep.gamegroup.module.task.fragments.*;
-import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.utils.G;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class VideoTaskActivity extends BaseActivity {
-
-    protected FgtVideoTaskBase mFragment;
-
-    @Override
-    protected int getLayoutId() {
-        return R.layout.common_container;
-    }
-
-    @Override
-    public void initView() {
-        if (checkLocationPermission()) {
-
-            int releaseTaskId = getIntent().getIntExtra("task_id", -1);
-            CommonUtil.getInstance().getTaskDesc(releaseTaskId, rt -> {
-                if (rt == null) {
-                    G.showToast("没有该任务");
-                    finish();
-                    return;
-                }
-                initFragment(rt);
-            });
-        }
-    }
-
-    @Override
-    public void onCreate(Bundle b) {
-        super.onCreate(b);
-        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_FULLSCREEN);
-    }
-
-    @Override
-    public void onWindowFocusChanged(boolean hasFocus) {
-        super.onWindowFocusChanged(hasFocus);
-        int flag = View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && G.checkDeviceHasNavigationBar(this)) {
-            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);//白色
-            flag |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
-                    View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
-                    View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | // hide
-                    View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
-        }
-        getWindow().getDecorView().setSystemUiVisibility(flag);
-    }
-
-    @Override
-    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
-        if (checkLocationPermission()) {
-            initView();
-        }
-    }
-
-    protected void initFragment(Release_task releaseTask) {
-        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
-        mFragment = (FgtVideoTaskBase) getSupportFragmentManager().findFragmentByTag("tag");
-        if (mFragment == null) {
-            mFragment = getFragment(releaseTask);
-            transaction.add(R.id.frame_container, mFragment, "tag");
-            transaction.commitAllowingStateLoss();
-        } else {
-            transaction.replace(R.id.frame_container, mFragment);
-            transaction.commitAllowingStateLoss();
-        }
-    }
-
-    private FgtVideoTaskBase getFragment(Release_task releaseTask) {
-        switch (releaseTask.getTask().getVideo_type()) {
-            case 1:
-                //掌酷
-                return new FgtVideoTaskZK().setReleaseTaskId(releaseTask.getId()).setReleaseTask(releaseTask);
-            case 2:
-                //点客
-                return new FgtVideoTaskDK().setReleaseTaskId(releaseTask.getId()).setReleaseTask(releaseTask);
-            case 3:
-                //游可盈
-                return new FgtVideoTaskYKY().setReleaseTaskId(releaseTask.getId()).setReleaseTask(releaseTask);
-            case 4:
-                //优投 todo 优投暂时没有激励视频
-                return new FgtVideoTaskYKY().setReleaseTaskId(releaseTask.getId()).setReleaseTask(releaseTask);
-            default:
-                finish();
-                return null;
-
-        }
-    }
-
-    @Override
-    public void onBackPressed() {
-        if (mFragment != null) {
-            mFragment.onBackPressed();
-        } else {
-            super.onBackPressed();
-        }
-    }
-
-    public boolean checkLocationPermission() {
-        List<String> permissions = new ArrayList<String>();
-        boolean result = true;
-        if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
-            permissions.add(Manifest.permission.ACCESS_COARSE_LOCATION);
-            result = false;
-        }
-        if (permissions.size() > 0) {
-            String[] permissionArrays = new String[permissions.size()];
-            permissionArrays = permissions.toArray(permissionArrays);
-            ActivityCompat.requestPermissions(this,
-                    permissionArrays,
-                    1111);
-        }
-        return result;
-    }
-}

+ 0 - 248
app/src/main/java/com/sheep/gamegroup/module/task/fragments/FgtVideoTaskBase.java

@@ -1,248 +0,0 @@
-package com.sheep.gamegroup.module.task.fragments;
-
-
-import android.app.Activity;
-import android.app.Dialog;
-import android.content.Intent;
-import android.util.Log;
-
-import com.alibaba.fastjson.JSONObject;
-import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.Release_task;
-import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
-import com.sheep.gamegroup.model.util.SheepSubscriber;
-import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.gamegroup.util.DeviceUtil;
-import com.sheep.gamegroup.util.GsonUtils;
-import com.sheep.gamegroup.util.LocationUtils;
-import com.sheep.gamegroup.util.LogUtil;
-import com.sheep.gamegroup.util.UMConfigUtils;
-import com.sheep.gamegroup.util.ViewUtil;
-import com.sheep.jiuyan.samllsheep.BuildConfig;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.base.BaseFragment;
-import com.sheep.jiuyan.samllsheep.utils.G;
-import io.reactivex.android.schedulers.AndroidSchedulers;
-import io.reactivex.functions.Consumer;
-import io.reactivex.schedulers.Schedulers;
-
-public abstract class FgtVideoTaskBase extends BaseFragment {
-
-    public static String KEY_RELEASE_TASK = "key_release_task";
-
-    protected int releaseTaskId = -1;
-    protected Release_task releaseTask;
-    protected TaskAcceptedEty acceptedTask;
-    protected boolean goNext = false;
-
-    //当前已观看视频数
-    protected int watchCount = 0;
-
-    public FgtVideoTaskBase setReleaseTaskId(int taskId) {
-        releaseTaskId = taskId;
-        return this;
-    }
-
-    public FgtVideoTaskBase setReleaseTask(Release_task task) {
-        releaseTask = task;
-        return this;
-    }
-
-    //放弃任务
-    public void giveUpTask() {
-        if (acceptedTask != null) {
-            SheepApp.getInstance()
-                    .getNetComponent()
-                    .getApiService()
-                    .giveUpTask(acceptedTask.getId())
-                    .subscribeOn(Schedulers.io())
-                    .observeOn(AndroidSchedulers.mainThread())
-                    .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                        @Override
-                        public void onError(BaseMessage baseMessage) {
-                            getActivity().finish();
-                        }
-
-                        @Override
-                        public void onNext(BaseMessage baseMessage) {
-                            getActivity().finish();
-                        }
-                    });
-        } else {
-            getActivity().finish();
-        }
-
-    }
-
-    //重新提交弹窗
-    protected void resubmitAutoCheck() {
-        Dialog dialog = ViewUtil.showConfirmDialog(getContext(),
-                "提示",
-                "提交任务失败,需要重新提交吗?",
-                "放弃", "重试",
-                d -> giveUpTask(),
-                d -> commitAutoTask());
-        dialog.setCancelable(false);
-        dialog.show();
-    }
-
-    //提交任务
-    protected void commitAutoTask() {
-        JSONObject params = new JSONObject();
-        String gps = LocationUtils.getInstance().getLongitudeLatitude();
-        params.put("gps", gps);
-        params.put("release_task_id", releaseTaskId);
-        params.put("create_time", System.currentTimeMillis() / 1000L);//这里添加时间戳,防止用户抓包后重复使用
-        SheepApp.getInstance().getNetComponent().getApiService()
-                .commitAutoTask(params)
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        CommonUtil.getInstance().updateAutoCheck(null);
-                        //这里领取了奖励,要刷新用户信息
-                        CommonUtil.getInstance().updateUserInfo(null);
-                        if (getActivity() != null) {
-                            AndroidSchedulers.mainThread().scheduleDirect(() -> {
-                                String releaseTaskJson = GsonUtils.getGlobalGson().toJson(releaseTask);
-                                Intent intent = getActivity().getIntent().putExtra(KEY_RELEASE_TASK, releaseTaskJson);
-                                getActivity().setResult(Activity.RESULT_OK, intent);
-                            });
-                        }
-                    }
-
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        G.showToast(baseMessage.getMsg());
-                        resubmitAutoCheck();
-                    }
-                });
-    }
-
-    //接收任务
-    protected void acceptTask() {
-        String device_id = DeviceUtil.getDeviceId(SheepApp.getInstance());
-        UMConfigUtils.Event.TASK_ACCEPT.onEvent("device_id", device_id, "release_task_id", releaseTaskId);
-        JSONObject object = new JSONObject();
-        object.put("device_id", device_id);
-        object.put("release_task_id", releaseTaskId);
-        object.put("create_time", System.currentTimeMillis() / 1000L);
-        object.put("app_version", String.valueOf(BuildConfig.VERSION_CODE));
-        SheepApp.getInstance()
-                .getNetComponent()
-                .getApiService()
-                .acceptedTask(object)
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        if (baseMessage.getCode() == 400001) {
-                            randomGoods();
-                        } else {
-                            hideProgress();
-                            G.showToast(baseMessage.getErrorMsg());
-                            getActivity().finish();
-                        }
-                    }
-
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        releaseTask.setIs_running(true);
-                        releaseTask.getTask().setRelease_task_id(releaseTask.getId());
-                        loadAcceptedTask();
-                    }
-                });
-    }
-
-    //给商城任务随机商品
-    public void randomGoods() {
-        SheepApp.getInstance()
-                .getNetComponent()
-                .getApiService()
-                .randomGoodsForTask(releaseTaskId)
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        hideProgress();
-                        acceptTask();
-                    }
-
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        hideProgress();
-                        G.showToast(baseMessage.getErrorMsg());
-                    }
-                });
-    }
-
-    //加载接收的任务
-    public void loadAcceptedTask() {
-        CommonUtil.getInstance().getAcceptedTask(releaseTaskId, at -> {
-            if (at == null) {
-                acceptTask();
-                return;
-            }
-            acceptedTask = at;
-            if (watchCount == 0)
-                loadAd();
-            else
-                VideoTaskDialogUtil.showContinueWatchWarningDialog(
-                        getContext(),
-                        releaseTask,
-                        d -> loadAd(),
-                        d -> giveUpTask()
-                );
-        });
-    }
-
-    //尝试获取奖励
-    protected void tryGetReward() {
-        watchCount++;
-        if (watchCount >= releaseTask.getTask().getVideo_num())
-            commitAutoTask();
-        else
-            VideoTaskDialogUtil.showContinueWatchWarningDialog(
-                    getContext(),
-                    releaseTask,
-                    d -> loadAd(),
-                    d -> giveUpTask()
-            );
-    }
-
-
-    @Override
-    public boolean onBackPressed() {
-        VideoTaskDialogUtil.showGiveUpWarningDialog(
-                getContext(),
-                d -> LogUtil.logI("continue watch video"),
-                d -> giveUpTask()
-        );
-        return false;
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-        if (goNext) {
-            goNext = false;
-            tryGetReward();
-        }
-    }
-
-    @Override
-    public void onViewCreated() {
-        initView();
-        initData();
-    }
-
-    protected abstract void initView();
-
-    protected abstract void initData();
-
-    protected abstract void loadAd();
-
-}

+ 0 - 82
app/src/main/java/com/sheep/gamegroup/module/task/fragments/FgtVideoTaskDK.java

@@ -1,82 +0,0 @@
-package com.sheep.gamegroup.module.task.fragments;
-
-import com.sheep.gamegroup.util.LogUtil;
-import com.stmsdk.module.ad.StyleAdEntity;
-import com.tencent.tmsecure.dksdk.ad.DkAdManage;
-import com.tencent.tmsecure.dksdk.util.DkAppDownloadListener;
-
-/**
- * 点客广告视频
- */
-public class FgtVideoTaskDK extends FgtVideoTaskBase implements DkAppDownloadListener {
-
-    private DkAdManage adManage;
-
-    @Override
-    protected void initView() {
-        adManage = new DkAdManage(getActivity());
-    }
-
-    @Override
-    protected void initData() {
-        if (releaseTask.getH5_accepted_task_id() > 0) {
-            loadAcceptedTask();
-        } else {
-            LogUtil.logI("---------------没有接受任务---------------");
-            acceptTask();
-        }
-    }
-
-    @Override
-    protected void loadAd() {
-        adManage.loadTmAdById("samllsheep", 104, this);
-    }
-
-    @Override
-    public int getLayoutId() {
-        return 0;
-    }
-
-    @Override
-    public void onShow(String s, String s1) {
-        LogUtil.logI("Video task onShow(" + s + ", " + s1 + ")");
-    }
-
-    @Override
-    public void onPlayed(String s) {
-        LogUtil.logI("Video task onPlayed(" + s + ")");
-        goNext = true;
-    }
-
-    @Override
-    public void onClosed(String s, boolean b, String s1, String s2) {
-        LogUtil.logI("Video task onClosed(" + s + ", " + s1 + ")");
-        goNext = true;
-    }
-
-    @Override
-    public void onAdClick(String s, String s1) {
-        LogUtil.logI("Video task onAdClick(" + s + ", " + s1 + ")");
-    }
-
-    @Override
-    public void onDownloadFinished(String s, String s1) {
-        LogUtil.logI("Video task onDownloadFinished(" + s + ", " + s1 + ")");
-    }
-
-    @Override
-    public void onInstalled(String s, String s1) {
-        LogUtil.logI("Video task onInstalled(" + s + ", " + s1 + ")");
-    }
-
-    @Override
-    public void onLoadFail(String s, String s1) {
-        LogUtil.logI("Video task onLoadFail(" + s + ", " + s1 + ")");
-    }
-
-    @Override
-    public void onAwakened(StyleAdEntity styleAdEntity, int i) {
-        LogUtil.logI("Video task onAwakened(" + i + ")");
-    }
-
-}

+ 0 - 127
app/src/main/java/com/sheep/gamegroup/module/task/fragments/FgtVideoTaskYKY.java

@@ -1,127 +0,0 @@
-package com.sheep.gamegroup.module.task.fragments;
-
-import android.util.Log;
-import com.sheep.gamegroup.util.LogUtil;
-import com.sheep.jiuyan.samllsheep.utils.G;
-import com.tencent.klevin.ads.ad.RewardAd;
-import com.tencent.klevin.ads.ad.RewardAdRequest;
-
-/**
- * 游可盈广告视频
- */
-
-public class FgtVideoTaskYKY extends FgtVideoTaskBase {
-    private static final String TAG = "游可盈视频广告页";
-
-    @Override
-    protected void initView() {
-
-    }
-
-    @Override
-    protected void initData() {
-        if (releaseTask.getH5_accepted_task_id() > 0) {
-            loadAcceptedTask();
-        } else {
-            LogUtil.logI("---------------没有接受任务---------------");
-            acceptTask();
-        }
-    }
-
-    @Override
-    protected void loadAd() {
-        preAd();
-    }
-
-    //是否领过奖了
-    boolean hasGetReward = false;
-
-    //预加载激励视频
-    private void preAd() {
-        int posId = 30113;  //正式30113  测试30031
-
-        RewardAdRequest.Builder rewardAdBuilder = new RewardAdRequest.Builder();
-        rewardAdBuilder.autoMute(true)//【可选】设置是否自动静音,默认 false
-                .setRewardTrigger(RewardAdRequest.TRIGGER_OTHER)//【可选】激励类型
-                .setPosId(posId)//【必须】激励视频广告位 id
-                .setAdCount(1);//【可选】广告个数,默认 1
-
-        RewardAd.load(rewardAdBuilder.build(), new RewardAd.RewardAdLoadListener() {
-            @Override
-            public void onAdLoadError(int i, String s) {
-                G.showToast("游可盈video 加载onFail" + i + "  " + s);
-            }
-
-            @Override
-            public void onAdLoaded(RewardAd rewardAd) {
-                Log.d(TAG, "yky video load success ");
-                //下载激励视频素材成功,开始播放
-                showAd(rewardAd);
-            }
-        });
-
-    }
-
-    RewardAd mRewardAd;
-
-    //播放激励视频
-    private void showAd(RewardAd ad) {
-        // 广告素材下载完成,参数 ad 为激励视频广告实例
-        // 在此回调中触发展示广告,则使用本地播放的方式读取广告 Log.i(TAG, "reward ad loaded");
-        mRewardAd = ad;
-        if (mRewardAd != null) {
-            //设置激励视频广告展示回调
-            mRewardAd.setListener(new RewardAd.RewardAdListener() {
-                @Override
-                public void onAdSkip() {
-                    //用户跳过广告回调 Log.i(TAG, "onAdSkip");
-                    if (!hasGetReward) {
-                        //未领奖,调用放弃任务接口
-                        giveUpTask();
-                    } else {
-                        if (getActivity() != null)
-                            getActivity().finish();
-                    }
-                }
-
-                public void onReward() {
-                    //满足领奖条件,去领奖
-                    Log.i(TAG, "yky video onReward");
-                    hasGetReward = true;
-                    tryGetReward();
-                }
-
-                public void onVideoComplete() { //视频播放完成回调
-                    Log.i(TAG, "onVideoComplete");
-                    //G.showToast("游可盈video 播放结束");
-                }
-
-                public void onAdShow() {
-                    //广告曝光回调 Log.i(TAG, "onAdShow");
-                }
-
-                public void onAdClick() { //广告点击回调
-                    Log.i(TAG, "onAdClick");
-                }
-
-                public void onAdClosed() {
-                    //广告关闭回调 Log.i(TAG, "onAdClosed");
-
-                }
-
-                public void onAdError(int i, String msg) {
-                    //广告展示失败回调
-                    Log.e(TAG, "onAdError err: " + i + " " + msg);
-                }
-            });
-            mRewardAd.show(); //展示激励视频广告
-        }
-    }
-
-
-    @Override
-    public int getLayoutId() {
-        return 0;
-    }
-
-}

+ 0 - 108
app/src/main/java/com/sheep/gamegroup/module/task/fragments/FgtVideoTaskZK.java

@@ -1,108 +0,0 @@
-package com.sheep.gamegroup.module.task.fragments;
-
-import android.widget.Toast;
-import com.lygame.wrapper.interfaces.IRewardVideoController;
-import com.lygame.wrapper.interfaces.IRewardVideoLoadCallback;
-import com.lygame.wrapper.interfaces.IRewardVideoPlayCallback;
-import com.lygame.wrapper.sdk.LySdk;
-import com.sheep.gamegroup.util.LogUtil;
-
-import java.util.concurrent.atomic.AtomicReference;
-
-/**
- * 游可盈广告视频
- */
-
-public class FgtVideoTaskZK extends FgtVideoTaskBase {
-    private static final String TAG = "掌酷视频广告页";
-
-    //是否领过奖了
-    boolean hasGetReward = false;
-
-    private AtomicReference<IRewardVideoController> controllerRef = new AtomicReference<>();
-
-
-    @Override
-    protected void initView() {
-
-    }
-
-    @Override
-    protected void initData() {
-        if (releaseTask.getH5_accepted_task_id() > 0) {
-            loadAcceptedTask();
-        } else {
-            LogUtil.logI("---------------没有接受任务---------------");
-            acceptTask();
-        }
-    }
-
-    //加载激励视频
-    @Override
-    protected void loadAd() {
-        int adId = 52917;
-
-        LySdk.loadRewardVideo(getActivity(), String.valueOf(adId), new IRewardVideoLoadCallback() {
-            @Override
-            public void onFailed(int i, String s) {
-
-            }
-
-            @Override
-            public void onLoaded(IRewardVideoController iRewardVideoController) {
-                controllerRef.set(iRewardVideoController);
-                showAd();
-            }
-        });
-    }
-
-    //播放激励视频
-    private void showAd() {
-        IRewardVideoController controller;
-        if ((controller = controllerRef.getAndSet(null)) != null) {
-            controller.show(new IRewardVideoPlayCallback() {
-                @Override
-                public void onAdShow() {
-
-                }
-
-                @Override
-                public void onInterTriggered() {
-                    //Toast.makeText(getContext(), "广告点击了", Toast.LENGTH_SHORT).show();
-                }
-
-                @Override
-                public void onAdClose() {
-                    //用户点击关闭了界面
-                    if (!hasGetReward) {
-                        //未领奖,调用放弃任务接口
-                        giveUpTask();
-                    } else {
-                        if (getActivity() != null)
-                            getActivity().finish();
-                    }
-                }
-
-                @Override
-                public void onVideoComplete() {
-
-                }
-
-                @Override
-                public void onRewarded() {
-                    //满足领奖条件,去领奖
-                    hasGetReward = true;
-                    tryGetReward();
-                }
-            });
-        } else {
-            Toast.makeText(getContext(), "广告未加载成功", Toast.LENGTH_SHORT).show();
-        }
-    }
-
-    @Override
-    public int getLayoutId() {
-        return 0;
-    }
-
-}

+ 0 - 305
app/src/main/java/com/sheep/gamegroup/module/task/fragments/FgtVideoTaskZKOld.java

@@ -1,305 +0,0 @@
-package com.sheep.gamegroup.module.task.fragments;
-
-import android.text.TextUtils;
-import android.view.MotionEvent;
-import android.view.View;
-import android.widget.Button;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import com.kfzs.duanduan.cardview.ScreenUtil;
-import com.kfzs.duanduan.utils.ApkUtils;
-import com.sheep.gamegroup.module.task.helper.ADDownloader;
-import com.sheep.gamegroup.module.task.helper.ADVideoHelper;
-import com.sheep.gamegroup.module.task.helper.VideoAd;
-import com.sheep.gamegroup.util.GlideImageLoader;
-import com.sheep.gamegroup.util.Jump2View;
-import com.sheep.gamegroup.util.LogUtil;
-import com.sheep.gamegroup.util.ViewUtil;
-import com.sheep.gamegroup.view.customview.SheepGSYVideoView;
-import com.sheep.gamegroup.view.dialog.DialogProgress;
-import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
-import com.shuyu.gsyvideoplayer.GSYVideoManager;
-import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
-import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack;
-import com.shuyu.gsyvideoplayer.video.base.GSYVideoView;
-
-import butterknife.BindView;
-import butterknife.OnClick;
-
-/**
- * 掌酷广告视频(未使用,已改为SDK方式接入))
- */
-public class FgtVideoTaskZKOld extends FgtVideoTaskBase {
-
-    @BindView(R.id.video_player_view)
-    SheepGSYVideoView videoPlayerView;
-    @BindView(R.id.mask_view)
-    View mask_view;
-    @BindView(R.id.desc_tv)
-    TextView desc_tv;
-    @BindView(R.id.name_tv)
-    TextView name_tv;
-    @BindView(R.id.action_btn)
-    Button action_btn;
-    @BindView(R.id.logo_iv)
-    ImageView logo_iv;
-    @BindView(R.id.countdown_view)
-    TextView countdown_view;
-
-    private VideoAd currentVideoAd;
-
-    @Override
-    public int getLayoutId() {
-        return R.layout.activity_video_task;
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-        videoPlayerView.onVideoResume();
-        configActionBtn();
-    }
-
-    @Override
-    public void onPause() {
-        super.onPause();
-        videoPlayerView.onVideoPause();
-    }
-
-    @Override
-    public void onDestroy() {
-        if (currentVideoAd != null) {
-            currentVideoAd.trigger(VideoAd.TYPE_VIDEO_CLOSE);
-        }
-        super.onDestroy();
-    }
-
-    @Override
-    protected void initView() {
-        videoPlayerView.setShowControlView(false);
-        videoPlayerView.getBackButton().setVisibility(View.GONE);
-        videoPlayerView.getFullscreenButton().setVisibility(View.GONE);
-        videoPlayerView.getBottomProgressBar().setVisibility(View.GONE);
-
-        mask_view.setOnTouchListener((v, event) -> {
-            if (event.getAction() == MotionEvent.ACTION_UP && currentVideoAd != null) {
-                currentVideoAd.clickX = (int) event.getRawX();
-                currentVideoAd.clickY = (int) event.getRawY();
-                currentVideoAd.trigger(VideoAd.TYPE_CLICK);
-                if (videoPlayerView.getCurrentState() == GSYVideoView.CURRENT_STATE_PAUSE) {
-                    videoPlayerView.onVideoResume();
-                } else if (videoPlayerView.getCurrentState() == GSYVideoView.CURRENT_STATE_PLAYING) {
-                    videoPlayerView.onVideoPause();
-                }
-            }
-            return true;
-        });
-    }
-
-    @Override
-    protected void initData() {
-        if (releaseTask.getH5_accepted_task_id() > 0) {
-            loadAcceptedTask();
-        } else {
-            LogUtil.logI("---------------没有接受任务---------------");
-            acceptTask();
-        }
-    }
-
-    protected void loadAd() {
-        ADVideoHelper.loadVideoAD((ret, ad, msg) -> {
-            getActivity().runOnUiThread(() -> {
-                if (ret) {
-                    currentVideoAd = ad;
-                    desc_tv.setText(currentVideoAd.desc);
-                    name_tv.setText(currentVideoAd.title);
-                    GlideImageLoader.circleImage(logo_iv, currentVideoAd.logo);
-                    playVideo();
-                    configActionBtn();
-                } else {
-                    ViewUtil.showConfirmDialog(getContext(),
-                            "不好",
-                            "没获取到视频小片,需要再次获取吗?",
-                            "放弃", "重试",
-                            d -> giveUpTask(),
-                            d -> loadAd()).show();
-                }
-            });
-        });
-    }
-
-    private void configActionBtn() {
-        if (getActivity() == null || getActivity().isDestroyed() || currentVideoAd == null || currentVideoAd.url == null)
-            return;
-        if (!currentVideoAd.url.endsWith(".apk")) {
-            action_btn.setText("查看详情");
-            action_btn.setTag(0);
-        } else {
-            String path = ADDownloader.getUrlPath(currentVideoAd.url);
-            if (PackageUtil.isAppInstalled(SheepApp.getInstance(), currentVideoAd.package_name)) {
-                action_btn.setText("打开应用");
-                action_btn.setTag(1);
-            } else if (!TextUtils.isEmpty(path)) {
-                action_btn.setText("立即安装");
-                action_btn.setTag(2);
-                currentVideoAd.path = path;
-            } else {
-                action_btn.setText("下载应用");
-                action_btn.setTag(3);
-            }
-        }
-    }
-
-    @OnClick(R.id.action_btn)
-    public void onActionClick(View v) {
-        int action = (int) v.getTag();
-        switch (action) {
-            case 0:
-                jumpWeb();
-                break;
-            case 1:
-                openApp();
-                break;
-            case 2:
-                installApp();
-                break;
-            case 3:
-                downloadApp();
-                break;
-        }
-    }
-
-    private void playVideo() {
-        GSYVideoOptionBuilder gsyVideoOption = new GSYVideoOptionBuilder();
-        gsyVideoOption.setIsTouchWiget(false)
-                .setRotateViewAuto(true)
-                .setLockLand(true)
-                .setAutoFullWithSize(false)
-                .setShowFullAnimation(false)
-                .setUrl(currentVideoAd.videoUrl)
-                .setNeedLockFull(true)
-                .setCacheWithPlay(false)
-                .setGSYVideoProgressListener((progress, secProgress, currentPosition, duration) -> {
-                    countdown_view.setText("" + ((duration - currentPosition) / 1000));
-                })
-                .setVideoAllCallBack(new GSYSampleCallBack() {
-                    @Override
-                    public void onPrepared(String url, Object... objects) {
-                        super.onPrepared(url, objects);
-                        LogUtil.println("initPlay", "onPrepared", url, objects);
-                    }
-
-                    @Override
-                    public void onAutoComplete(String url, Object... objects) {
-                        super.onAutoComplete(url, objects);
-                        currentVideoAd.trigger(VideoAd.TYPE_VIDEO_END);
-                        tryGetReward();
-                    }
-
-                    @Override
-                    public void onPlayError(String url, Object... objects) {
-                        super.onPlayError(url, objects);
-                        long curPosition = GSYVideoManager.instance().getCurPlayerManager().getCurrentPosition();
-                        LogUtil.println("initPlay", "onPlayError", url, curPosition);
-                    }
-                }).build(videoPlayerView);
-        videoPlayerView.startPlayLogic();
-        currentVideoAd.trigger(VideoAd.TYPE_VIDEO_START);
-    }
-
-    private void jumpWeb() {
-        if (currentVideoAd == null) return;
-        Jump2View.getInstance().goWeb(getContext(), currentVideoAd.url);
-    }
-
-    private void openApp() {
-        if (currentVideoAd == null) return;
-        currentVideoAd.trigger(VideoAd.TYPE_ACTIVE);
-        currentVideoAd.trigger(VideoAd.TYPE_OPEN);
-        PackageUtil.startApp(getContext(), currentVideoAd.package_name);
-    }
-
-    private void downloadApp() {
-        if (currentVideoAd == null) return;
-        videoPlayerView.onVideoPause();
-        currentVideoAd.trigger(VideoAd.TYPE_DOWNLOAD);
-        showDownloadDialog();
-    }
-
-    private void installApp() {
-        if (currentVideoAd == null) return;
-        currentVideoAd.trigger(VideoAd.TYPE_INSTALL);
-        ApkUtils.installApk(getContext(), currentVideoAd.path);
-    }
-
-    private void installApp(VideoAd ad) {
-        if (ad == null) return;
-        ad.trigger(VideoAd.TYPE_INSTALL);
-        ApkUtils.installApk(getContext(), ad.path);
-    }
-
-    private void showAppConfirmDialog(String title, String btnText, ViewUtil.OnConfirmDialogListener listener) {
-        View rootView = View.inflate(getContext(), R.layout.video_ad_confirm, null);
-        ImageView app_logo_iv = rootView.findViewById(R.id.app_logo_iv);
-        TextView app_name_tv = rootView.findViewById(R.id.app_name_tv);
-        TextView app_desc_tv = rootView.findViewById(R.id.app_desc_tv);
-        int radius = ScreenUtil.dip2px(getActivity(), 8);
-        GlideImageLoader.roundedCornersImage(app_logo_iv, currentVideoAd.logo, radius);
-        app_name_tv.setText(currentVideoAd.title);
-        app_desc_tv.setText(currentVideoAd.desc);
-        videoPlayerView.onVideoPause();
-        ViewUtil.showConfirmDialog(getContext(), title, rootView, "取消", btnText,
-                d -> {
-                    d.dismiss();
-                    videoPlayerView.onVideoResume();
-                },
-                listener).show();
-    }
-
-    private void showDownloadDialog() {
-        final DialogProgress progress = DialogProgress.showDialog(getActivity(), true);
-        progress.getAlertDialog().setOnDismissListener(d -> {
-
-        });
-        final VideoAd thisAd = currentVideoAd.clone();
-        new ADDownloader()
-                .setListener(new ADDownloader.ProgressListener() {
-
-                    @Override
-                    public void onProgress(long offset, long total) {
-                        LogUtil.logE(offset + " /// " + total);
-                        long percent = offset * 100 / total;
-                        getActivity().runOnUiThread(() -> {
-                            if (progress.getAlertDialog().isShowing()) {
-                                progress.getTextView().setText(percent + "%");
-                            }
-                        });
-                    }
-
-                    @Override
-                    public void onStatus(String status, String msg) {
-                        getActivity().runOnUiThread(() -> {
-                            if (getActivity() == null || getActivity().isDestroyed()) return;
-                            if (progress.getAlertDialog().isShowing()) {
-                                progress.getAlertDialog().dismiss();
-                            }
-                            if ("COMPLETED".equals(status)) {
-                                thisAd.path = msg;
-                                configActionBtn();
-                                installApp(thisAd);
-                            } else {
-                                videoPlayerView.onVideoResume();
-                                LogUtil.logE(status + " /// " + msg);
-                            }
-                        });
-                    }
-                })
-                .init()
-                .start(currentVideoAd);
-
-    }
-
-}

+ 0 - 61
app/src/main/java/com/sheep/gamegroup/module/task/fragments/VideoTaskDialogUtil.java

@@ -1,61 +0,0 @@
-package com.sheep.gamegroup.module.task.fragments;
-
-import android.app.Dialog;
-import android.content.Context;
-
-import com.sheep.gamegroup.model.entity.Release_task;
-import com.sheep.gamegroup.util.DataUtil;
-import com.sheep.gamegroup.util.ViewUtil;
-
-/**
- * 视频任务弹窗工具类
- */
-public class VideoTaskDialogUtil {
-
-    //弹窗:已获取奖励
-    public static void showRewardsGotDialog(Context context, Release_task releaseTask) {
-        ViewUtil.showMsgDialog(
-                context,
-                "奖励已完成,获得奖励" + releaseTask.getShowValue(DataUtil.getInstance().getUserEntity().isVIP()),
-                "恭喜你",
-                false);
-    }
-
-    //弹窗:需继续观看的警告
-    public static void showContinueWatchWarningDialog(
-            Context context,
-            Release_task releaseTask,
-            ViewUtil.OnConfirmDialogListener onConfirmDialogListener,
-            ViewUtil.OnConfirmDialogListener onCancelDialogListener
-    ) {
-        Dialog dialog = ViewUtil.showConfirmDialog(
-                context,
-                "提示",
-                "你需要观看" + releaseTask.getTask().getVideo_num() + "个视频, 即可获得" +
-                        releaseTask.getShowValue(DataUtil.getInstance().getUserEntity().isVIP()),
-                "放弃",
-                "继续观看",
-                onCancelDialogListener,
-                onConfirmDialogListener);
-        dialog.setCancelable(false);
-        dialog.show();
-    }
-
-    //弹窗:放弃警告
-    public static void showGiveUpWarningDialog(
-            Context context,
-            ViewUtil.OnConfirmDialogListener onConfirmDialogListener,
-            ViewUtil.OnConfirmDialogListener onCancelDialogListener
-    ) {
-        Dialog dialog = ViewUtil.showConfirmDialog(
-                context,
-                "提示",
-                "你确定要放弃奖励吗?",
-                "放弃", "继续观看",
-                onCancelDialogListener,
-                onConfirmDialogListener);
-        dialog.setCancelable(false);
-        dialog.show();
-    }
-
-}

+ 0 - 6
app/src/main/java/com/sheep/gamegroup/module/task/fragments/VideoTaskUtil.java

@@ -1,6 +0,0 @@
-package com.sheep.gamegroup.module.task.fragments;
-
-public class VideoTaskUtil {
-
-
-}

+ 0 - 185
app/src/main/java/com/sheep/gamegroup/module/task/helper/ADDownloader.java

@@ -1,185 +0,0 @@
-package com.sheep.gamegroup.module.task.helper;
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import android.text.TextUtils;
-
-import com.liulishuo.okdownload.DownloadContext;
-import com.liulishuo.okdownload.DownloadContextListener;
-import com.liulishuo.okdownload.DownloadTask;
-import com.liulishuo.okdownload.StatusUtil;
-import com.liulishuo.okdownload.core.cause.EndCause;
-import com.liulishuo.okdownload.core.cause.ResumeFailedCause;
-import com.liulishuo.okdownload.core.listener.DownloadListener1;
-import com.liulishuo.okdownload.core.listener.assist.Listener1Assist;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
-
-import org.xutils.common.util.LogUtil;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
-public class ADDownloader implements DownloadContextListener {
-
-    private DownloadContext context;
-    private DownloadContext.Builder builder;
-    private QueueListener queueListener;
-    private File parentFile;
-
-    private ProgressListener mListener;
-    private Map<String, DownloadTask> tasks = new HashMap<>();
-
-    public ADDownloader() {
-    }
-
-    public void saveUrlPathTotal(String url, String path, long total) {
-        SharedPreferences sp = SheepApp.getInstance().getSharedPreferences("VIDEO_AD_APK_URL_PATH", Context.MODE_PRIVATE);
-        SharedPreferences.Editor editor = sp.edit();
-        editor.putString("path_" + url, path);
-        editor.putLong("total_" + url, total);
-        editor.commit();
-    }
-
-    public static String getUrlPath(String url) {
-        SharedPreferences sp = SheepApp.getInstance().getSharedPreferences("VIDEO_AD_APK_URL_PATH", Context.MODE_PRIVATE);
-        String path = sp.getString("path_" + url, "");
-        File file = new File(path);
-        if (!file.exists()) {
-            return "";
-        }
-        long total = sp.getLong("total_" + url, 0);
-        if (total == file.length()) {
-            return path;
-        }
-        return "";
-    }
-
-    public ADDownloader init() {
-        DownloadContext.QueueSet set = new DownloadContext.QueueSet();
-        parentFile = new File(ClassFileHelper.DIR);
-        set.setParentPathFile(parentFile);
-        set.setMinIntervalMillisCallbackProcess(200);
-        builder = set.commit();
-        builder.setListener(this);
-        context = builder.build();
-        queueListener = new QueueListener();
-        return this;
-    }
-
-    public ADDownloader setListener(ProgressListener mListener) {
-        this.mListener = mListener;
-        return this;
-    }
-
-    @Override
-    public void taskEnd(@NonNull DownloadContext context, @NonNull DownloadTask task, @NonNull EndCause cause, @Nullable Exception realCause, int remainCount) {
-
-    }
-
-    @Override
-    public void queueEnd(@NonNull DownloadContext context) {
-
-    }
-
-    public void start(VideoAd item) {
-        DownloadTask task = builder.bind(item.url);
-        task.setTag(item);
-        if (StatusUtil.getStatus(task) == StatusUtil.Status.RUNNING) {
-            return;
-        } else if (StatusUtil.getStatus(task) == StatusUtil.Status.COMPLETED) {
-            return;
-        }
-        task.enqueue(queueListener);
-        if (!tasks.containsKey(item.url)) {
-            tasks.put(item.url, task);
-        }
-    }
-
-    public void cancel(VideoAd ad) {
-        if (tasks.containsKey(ad.url)) {
-            tasks.get(ad.url).cancel();
-        }
-    }
-
-    public void delete(VideoAd ad) {
-        cancel(ad);
-        tasks.remove(ad.url);
-        if (!TextUtils.isEmpty(ad.path)) {
-            new File(ad.path).deleteOnExit();
-        }
-        ad.isDelete = 1;
-        if (mListener != null) {
-            mListener.onStatus("DELETE", null);
-        }
-    }
-
-    public void stopAll() {
-        if (context != null) {
-            context.stop();
-        }
-    }
-
-    public interface ProgressListener {
-        void onProgress(long offset, long total);
-
-        void onStatus(String status, String msg);
-    }
-
-    public class QueueListener extends DownloadListener1 {
-
-        @Override
-        public void taskStart(@NonNull DownloadTask task, @NonNull Listener1Assist.Listener1Model model) {
-            LogUtil.i("taskStart: " + task.getUrl());
-        }
-
-        @Override
-        public void retry(@NonNull DownloadTask task, @NonNull ResumeFailedCause cause) {
-            LogUtil.i("taskRetry: " + task.getUrl() + "  " + cause.toString());
-        }
-
-        @Override
-        public void connected(@NonNull DownloadTask task, int blockCount, long currentOffset, long totalLength) {
-            LogUtil.i("taskConnect: " + task.getUrl());
-            VideoAd item = (VideoAd) task.getTag();
-            if (task.getFile() != null) {
-                item.path = task.getFile().getAbsolutePath();
-                saveUrlPathTotal(item.url, item.path, totalLength);
-            }
-            item.subStatus = StatusUtil.getStatus(task).name();
-        }
-
-        @Override
-        public void progress(@NonNull DownloadTask task, long currentOffset, long totalLength) {
-            LogUtil.i("taskProgress: " + task.getUrl() + ": " + currentOffset + " / " + totalLength);
-            VideoAd item = (VideoAd) task.getTag();
-            item.offset = currentOffset;
-            item.total = totalLength;
-            if (mListener != null) {
-                mListener.onProgress(currentOffset, totalLength);
-            }
-        }
-
-        @Override
-        public void taskEnd(@NonNull DownloadTask task, @NonNull EndCause cause,
-                            @Nullable Exception realCause,
-                            @NonNull Listener1Assist.Listener1Model model) {
-            if (realCause != null) {
-                realCause.printStackTrace();
-            }
-            LogUtil.i("taskComplete: " + task.getUrl() + "   " + StatusUtil.getStatus(task).name() + "   " + task.getFile().getAbsolutePath());
-            VideoAd item = (VideoAd) task.getTag();
-            item.subStatus = StatusUtil.getStatus(task).name();
-            if (mListener != null) {
-                if(StatusUtil.getStatus(task).name().equals("COMPLETED")){
-                    mListener.onStatus(StatusUtil.getStatus(task).name(), task.getFile().getAbsolutePath());
-                } else{
-                    mListener.onStatus(StatusUtil.getStatus(task).name(), (realCause != null ? realCause.getMessage() : null));
-                }
-            }
-        }
-    }
-}

+ 0 - 176
app/src/main/java/com/sheep/gamegroup/module/task/helper/ADVideoHelper.java

@@ -1,176 +0,0 @@
-package com.sheep.gamegroup.module.task.helper;
-
-import android.text.TextUtils;
-import android.util.Log;
-import android.webkit.WebView;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.kfzs.duanduan.cardview.ScreenUtil;
-import com.sheep.gamegroup.util.DeviceUtil;
-import com.sheep.gamegroup.util.LogUtil;
-import com.sheep.gamegroup.util.Md5Util;
-import com.sheep.gamegroup.util.NetUtil;
-import com.sheep.gamegroup.util.SysAppUtil;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.snail.antifake.jni.EmulatorDetectUtil;
-
-import java.io.IOException;
-import java.util.Map;
-
-import okhttp3.Call;
-import okhttp3.Callback;
-import okhttp3.MediaType;
-import okhttp3.OkHttpClient;
-import okhttp3.Request;
-import okhttp3.RequestBody;
-import okhttp3.Response;
-
-public class ADVideoHelper {
-
-    private static String webua;
-    private static final String ADURL = "http://118.190.190.63/api/ad";
-
-    public static void loadVideoAD(ADCallback callback) {
-        String params = generateParams();
-        LogUtil.logI("RequestUrl: " + ADURL);
-        LogUtil.logI("RequestBody: " + params);
-        OkHttpClient client = new OkHttpClient();
-        RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), params);
-        Request request = new Request.Builder()
-                .url(ADURL)
-                .addHeader("Content-Type", "application/json")
-                .post(body)
-                .build();
-        client.newCall(request)
-                .enqueue(new Callback() {
-                    @Override
-                    public void onFailure(Call call, IOException e) {
-                        callback.onCallback(false, null, "网络加载失败");
-                        LogUtil.logI("RequestError: " + e.getMessage());
-                        e.printStackTrace();
-                    }
-
-                    @Override
-                    public void onResponse(Call call, Response response) throws IOException {
-                        String resp = response.body().string();
-                        LogUtil.logI("Response: " + resp);
-                        VideoAd ad = parse(resp);
-                        if (ad != null) {
-                            callback.onCallback(true, ad, null);
-                        } else {
-                            callback.onCallback(false, null, "数据解析失败");
-                        }
-                    }
-                });
-    }
-
-    private static String generateParams() {
-        if (TextUtils.isEmpty(webua)) {
-            webua = new WebView(SheepApp.getInstance()).getSettings().getUserAgentString();
-        }
-        Map<String, Integer> cellInfo = NetUtil.getCellStatus();
-        String r = DeviceUtil.getDeviceId(SheepApp.getInstance()) + SheepApp.getInstance().getPackageName() + System.currentTimeMillis();
-        String bid = Md5Util.getStrMd5(r);
-        String params = "{\n" +
-                "\t\"bid\": \"" + bid + "\",\n" +
-                "\t\"api_version\": \"1.0\",\n" +
-                "\t\"ua\": \"" + SysAppUtil.getUserAgent() + "\",\n" +
-                "\t\"webv_ua\": \"" + webua + "\",\n" +
-                "\t\"sdk_version\": 16,\n" +
-                "\t\"app\": {\n" +
-                "\t\t\"app_id\": \"2918\",\n" +
-                "\t\t\"channel_id\": \"xiaomianyang\",\n" +
-                "\t\t\"app_name\": \"小绵羊\",\n" +
-                "\t\t\"package_name\": \"" + SheepApp.getInstance().getPackageName() + "\",\n" +
-                "\t\t\"category\": \"\",\n" +
-                "\t\t\"app_keywords\": \"\",\n" +
-                "\t\t\"app_version\": \"3.6.9\"\n" +
-                "\t},\n" +
-                "\t\"device\": {\n" +
-                "\t\t\"device_id\": [{\n" +
-                "\t\t\t\"device_id\": \"" + DeviceUtil.getDeviceId(SheepApp.getInstance()) + "\",\n" +
-                "\t\t\t\"device_id_type\": 1,\n" +
-                "\t\t\t\"hash_type\": 0\n" +
-                "\t\t}],\n" +
-                "\t\t\"os_type\": 2,\n" +
-                "\t\t\"os_version\": \"7.0\",\n" +
-                "\t\t\"os_api_level\": \"24\",\n" +
-                "\t\t\"brand\": \"" + SysAppUtil.getDeviceBrand() + "\",\n" +
-                "\t\t\"model\": \"" + SysAppUtil.getDeviceModel() + "\",\n" +
-                "\t\t\"device_type\": 2,\n" +
-                "\t\t\"language\": \"zh\",\n" +
-                "\t\t\"screen_width\": " + ScreenUtil.getScreenWidth(SheepApp.getInstance()) + ",\n" +
-                "\t\t\"screen_height\": " + ScreenUtil.getScreenHeight(SheepApp.getInstance()) + ",\n" +
-                "\t\t\"screen_density\": " + ScreenUtil.getDensity() + ",\n" +
-                "\t\t\"screen_orientation\": 1,\n" +
-                "\t\t\"jailbreaked\": false\n" +
-                "\t},\n" +
-                "\t\"network\": {\n" +
-                "\t\t\"network_type\": " + NetUtil.getNetworkType() + ",\n" +
-                "\t\t\"carrier_id\": " + NetUtil.getSubscriptionOperatorType() + ",\n" +
-                "\t\t\"cellular_id\": {\n" +
-                "\t\t\t\"MCC\": " + cellInfo.get("MCC") + ",\n" +
-                "\t\t\t\"MNC\": " + cellInfo.get("MNC") + ",\n" +
-                "\t\t\t\"LAC\": " + cellInfo.get("LAC") + ",\n" +
-                "\t\t\t\"CID\": " + cellInfo.get("CID") + "\n" +
-                "\t\t}\n" +
-                "\t},\n" +
-                "\t\"adspaces\": [{\n" +
-                "\t\t\"adspace_id\": \"46215\",\n" +
-                "\t\t\"adspace_type\": 3,\n" +
-                "\t\t\"adspace_position\": 2,\n" +
-                "\t\t\"allowed_html\": true,\n" +
-                "\t\t\"width\": 720,\n" +
-                "\t\t\"height\": 1280,\n" +
-                "\t\t\"impression_num\": 3,\n" +
-                "\t\t\"keywords\": \"\",\n" +
-                "\t\t\"channel\": \"任务\",\n" +
-                "\t\t\"open_type\": 2,\n" +
-                "\t\t\"interaction_type\": [2, 7, 3],\n" +
-                "\t\t\"asset\": [4, 3, 1, 2],\n" +
-                "\t\t\"impression_time\": 15,\n" +
-                "\t\t\"page_id\": \"\"\n" +
-                "\t}],\n" +
-                "\t\"is_debug\": false\n" +
-                "}";
-        return params;
-    }
-
-    private static VideoAd parse(String response) {
-        VideoAd ad = new VideoAd();
-        Log.i("ad", "------------------------------------------");
-        LogUtil.logI(response);
-        JSONObject json = JSONObject.parseObject(response);
-        JSONArray arr = json.getJSONArray("ads");
-        if (arr == null || arr.size() == 0) {
-            return null;
-        }
-        JSONObject ado = arr.getJSONObject(0);
-        JSONObject creative = ado.getJSONArray("creative").getJSONObject(0);
-        JSONObject adm = creative.getJSONObject("adm");
-        JSONObject nativ = adm.getJSONObject("nativ");
-        ad.title = nativ.getJSONObject("title").getString("text");
-        ad.logo = nativ.getString("logo");
-        ad.desc = nativ.getString("desc");
-        JSONObject video = nativ.getJSONObject("video");
-        ad.coveImgUrl = video.getString("coveImgUrl");
-        ad.videoUrl = video.getString("videoUrl");
-        ad.package_name = creative.getString("package_name");
-        JSONObject interaction_object = creative.getJSONObject("interaction_object");
-        ad.url_type = interaction_object.getInteger("url_type");
-        ad.url = interaction_object.getString("url");
-
-        JSONArray array = creative.getJSONArray("event_track");
-        for (int i = 0; i < array.size(); i++) {
-            JSONObject event = array.getJSONObject(i);
-            ad.addTrack(event.getString("event_type"), event.getString("notify_url"));
-        }
-        return ad;
-    }
-
-    public interface ADCallback {
-        void onCallback(boolean ret, VideoAd ad, String msg);
-    }
-
-}

+ 0 - 198
app/src/main/java/com/sheep/gamegroup/module/task/helper/VideoAd.java

@@ -1,198 +0,0 @@
-package com.sheep.gamegroup.module.task.helper;
-
-import com.kfzs.duanduan.cardview.ScreenUtil;
-import com.kfzs.duanduan.utils.ApkUtils;
-import com.sheep.gamegroup.util.DeviceUtil;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.zhy.http.okhttp.OkHttpUtils;
-import com.zhy.http.okhttp.callback.Callback;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import okhttp3.Call;
-import okhttp3.Response;
-
-public class VideoAd {
-
-    public final static String TYPE_SHOW = "1";
-    public final static String TYPE_CLICK = "2";
-    public final static String TYPE_OPEN = "3";
-    public final static String TYPE_DOWNLOAD = "4";
-    public final static String TYPE_INSTALL = "5";
-    public final static String TYPE_ACTIVE = "6";
-    public final static String TYPE_DYNAMIC_SHOW = "7";
-    public final static String TYPE_START_DOWN = "8";
-    public final static String TYPE_START_INSTALL = "9";
-    public final static String TYPE_VIDEO_START = "10";
-    public final static String TYPE_VIDEO_FULL_SCREEN = "11";
-    public final static String TYPE_VIDEO_END = "12";
-    public final static String TYPE_VIDEO_CARD_CLICK = "13";
-    public final static String TYPE_VIDEO_SKIP = "14";
-    public final static String TYPE_VIDEO_LOAD_SUCCED = "15";
-    public final static String TYPE_VIDEO_LOAD_FAILED = "16";
-    public final static String TYPE_VIDEO_MUTE = "17";
-    public final static String TYPE_VIDEO_NON_MUTE = "18";
-    public final static String TYPE_VIDEO_PROGRESS = "19";
-    public final static String TYPE_VIDEO_CLOSE = "20";
-    public final static String TYPE_VIDEO_PAUSE = "21";
-    public final static String TYPE_VIDEO_RESUME = "22";
-    public final static String TYPE_VIDEO_FRAME_CLOSE = "23";
-    public final static String TYPE_VIDEO_FRAME_SHOW = "24";
-    public final static String TYPE_VIDEO_FRAME_CLICK = "25";
-    public final static String TYPE_OPEN_FAILURE = "27";
-
-    public final static int STATUS_NOTHING = 0;
-    public final static int STATUS_DOWNLOADED = 1;
-    public final static int STATUS_INSTALLED = 2;
-
-    public int status = STATUS_NOTHING;
-
-    //属性变量
-    public String title;
-    public String desc;
-    public String logo;
-    public String coveImgUrl;
-    public String videoUrl;
-    public String package_name;
-    public String url;
-    public int url_type = 0;
-
-    public Map<String, List<String>> eventTracks = new HashMap<>();
-
-    //时间变量
-    public int clickX = 129;
-    public int clickY = 312;
-    public String clickId = "";
-
-    //下载变量
-    public String subStatus;
-    public String path;
-    public long offset;
-    public long total;
-    public int isDelete;
-
-    public VideoAd() {
-    }
-
-    public VideoAd(int status, String title, String desc, String logo, String coveImgUrl, String videoUrl, String package_name, String url, int url_type, Map<String, List<String>> eventTracks, int clickX, int clickY, String clickId, String subStatus, String path, long offset, long total, int isDelete) {
-        this.status = status;
-        this.title = title;
-        this.desc = desc;
-        this.logo = logo;
-        this.coveImgUrl = coveImgUrl;
-        this.videoUrl = videoUrl;
-        this.package_name = package_name;
-        this.url = url;
-        this.url_type = url_type;
-        this.eventTracks = eventTracks;
-        this.clickX = clickX;
-        this.clickY = clickY;
-        this.clickId = clickId;
-        this.subStatus = subStatus;
-        this.path = path;
-        this.offset = offset;
-        this.total = total;
-        this.isDelete = isDelete;
-    }
-
-    public VideoAd clone(){
-        VideoAd ad = new VideoAd(status, title, desc, logo, coveImgUrl, videoUrl, package_name, url, url_type, eventTracks, clickX, clickY, clickId, subStatus, path, offset, total, isDelete);
-        return ad;
-    }
-
-    public void addTrack(String type, String url) {
-        List<String> tracks = null;
-        if (!eventTracks.containsKey("type")) {
-            tracks = new ArrayList<>();
-            eventTracks.put(type, tracks);
-        }
-        tracks.add(url);
-    }
-
-    public void checkAdStatus() {
-        if(!ApkUtils.getInstance().isPkgInstalled(package_name)){
-        } else {
-            status = STATUS_INSTALLED;
-        }
-    }
-
-    public void trigger(String type) {
-        if (eventTracks.containsKey(type)) {
-            for (String url : eventTracks.get(type)) {
-                notify(url);
-            }
-        }
-    }
-
-    private void notify(String url) {
-        url = replaceParams(url);
-        try {
-            OkHttpUtils.get().url(url).build().execute(new Callback(){
-
-                @Override
-                public Object parseNetworkResponse(Response response, int id) throws Exception {
-                    return null;
-                }
-
-                @Override
-                public void onError(Call call, Exception e, int id) {
-
-                }
-
-                @Override
-                public void onResponse(Object response, int id) {
-
-                }
-            });
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    private String replaceParams(String url) {
-        if (url.contains("%%REQ_WIDTH%%")) {
-            url = url.replaceAll("%%REQ_WIDTH%%", ScreenUtil.getScreenWidth(SheepApp.getInstance()) + "");
-        }
-        if (url.contains("%%REQ_HEIGHT%%")) {
-            url = url.replaceAll("%%REQ_HEIGHT%%", ScreenUtil.getScreenHeight(SheepApp.getInstance()) + "");
-        }
-        if (url.contains("%%WIDTH%%")) {
-            url = url.replaceAll("%%WIDTH%%", ScreenUtil.getScreenWidth(SheepApp.getInstance()) + "");
-        }
-        if (url.contains("%%HEIGHT%%")) {
-            url = url.replaceAll("%%HEIGHT%%", ScreenUtil.getScreenHeight(SheepApp.getInstance()) + "");
-        }
-        if (url.contains("%%EVENT_TIME_START%%")) {
-            url = url.replaceAll("%%EVENT_TIME_START%%", System.currentTimeMillis() + "");
-        }
-        if (url.contains("%%EVENT_TIME_END%%")) {
-            url = url.replaceAll("%%EVENT_TIME_END%%", System.currentTimeMillis() + "");
-        }
-        if (url.contains("%%TM_MS%%")) {
-            url = url.replaceAll("%%TM_MS%%", System.currentTimeMillis() + "");
-        }
-        if (url.contains("%%TM_MS%%")) {
-            url = url.replaceAll("%%TM_MS%%", System.currentTimeMillis() + "");
-        }
-        if (url.contains("%%DOWNX%%")) {
-            url = url.replaceAll("%%DOWNX%%", clickX + "");
-        }
-        if (url.contains("%%DOWNY%%")) {
-            url = url.replaceAll("%%DOWNY%%", clickY + "");
-        }
-        if (url.contains("%%UPX%%")) {
-            url = url.replaceAll("%%UPX%%", clickX + "");
-        }
-        if (url.contains("%%UPY%%")) {
-            url = url.replaceAll("%%UPY%%", clickY + "");
-        }
-        if (url.contains("%%CLICKID%%")) {
-            url = url.replaceAll("%%CLICKID%%", clickId + "");
-        }
-        return url;
-    }
-
-}

+ 8 - 24
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -2,11 +2,9 @@ package com.sheep.gamegroup.util;
 
 import static com.sheep.gamegroup.model.entity.TaskEty.TASK_TYPE_CREDIT_CARD;
 import static com.sheep.gamegroup.model.entity.TaskEty.TASK_TYPE_REWARD;
-import static com.sheep.gamegroup.model.entity.TaskEty.TASK_TYPE_VIDEO_AD;
 import static com.sheep.gamegroup.model.entity.TaskEty.TASK_TYPE_WELFARE;
 import static com.sheep.gamegroup.module.game.activity.ActGameGroupOrGameDetail.AUTO_DOWNLOAD;
 import static com.sheep.gamegroup.module.game.activity.ActGameGroupOrGameDetail.KEY_HAS_WELFARE;
-import static com.sheep.gamegroup.util.Constant.REQUEST_CODE_GOT_REWARDS;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.ASK_MAKE_MONEY_INVITATION;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.FIND_ITEM;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_DOWNLOAD_WELFARE_LIST;
@@ -121,7 +119,6 @@ import com.sheep.gamegroup.module.plugin.util.SheepPluginUtil;
 import com.sheep.gamegroup.module.qrcode.FaceWithQRActivity;
 import com.sheep.gamegroup.module.qrcode.QRCodeActivity;
 import com.sheep.gamegroup.module.search.ActSearch;
-import com.sheep.gamegroup.module.task.VideoTaskActivity;
 import com.sheep.gamegroup.module.user.activity.ActMyCart;
 import com.sheep.gamegroup.module.user.activity.ActVip;
 import com.sheep.gamegroup.module.user.model.UserAddressInfo;
@@ -434,7 +431,7 @@ public class Jump2View {
      * @param object
      */
     public void goHomePageView(final Activity context, Object object) {
-        final Intent intent = new Intent(context, ActMain.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+        final Intent intent = new Intent(context, ActMain.class);
         if (object instanceof String) {
             //统计用户登录信息
             UMConfigUtils.onProfileSignIn();
@@ -764,11 +761,6 @@ public class Jump2View {
         activity.startActivityForResult(intent, action);
     }
 
-    public synchronized void goVideoTaskView(Context context, Integer id) {
-        Intent intent = new Intent(context, VideoTaskActivity.class);
-        intent.putExtra("task_id", id);
-        ((Activity) context).startActivityForResult(intent, REQUEST_CODE_GOT_REWARDS);
-    }
 
     public synchronized void goWelfare(Context context, int taskId) {
         WebParams webParams = new WebParams(Config.getUrlByPath(Config.PATH_WELFARE_HOME));
@@ -1773,6 +1765,7 @@ public class Jump2View {
 
     /**
      * 这里是启动后去主页面的实际逻辑
+     *
      * @param activity
      */
     public void gotoMain(Activity activity) {
@@ -1793,6 +1786,9 @@ public class Jump2View {
         }
         CommonUtil.getInstance().callActionWithUserInfo(userEntity ->
                 Observable.create((ObservableOnSubscribe<Object>) emitter -> {
+                            if (userEntity == null) {
+                                return;
+                            }
                             if (userEntity.alreadyFinishAllNewTask()) {//已经完成所有新手任务
                                 //没有兑换过优惠券时,显示商城优惠券
                                 SheepApp.getInstance().getNetComponent().getApiService().getYfShopReceiveCouponsCheck(ReceiveCouponsResp.TYPE_NEW_TASK)
@@ -2072,9 +2068,6 @@ public class Jump2View {
                 goWeb(SheepApp.getInstance().getCurrentActivity(), new WebParams(Config.getUrlByPath(Config.PATH_MONEY_REWARD_DETAIL
                         , "id", id, "device_id", DeviceUtil.getDeviceId(SheepApp.getInstance()), "app_version", String.valueOf(BuildConfig.VERSION_CODE))).setTitle(name));
                 break;
-            case TASK_TYPE_VIDEO_AD:
-                goVideoTaskView(SheepApp.getInstance().getCurrentActivity(), id);
-                break;
             case TASK_TYPE_CREDIT_CARD:
                 goCreditCardTaskDetail(SheepApp.getInstance().getCurrentActivity(), id);
                 break;
@@ -2613,18 +2606,9 @@ public class Jump2View {
      */
     public void startDownloadService(String downloadUrl, String filePath) {
         Context context = SheepApp.getInstance();
-        context.startService(new Intent(context, DownloadService.class).putExtra("download_url", downloadUrl).putExtra("file_path", filePath));
-    }
-
-    /**
-     * 启动下载后台服务进行下载
-     *
-     * @param downloadUrl
-     * @param filePath
-     */
-    public void startDownloadService(String downloadUrl, String filePath, String type) {
-        Context context = SheepApp.getInstance();
-        context.startService(new Intent(context, DownloadService.class).putExtra("download_url", downloadUrl).putExtra("file_path", filePath).putExtra("type", type));
+        context.startService(new Intent(context, DownloadService.class)
+                .putExtra("download_url", downloadUrl)
+                .putExtra("file_path", filePath));
     }
 
     /**

+ 5 - 2
app/src/main/java/com/sheep/gamegroup/util/js/KFZSJs.java

@@ -23,6 +23,7 @@ import com.kfzs.duanduan.utils.StatusBarUtils;
 import com.sheep.gamegroup.absBase.AbsObserver;
 import com.sheep.gamegroup.event.WXLoginAuthEvent;
 import com.sheep.gamegroup.event.WebViewEvent;
+import com.sheep.gamegroup.gaiban.mainpage.data.source.UserInfoDataSource;
 import com.sheep.gamegroup.greendao.DDProviderHelper;
 import com.sheep.gamegroup.greendao.download.SheepAd;
 import com.sheep.gamegroup.model.api.IWeb;
@@ -748,7 +749,9 @@ public class KFZSJs {
 
     @JavascriptInterface
     public void gotoGiftBagById(int id, String name) {
-        Jump2View.getInstance().goGameGiftBag(id, name);
+        if (UserInfoDataSource.getInstance().hasLogin(activity)) {
+            Jump2View.getInstance().goGameGiftBag(id, name);
+        }
     }
 
     @JavascriptInterface
@@ -764,7 +767,7 @@ public class KFZSJs {
     //给网页增加状态栏高度的返回
     @JavascriptInterface
     public int getStatusBarHeight() {
-        return  WidgetUtil.Px2Dp(activity,StatusBarUtils.getStatusBarHeight(activity));
+        return WidgetUtil.Px2Dp(activity, StatusBarUtils.getStatusBarHeight(activity));
     }
 
     @JavascriptInterface

+ 5 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActGiftDetail.java

@@ -12,6 +12,8 @@ import androidx.viewbinding.ViewBinding;
 
 import com.google.android.material.appbar.AppBarLayout;
 import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.event.BigEvent;
+import com.sheep.gamegroup.event.EventTypes;
 import com.sheep.gamegroup.model.entity.GiftBag;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
 import com.sheep.gamegroup.util.CommonUtil;
@@ -25,6 +27,8 @@ import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.databinding.ActGiftDetailBinding;
 import com.sheep.jiuyan.samllsheep.utils.G;
 
+import org.greenrobot.eventbus.EventBus;
+
 import rx.functions.Action1;
 
 /**
@@ -156,6 +160,7 @@ public class ActGiftDetail extends BaseActivity implements Action1<Integer> {
     @Override
     public void call(Integer integer) {
         if (integer == WelfareAdapter.TO_REFRESH) {
+            EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.REFRESH_LIBAO_LIST));
             refresh();
         }
     }

+ 0 - 8
app/src/main/java/com/sheep/gamegroup/view/activity/ActMain.java

@@ -2,8 +2,6 @@ package com.sheep.gamegroup.view.activity;
 
 import static android.content.Intent.ACTION_PACKAGE_ADDED;
 import static android.content.Intent.ACTION_PACKAGE_REMOVED;
-import static com.sheep.gamegroup.module.task.fragments.FgtVideoTaskBase.KEY_RELEASE_TASK;
-import static com.sheep.gamegroup.util.Constant.REQUEST_CODE_GOT_REWARDS;
 import static com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp.PUBLIC_TAG_PREFIX_TEXTVIEW_LIST;
 
 import android.content.Intent;
@@ -35,12 +33,10 @@ import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.helper.DownloadHelper;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.Container;
-import com.sheep.gamegroup.model.entity.Release_task;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.model.util.ShowRedDot;
 import com.sheep.gamegroup.module.qrcode.QRCodeCaptureHelper;
-import com.sheep.gamegroup.module.task.fragments.VideoTaskDialogUtil;
 import com.sheep.gamegroup.qqminigame.QQMGWXLoginEvent;
 import com.sheep.gamegroup.qqminigame.QQMiniGameLoginFgt;
 import com.sheep.gamegroup.util.ActionUtil;
@@ -49,7 +45,6 @@ import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.Constant;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.DownloadUtil;
-import com.sheep.gamegroup.util.GsonUtils;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.MainTab;
 import com.sheep.gamegroup.util.SysAppUtil;
@@ -660,9 +655,6 @@ public class ActMain extends BaseActYmPermissionCheck implements QQMiniGameLogin
                         finish();
                     }
                 });
-            } else if (requestCode == REQUEST_CODE_GOT_REWARDS) {
-                Release_task releaseTask = GsonUtils.getGlobalGson().fromJson(intent.getStringExtra(KEY_RELEASE_TASK), Release_task.class);
-                VideoTaskDialogUtil.showRewardsGotDialog(ActMain.this, releaseTask);
             }
         }
     }

+ 29 - 10
app/src/main/java/com/sheep/gamegroup/view/activity/ActSetting.java

@@ -16,6 +16,7 @@ import androidx.viewbinding.ViewBinding;
 import com.kfzs.duanduan.utils.ApkUtils;
 import com.sheep.gamegroup.absBase.AbsObserver;
 import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.gaiban.mainpage.data.source.UserInfoDataSource;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.Version;
@@ -34,6 +35,9 @@ import com.sheep.jiuyan.samllsheep.databinding.ActSettingBinding;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import io.reactivex.android.schedulers.AndroidSchedulers;
 import io.reactivex.schedulers.Schedulers;
 import rx.functions.Action1;
@@ -94,19 +98,30 @@ public class ActSetting extends BaseActivity {
 
     public void onResume() {
         super.onResume();
-        CommonUtil.getInstance().getUserInfo(false, (user) -> {
-            if (user.hasPayPwd()) {
-                ViewUtil.setText(binding.payPwdFlag, "去关闭");
-                ViewUtil.setOnClickListener(binding.payPwdFlag, v -> {
-                    ActPayPassword.clearPwd(activity);
-                });
-            } else {
-                ViewUtil.setText(binding.payPwdFlag, "未设置");
-                ViewUtil.setOnClickListener(binding.payPwdFlag, null);
+        if (UserInfoDataSource.getInstance().isLogin()) {
+            CommonUtil.getInstance().getUserInfo(false, (user) -> {
+                if (user.hasPayPwd()) {
+                    ViewUtil.setText(binding.payPwdFlag, "去关闭");
+                    ViewUtil.setOnClickListener(binding.payPwdFlag, v -> {
+                        ActPayPassword.clearPwd(activity);
+                    });
+                } else {
+                    ViewUtil.setText(binding.payPwdFlag, "未设置");
+                    ViewUtil.setOnClickListener(binding.payPwdFlag, null);
+                }
+            });
+            for (View view : needLoginList) {
+                view.setVisibility(View.VISIBLE);
             }
-        });
+        } else {
+            for (View view : needLoginList) {
+                view.setVisibility(View.GONE);
+            }
+        }
     }
 
+    List<View> needLoginList = new ArrayList<>();
+
     @Override
     public void initListener() {
         binding.changePasswordLayout.setOnClickListener(this::goChangePassword);
@@ -119,6 +134,10 @@ public class ActSetting extends BaseActivity {
         binding.privacyPolicy.setOnClickListener(this::openPrivacyPolicy);
         binding.personAgreement.setOnClickListener(this::openPersonAgreement);
         binding.destroyAccount.setOnClickListener(this::goDestroyAccount);
+        needLoginList.add(binding.changePasswordLayout);
+        needLoginList.add(binding.payPwdLayout);
+        needLoginList.add(binding.tvSubmit);
+        needLoginList.add(binding.destroyAccount);
     }
 
     @Override

+ 11 - 11
app/src/main/java/com/sheep/gamegroup/view/activity/PersonalInfoAct.java

@@ -1,9 +1,17 @@
 package com.sheep.gamegroup.view.activity;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.BIND_PHONE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.BIND_QQ;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.BIND_TX_WX;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.BIND_WX;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_INFO_ADDR;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_INFO_AVATAR;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_INFO_LOGINNAME;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_INFO_NAME;
+
 import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
-import androidx.annotation.Nullable;
 import android.text.TextUtils;
 import android.view.View;
 import android.widget.FrameLayout;
@@ -11,6 +19,8 @@ import android.widget.ImageView;
 import android.widget.PopupWindow;
 import android.widget.TextView;
 
+import androidx.annotation.Nullable;
+
 import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.absBase.AbsChooseImageActivity;
 import com.sheep.gamegroup.absBase.AbsObserver;
@@ -28,7 +38,6 @@ import com.sheep.jiuyan.samllsheep.Config;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
-import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 import com.sheep.jiuyan.samllsheep.wxutil.WXAPIUtil;
 import com.umeng.socialize.UMAuthListener;
@@ -47,15 +56,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
 import io.reactivex.schedulers.Schedulers;
 import rx.functions.Action1;
 
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.BIND_PHONE;
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.BIND_QQ;
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.BIND_TX_WX;
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.BIND_WX;
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_INFO_ADDR;
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_INFO_AVATAR;
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_INFO_LOGINNAME;
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_INFO_NAME;
-
 
 /**
  * Created by Administrator on 2018/3/16.

+ 1 - 294
app/src/main/java/com/sheep/gamegroup/view/activity/SplashAct.java

@@ -1,16 +1,12 @@
 package com.sheep.gamegroup.view.activity;
 
-import static com.sheep.gamegroup.view.activity.helper.AdHelper.AD_SPLASH_TYPE_YKY;
 import static com.sheep.gamegroup.view.activity.helper.AdHelper.AD_SPLASH_TYPE_YT;
 import static com.sheep.gamegroup.view.activity.helper.AdHelper.AD_SPLASH_TYPE_ZK;
-import static com.sheep.gamegroup.view.activity.helper.AdHelper.AD_TYPE_SHEEP;
 
 import android.Manifest;
 import android.app.AlertDialog;
 import android.content.pm.PackageManager;
 import android.graphics.Color;
-import android.media.MediaPlayer;
-import android.net.Uri;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Looper;
@@ -26,7 +22,6 @@ import android.view.View;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
 import android.widget.TextView;
-import android.widget.Toast;
 import android.widget.VideoView;
 
 import androidx.annotation.NonNull;
@@ -34,45 +29,30 @@ import androidx.annotation.Nullable;
 import androidx.core.app.ActivityCompat;
 import androidx.core.content.ContextCompat;
 
-import com.bumptech.glide.Glide;
-import com.jasmine.cantaloupe.engine.SplashEngine;
-import com.jasmine.cantaloupe.ui.widget.AdFrameLayout;
-import com.lygame.wrapper.ad.LySplashAdBuilder;
-import com.lygame.wrapper.interfaces.ISplashAdCallback;
-import com.lygame.wrapper.interfaces.ISplashAdController;
-import com.lygame.wrapper.interfaces.ISplashAdLoadCallback;
-import com.lygame.wrapper.sdk.LySdk;
 import com.sheep.gamegroup.absBase.BaseActivity;
-import com.sheep.gamegroup.greendao.DDProviderHelper;
 import com.sheep.gamegroup.greendao.download.SheepAd;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.module.skin.util.SkinUtil;
 import com.sheep.gamegroup.util.ApiJSONUtil;
-import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.RxjavaCountDownTimer;
 import com.sheep.gamegroup.util.SharedPreferencesUtil;
 import com.sheep.gamegroup.util.SysAppUtil;
-import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.activity.helper.AdHelper;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
-import com.tencent.klevin.ads.ad.SplashAd;
-import com.tencent.klevin.ads.ad.SplashAdRequest;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.atomic.AtomicReference;
 
 import butterknife.BindView;
 import butterknife.OnClick;
 import io.reactivex.Observable;
 import io.reactivex.Observer;
 import io.reactivex.android.schedulers.AndroidSchedulers;
-import io.reactivex.functions.Action;
 import io.reactivex.schedulers.Schedulers;
 
 /**
@@ -90,21 +70,15 @@ public class SplashAct extends BaseActivity {
 
     @BindView(R.id.fl_root)
     FrameLayout zk_root;
-    @BindView(R.id.fv_splash_yt)
-    AdFrameLayout flSplashYT;
     @BindView(R.id.splash_image_view)
     ImageView splash_image_view;
     @BindView(R.id.splash_skip)
     TextView splash_skip;
-    @BindView(R.id.splash_skip_view)
-    TextView yt_splash_skip_view;
     @BindView(R.id.splash_video_view)
     VideoView splash_video_view;
     @BindView(R.id.ad_flag)
     View ad_flag;
 
-    private AtomicReference<ISplashAdController> controllerRef = new AtomicReference<>(); //掌酷广告控制器
-
     private boolean goLink; //跳转到了广告对应的页面
 
     private boolean mForceGoMain = false; //是否强制跳转到主页面
@@ -185,207 +159,10 @@ public class SplashAct extends BaseActivity {
             //是否为新设备
             boolean isNewSmallSheep = baseMessage.getData(Boolean.class);
             DataUtil.getInstance().setIsNewSmallSheep(isNewSmallSheep);
-            if (SysAppUtil.isNewSmallSheep()) {//新版本只显示引导页面,不展示弹窗和开屏广告
-                fetchAdvertisement(() -> {
-                });//只更新,不加载
-                sendHandlerMessages(2000);
-            } else {
-                //拉一次广告,并加载
-                fetchAdvertisement(() -> {
-                    if (ad != null) {
-                        if (ad.getAd_type() == AD_TYPE_SHEEP) {
-                            //是自己的广告,展示自己的广告
-                            loadSheepAdvertising();
-                        } else {
-                            //SDK的广告,展示SDK的广告,并拉取一次广告并保存
-                            initSdkAdvertising(ad.getAd_type());
-                        }
-                    } else {
-                        sendHandlerMessages(2000);
-                    }
-                });
-            }
+            sendHandlerMessages(2000);
         }).subscribe();
     }
 
-    /**
-     * 加载SDK的广告
-     */
-    private void initSdkAdvertising(int adType) {
-        if (adType == AD_SPLASH_TYPE_YKY) {
-            //游可盈
-            launchYKYSplash();
-        } else if (adType == AD_SPLASH_TYPE_YT) {
-            //优投
-            launchYTSplash();
-        } else if (adType == AD_SPLASH_TYPE_ZK) {
-            //掌酷
-            launchZKSplash();
-        } else {
-            sendHandlerMessages(0);
-        }
-    }
-
-    //展示游可盈广告
-    SplashAd mSplashAd;
-
-    private void launchYKYSplash() {
-        SplashAdRequest.Builder splashAdBuilder = new SplashAdRequest.Builder();
-        splashAdBuilder.setWaitTime(3500)// 【可选】默认不限制,可传值范围[3000-5000]
-                .setAdCount(1)//【可选】广告个数,默认 1
-                .setPosId(30112);//【必须】开屏广告位 id  正式30112 测试30029
-
-        //开屏广告加载回调
-        SplashAd.load(splashAdBuilder.build(), new SplashAd.SplashAdLoadListener() {
-            public void onTimeOut() { //加载超时 Log.e(TAG, "splash ad load timeout");
-                sendHandlerMessages(0);
-            }
-
-            public void onAdLoadError(int err, String msg) {
-                // 加载失败,err 是错误码,msg 是描述信息
-                Log.e(TAG, "yky splash ad load err: " + err + " " + msg);
-                sendHandlerMessages(0);
-            }
-
-            public void onAdLoaded(SplashAd adTmp) {//加载成功,ad 为开屏广告实例 Log.i(TAG, "splash ad loaded");
-                mSplashAd = adTmp;
-                if (mSplashAd != null) {
-                    //设置开屏广告展示回调
-                    mSplashAd.setListener(new SplashAd.SplashAdListener() {
-                        public void onAdSkip() { //用户跳过广告回调 Log.i(TAG, "onAdSkip");
-                            sendHandlerMessages(0);
-                        }
-
-                        public void onAdShow() { //广告曝光回调
-                            Log.e(TAG, "yky splash ad show success");
-                            if (!aded && ad != null) {
-                                AdHelper.stat(ad.getAd_id(), 1, ad.getAd_type());
-                                aded = true;
-                            }
-                        }
-
-                        public void onAdClick() { //广告点击回调 Log.i(TAG, "onAdClick");
-                            Log.e(TAG, "yky splash ad click");
-                            AdHelper.stat(ad.getAd_id(), 2, ad.getAd_type());
-                        }
-
-                        public void onAdClosed() { //广告关闭回调
-                            Log.i(TAG, "yky splash onAdClosed");
-                            sendHandlerMessages(0);
-                        }
-
-                        public void onAdError(int i, String err) { //广告展示失败回调
-                            Log.e(TAG, "yky splash onAdError err: " + i + " " + err);
-                            //拉取广告错误或超时,直接跳过
-                            sendHandlerMessages(0);
-                        }
-                    });
-                    mSplashAd.show(); //展示开屏广告 }
-                }
-            }
-        });
-    }
-
-    //展示优投开屏广告(新增boolean state:false----定值) 重要 mForceGoMain跳转主页 请参照此方法调用,否则可能导致广告展示链路断开 导致收益下降!!!
-    private void launchYTSplash() {
-        if (flSplashYT != null) flSplashYT.setVisibility(View.VISIBLE);
-        new SplashEngine(SplashAct.this, false, new SplashEngine.SplashAdCallBack() {
-            @Override
-            public void onSplashClick() {
-                AdHelper.stat(ad.getAd_id(), 2, ad.getAd_type());
-                //sendHandlerMessages(0);
-            }
-
-            @Override
-            public void onSplashDismissed() {
-                next();
-            }
-
-            @Override
-            public void onSplashError(String err, boolean isTimeout) {
-                next();
-            }
-
-            @Override
-            public void onSplashShow() {
-                yt_splash_skip_view.setVisibility(View.VISIBLE);
-                if (!aded && ad != null) {
-                    AdHelper.stat(ad.getAd_id(), 1, ad.getAd_type());
-                    aded = true;
-                }
-                //mHasLoaded = true;
-                //mHandler.removeCallbacksAndMessages(null);
-            }
-
-            @Override
-            public void onSplashPresent() {
-                if (splash_image_view != null)
-                    splash_image_view.setVisibility(View.GONE); // 广告展示后一定要把预设的开屏图片隐藏起来
-            }
-
-            @Override
-            public void onSplashLoad() {
-
-            }
-
-        }).launchSplash(flSplashYT, 5 * 1000);
-
-    }
-
-    //展示掌酷广告
-    private void launchZKSplash() {
-        LySdk.loadSplashAd(this, new LySplashAdBuilder(zk_root, ad.getThird_ad_id()), new ISplashAdLoadCallback() {
-            @Override
-            public void onFailed(int i, String s) {
-
-            }
-
-            @Override
-            public void onLoaded(ISplashAdController iSplashAdController) {
-                controllerRef.set(iSplashAdController);
-                ISplashAdController controller;
-                if ((controller = controllerRef.getAndSet(null)) != null) {
-                    if (zk_root != null) zk_root.setVisibility(View.VISIBLE);
-                    controller.show(new ISplashAdCallback() {
-                        @Override
-                        public void onLoadFail(int i, String s) {
-                            zk_root.setVisibility(View.INVISIBLE);
-                            sendHandlerMessages(0);
-                        }
-
-                        @Override
-                        public void onAdClick() {
-                            zk_root.setVisibility(View.INVISIBLE);
-                            AdHelper.stat(ad.getAd_id(), 2, ad.getAd_type());
-                        }
-
-                        @Override
-                        public void onAdShow() {
-                            if (!aded && ad != null) {
-                                AdHelper.stat(ad.getAd_id(), 1, ad.getAd_type());
-                                aded = true;
-                            }
-                        }
-
-                        @Override
-                        public void onAdSkip() {
-                            zk_root.setVisibility(View.INVISIBLE);
-                            sendHandlerMessages(0);
-                        }
-
-                        @Override
-                        public void onAdTimeOver() {
-                            //zk_root.setVisibility(View.INVISIBLE);
-                            sendHandlerMessages(0);
-                        }
-                    });
-                } else {
-                    Toast.makeText(SplashAct.this, "掌酷广告未加载", Toast.LENGTH_SHORT).show();
-                    sendHandlerMessages(0);
-                }
-            }
-        });
-    }
 
     /**
      * 重要 mForceGoMain跳转主页 请参照此方法调用,否则可能导致广告展示链路断开 导致收益下降!!!
@@ -400,76 +177,6 @@ public class SplashAct extends BaseActivity {
         }
     }
 
-    //从服务端拉取广告信息
-    private void fetchAdvertisement(Action action) {
-        CommonUtil.getInstance().refreshAds((ret, list) -> {
-            if (ret) {
-                ad = DDProviderHelper.getInstance().getSheepAd(SheepAd.FORM_SPLASH);
-                try {
-                    action.run();
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        });
-    }
-
-    //加载自己的广告
-    private void loadSheepAdvertising() {
-        if (this.isDestroyed()) return;
-        if (!aded && ad != null) {
-            AdHelper.stat(ad.getAd_id(), 1);
-            aded = true;
-        }
-        if (ad.isImage()) {
-            Glide.with(this).load(ad.getAd_img()).into(splash_image_view);
-            ViewUtil.setVisibility(splash_video_view, View.GONE);
-        } else {
-            Uri uri = Uri.parse(ad.getAd_img());
-            if (splash_video_view != null) {
-                splash_video_view.setVisibility(View.VISIBLE);
-                splash_video_view.setOnInfoListener((mediaPlayer, what, extra) -> {
-                    if (!mediaPlayer.isLooping()) mediaPlayer.setLooping(true);
-                    LogUtil.println("onInfo what = " + what + " extra = " + extra);
-                    if (MediaPlayer.MEDIA_INFO_BUFFERING_START == what) {
-                        splash_image_view.setVisibility(View.GONE);
-                    }
-                    return false;
-                });
-                splash_video_view.setVideoURI(uri);
-                splash_video_view.start();
-                splash_video_view.requestFocus();
-            }
-        }
-        if (ad.getUser_type() == 2) {
-            ViewUtil.setVisibility(ad_flag, true);
-        }
-
-        mHandler.removeMessages(0);
-        if (ad.getShow_time() > 0) {
-            ViewUtil.setVisibility(splash_skip, View.VISIBLE);
-            timer = RxjavaCountDownTimer.getInstance(ad.getShow_time()).setOnTickListener(new RxjavaCountDownTimer.OnTickListener() {
-                @Override
-                public void onFinish() {
-                    if (timer != null) {
-                        if (!isDestroyed()) {
-                            ViewUtil.setVisibility(splash_skip, View.INVISIBLE);//设置为INVISIBLE代表定时器结束
-                            if (!goLink) {
-                                sendHandlerMessages(10);
-                            }
-                        }
-                    }
-                }
-
-                @Override
-                public void onTicker(long time) {
-                    ViewUtil.setText(splash_skip, getString(R.string.tip_skip, time));
-                }
-            }).start();
-        } else {
-            sendHandlerMessages(1000);
-        }
-    }
 
     //处理事件
     Handler mHandler = new Handler(Looper.getMainLooper()) {

+ 3 - 14
app/src/main/java/com/sheep/gamegroup/view/activity/TryMakeMoneyact.java

@@ -2,17 +2,15 @@ package com.sheep.gamegroup.view.activity;
 
 import android.app.Activity;
 import android.content.Intent;
+import android.view.View;
+
 import androidx.annotation.Nullable;
-import com.google.android.material.tabs.TabLayout;
 import androidx.viewpager.widget.ViewPager;
-import android.view.View;
 
+import com.google.android.material.tabs.TabLayout;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.model.entity.DialogConfig;
-import com.sheep.gamegroup.model.entity.Release_task;
-import com.sheep.gamegroup.module.task.fragments.VideoTaskDialogUtil;
-import com.sheep.gamegroup.util.GsonUtils;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.adapter.AdpTryMakemoney;
@@ -25,9 +23,6 @@ import org.greenrobot.eventbus.Subscribe;
 
 import butterknife.BindView;
 
-import static com.sheep.gamegroup.module.task.fragments.FgtVideoTaskBase.KEY_RELEASE_TASK;
-import static com.sheep.gamegroup.util.Constant.REQUEST_CODE_GOT_REWARDS;
-
 /**
  * 试着赚钱页面
  * Created by ljy on 2018/3/10.
@@ -129,11 +124,5 @@ public class TryMakeMoneyact extends BaseActivity {
     @Override
     protected void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent intent) {
         super.onActivityResult(requestCode, resultCode, intent);
-        if(resultCode == RESULT_OK){
-            if (requestCode == REQUEST_CODE_GOT_REWARDS) {
-                Release_task releaseTask = GsonUtils.getGlobalGson().fromJson(intent.getStringExtra(KEY_RELEASE_TASK), Release_task.class);
-                VideoTaskDialogUtil.showRewardsGotDialog(TryMakeMoneyact.this, releaseTask);
-            }
-        }
     }
 }

+ 2 - 9
app/src/main/java/com/sheep/gamegroup/view/adapter/GiftCenterAdapter.java

@@ -66,6 +66,7 @@ public class GiftCenterAdapter extends AdbCommonRecycler<GiftBagApp> {
             ViewUtil.setText(binding.tvContent, itemGiftBag.getGiftContent());
             if (TextUtils.isEmpty(item.getCode())) {//没有code,就视为没有领取礼包
                 binding.btn.setText("领取");
+                binding.btn.setBackground(binding.getRoot().getContext().getResources().getDrawable(R.drawable.button_bg));
                 binding.btn.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {
@@ -73,6 +74,7 @@ public class GiftCenterAdapter extends AdbCommonRecycler<GiftBagApp> {
                     }
                 });
             } else {
+                binding.btn.setBackground(binding.getRoot().getContext().getResources().getDrawable(R.drawable.button_bg_gray));
                 binding.btn.setText("复制");
                 binding.btn.setOnClickListener(new View.OnClickListener() {
                     @Override
@@ -82,15 +84,6 @@ public class GiftCenterAdapter extends AdbCommonRecycler<GiftBagApp> {
                         G.showToast(R.string.success_copy_code);
                     }
                 });
-//                item_download_welfare_tip_iv.setOnClickListener(new View.OnClickListener() {
-//                    @Override
-//                    public void onClick(View view) {
-//                        GIFT_BAG_LOOK_TIP.onEvent("gift_bag_id", item.getGift_bag().getId());
-//                        ViewUtil.showMsgDialog(context, new DialogConfig().setTitle("礼包使用说明").setBtnLeftText("我知道了")
-//                                .setMsgGravity(Gravity.START)
-//                                .setMsg(String.format(Locale.CHINA, "礼包内容:\n%s\n\n使用方式:\n%s", itemGiftBag.getGiftContent(), itemGiftBag.getUseMethod())));
-//                    }
-//                });
             }
             holder.itemView.setOnClickListener(new View.OnClickListener() {
                 @Override

+ 5 - 2
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGiftCenter.java

@@ -7,10 +7,10 @@ import androidx.annotation.Nullable;
 import androidx.recyclerview.widget.RecyclerView;
 
 import com.sheep.gamegroup.event.BigEvent;
+import com.sheep.gamegroup.event.EventTypes;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
-import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.adapter.GiftCenterAdapter;
@@ -73,7 +73,9 @@ public class FgtGiftCenter extends BaseListFragment2<GiftBagApp> implements Acti
 
     @Subscribe
     public void onEventMainThread(BigEvent event) {
-        CommonUtil.getInstance().setEventResultViewStatus(event, binding.viewList);
+        if (event.getEventTypes() == EventTypes.REFRESH_LIBAO_LIST) {
+            refreshData();
+        }
     }
 
     @Override
@@ -101,4 +103,5 @@ public class FgtGiftCenter extends BaseListFragment2<GiftBagApp> implements Acti
     protected Class<GiftBagApp> getTClass() {
         return GiftBagApp.class;
     }
+
 }

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

@@ -132,7 +132,7 @@ public class Config {
     //small_station地址 key
     public static final String KEY_SMALL_STATION_URL = "small_station_url";
     //small_station地址
-    public static String SMALL_STATION_URL_SHEEP = "http://smallstation.9yan.io";
+    public static String SMALL_STATION_URL_SHEEP = "http://smallstation.9yan.io/small_sheep_app_nosignin";
     public static String SMALL_STATION_URL_TEST = "http://10.8.230.20:8082";
     //    public static String SMALL_STATION_URL_TEST = "http://10.8.240.180:8080";
     //在数据库中表 config 中 配置 small_station_url后,可以进行设置 ,否则使用默认的值

+ 6 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/ClassFileHelper.java

@@ -1,6 +1,9 @@
 package com.sheep.jiuyan.samllsheep.utils;
 
 import android.os.Environment;
+import android.util.Log;
+
+import com.sheep.jiuyan.samllsheep.SheepApp;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -44,7 +47,9 @@ public class ClassFileHelper {
 
     private ClassFileHelper() {
         SD_PATH = Environment.getExternalStorageDirectory().getAbsolutePath();
-        DIR = SD_PATH + File.separator + "Sheep";
+//        DIR = SD_PATH + File.separator + "Sheep";
+        DIR = SheepApp.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).getPath();
+        Log.d("ClassFileHelper", "apksavepath():" + DIR);
     }
 
     public static ClassFileHelper getInstance() {

BIN
app/src/main/res/drawable-xxhdpi/button_bg.9.png


BIN
app/src/main/res/drawable-xxhdpi/button_bg_gray.9.png


+ 3 - 13
app/src/main/res/layout/act_setting.xml

@@ -14,11 +14,13 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="vertical">
-
+®
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="@dimen/content_padding"
+                android:divider="@drawable/divider"
+                android:dividerPadding="20dp"
                 android:layout_marginBottom="@dimen/content_padding_15"
                 android:background="@color/white"
                 android:orientation="vertical">
@@ -35,7 +37,6 @@
 
                 </LinearLayout>
 
-                <View style="@style/style_item_line" />
 
                 <LinearLayout
                     android:id="@+id/pay_pwd_layout"
@@ -57,7 +58,6 @@
 
                 </LinearLayout>
 
-                <View style="@style/style_item_line" />
 
                 <LinearLayout
                     android:id="@+id/abourt_us_layout"
@@ -71,7 +71,6 @@
 
                 </LinearLayout>
 
-                <View style="@style/style_item_line" />
 
                 <LinearLayout
                     android:id="@+id/feedback_layout"
@@ -85,7 +84,6 @@
 
                 </LinearLayout>
 
-                <View style="@style/style_item_line" />
 
                 <LinearLayout
                     android:id="@+id/destroy_account"
@@ -99,7 +97,6 @@
 
                 </LinearLayout>
 
-                <View style="@style/style_item_line" />
 
                 <LinearLayout
                     android:id="@+id/clear_layout"
@@ -116,11 +113,6 @@
 
                 </LinearLayout>
 
-                <View
-                    android:layout_width="match_parent"
-                    android:layout_height="@dimen/content_padding"
-                    android:background="@color/white_light"
-                    android:minHeight="1px" />
                 <LinearLayout
                     android:id="@+id/privacy_policy"
                     style="@style/style_item_container">
@@ -133,7 +125,6 @@
 
                 </LinearLayout>
 
-                <View style="@style/style_item_line" />
 
                 <LinearLayout
                     android:id="@+id/person_agreement"
@@ -147,7 +138,6 @@
 
                 </LinearLayout>
 
-                <View style="@style/style_item_line" />
             </LinearLayout>
 
             <TextView

+ 0 - 78
app/src/main/res/layout/activity_video_task.xml

@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context="com.sheep.gamegroup.module.task.VideoTaskActivity">
-
-    <com.sheep.gamegroup.view.customview.SheepGSYVideoView
-        android:id="@+id/video_player_view"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" />
-
-    <View
-        android:id="@+id/mask_view"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"/>
-
-    <RelativeLayout
-        android:id="@+id/bottom_bar"
-        android:background="@drawable/bg_gradient_ver_black"
-        android:layout_alignParentBottom="true"
-        android:layout_marginBottom="12dp"
-        android:paddingLeft="12dp"
-        android:paddingRight="12dp"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
-        <TextView
-            android:id="@+id/desc_tv"
-            android:textSize="13sp"
-            android:textColor="@color/white"
-            android:gravity="center_vertical"
-            android:paddingBottom="12dp"
-            android:layout_above="@+id/logo_iv"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
-
-        <ImageView
-            android:id="@+id/logo_iv"
-            android:layout_alignParentBottom="true"
-            android:layout_width="34dp"
-            android:layout_height="34dp" />
-
-        <TextView
-            android:id="@+id/name_tv"
-            android:textSize="16sp"
-            android:textColor="@color/white"
-            android:gravity="center_vertical"
-            android:layout_alignTop="@+id/logo_iv"
-            android:layout_toRightOf="@+id/logo_iv"
-            android:paddingLeft="12dp"
-            android:layout_width="match_parent"
-            android:layout_height="34dp"/>
-
-        <Button
-            android:id="@+id/action_btn"
-            android:textSize="15sp"
-            android:textColor="@color/white"
-            android:background="@drawable/shape_blue_solid_rectangle_18"
-            android:layout_alignParentBottom="true"
-            android:layout_alignParentRight="true"
-            android:layout_width="109dp"
-            android:layout_height="34dp" />
-
-    </RelativeLayout>
-
-    <TextView
-        android:id="@+id/countdown_view"
-        android:textColor="@color/black"
-        android:textSize="16sp"
-        android:gravity="center"
-        android:layout_margin="16dp"
-        android:background="@drawable/shape_oval_solid_10_f5"
-        android:layout_alignParentRight="true"
-        android:layout_width="30dp"
-        android:layout_height="30dp" />
-
-</RelativeLayout>

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

@@ -40,8 +40,8 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="12dp"
-                android:hint="登录/注册"
                 android:textColor="#000000"
+                android:text="登录/注册"
                 app:layout_constraintEnd_toEndOf="@+id/ivAvatar"
                 app:layout_constraintStart_toStartOf="@+id/ivAvatar"
                 app:layout_constraintTop_toBottomOf="@+id/ivAvatar" />

+ 0 - 39
app/src/main/res/layout/splash_activity.xml

@@ -44,43 +44,4 @@
             android:gravity="center"
             android:layout_width="36dp"
             android:layout_height="20dp"/>
-
-    <com.jasmine.cantaloupe.ui.widget.AdFrameLayout
-            android:id="@+id/fv_splash_yt"
-            android:layout_height="match_parent"
-            android:layout_width="match_parent"
-            android:visibility="invisible">
-
-        <!-- 2.开屏广告容器区域:-->
-        <!-- 注意:该区域高度不得小于400dp。在本示例中没有写死splash_container的高度值,是因为第1部分的app_logo区域是一个高度很小的图片。 -->
-        <FrameLayout
-                android:id="@+id/splash_container"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"/>
-
-        <!-- 3.自定义跳过按钮区域:开发者可以根据需要自己实现不同样式的跳过按钮 -->
-        <!-- 注意1:根据广告法规定,跳过按钮必须在屏幕当中出现。因此广告展示的时候,必须让将SkipView显示出来,即visible,否则将SDK将不展示广告。 -->
-        <!-- 注意2:SDK除了会检查跳过按钮的可见性,还将检测它的尺寸,其尺寸不得小于3dp*3dp,否则将SDK将不展示广告。 -->
-        <TextView
-                android:id="@+id/splash_skip_view"
-                android:layout_width="96dp"
-                android:layout_height="wrap_content"
-                android:paddingTop="@dimen/content_padding_4"
-                android:paddingBottom="@dimen/content_padding_4"
-                android:layout_gravity="right"
-                android:layout_margin="16dp"
-                android:background="@drawable/jasmine_common_button"
-                android:gravity="center"
-                android:textColor="@android:color/white"
-                android:textSize="14sp"
-                android:visibility="visible"/>
-
-    </com.jasmine.cantaloupe.ui.widget.AdFrameLayout>
-
-    <FrameLayout
-            android:id="@+id/zk_root"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:orientation="vertical"/>
-
     </FrameLayout>