|
|
@@ -8,12 +8,15 @@ import androidx.lifecycle.MutableLiveData;
|
|
|
|
|
|
import com.atmob.app.lib.base.BaseViewModel;
|
|
|
import com.atmob.app.lib.livedata.SingleLiveEvent;
|
|
|
+import com.atmob.common.data.KVUtils;
|
|
|
import com.atmob.common.runtime.ActivityUtil;
|
|
|
import com.atmob.common.runtime.ContextUtil;
|
|
|
import com.datarecovery.master.R;
|
|
|
import com.datarecovery.master.data.consts.AdFuncId;
|
|
|
+import com.datarecovery.master.data.consts.EventId;
|
|
|
import com.datarecovery.master.data.repositories.ConfigRepository;
|
|
|
import com.datarecovery.master.data.repositories.DeviceFuncRepository;
|
|
|
+import com.datarecovery.master.handler.EventHelper;
|
|
|
import com.datarecovery.master.module.audiorecover.AudioRecoverActivity;
|
|
|
import com.datarecovery.master.module.backup_helper.BackupHelperActivity;
|
|
|
import com.datarecovery.master.module.filerecover.FileRecoverActivity;
|
|
|
@@ -22,6 +25,7 @@ import com.datarecovery.master.module.member.MemberType;
|
|
|
import com.datarecovery.master.module.videorecover.VideoRecoverActivity;
|
|
|
import com.datarecovery.master.sdk.ad.AtmobAdHelper;
|
|
|
import com.datarecovery.master.sdk.ad.RewardVideoListenerAdapter;
|
|
|
+import com.datarecovery.master.utils.Maps;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
@@ -125,19 +129,26 @@ public class HomePageViewModel extends BaseViewModel {
|
|
|
isQQSelected.setValue(true);
|
|
|
|
|
|
AtmobAdHelper.showInterstitial(AdFuncId.INTERSTITIAL_HOME_SWITCH, null);
|
|
|
+
|
|
|
+ EventHelper.report(EventId.EVENT_3000404, Maps.asMap("zone_id", 102));
|
|
|
}
|
|
|
|
|
|
public void onWeChatAreaClick() {
|
|
|
isQQSelected.setValue(false);
|
|
|
|
|
|
AtmobAdHelper.showInterstitial(AdFuncId.INTERSTITIAL_HOME_SWITCH, null);
|
|
|
+
|
|
|
+ EventHelper.report(EventId.EVENT_3000404, Maps.asMap("zone_id", 101));
|
|
|
}
|
|
|
|
|
|
public void onBannerClick() {
|
|
|
ImageRecoverActivity.start(ActivityUtil.getTopActivity(), MemberType.APP_IMAGE_RECOVER);
|
|
|
+
|
|
|
+ EventHelper.report(EventId.EVENT_3000405);
|
|
|
}
|
|
|
|
|
|
public void onBackupHelperClick() {
|
|
|
+ EventHelper.report(EventId.EVENT_3001000);
|
|
|
AtmobAdHelper.showVideo(AdFuncId.REWARD_BACKUP_TUTORIAL, new RewardVideoListenerAdapter() {
|
|
|
@Override
|
|
|
public void onRewarded(@NonNull String token) {
|
|
|
@@ -151,21 +162,129 @@ public class HomePageViewModel extends BaseViewModel {
|
|
|
if (bean == null) {
|
|
|
return;
|
|
|
}
|
|
|
+ boolean isQQ = isQQSelected.getValue() != null && isQQSelected.getValue();
|
|
|
+ boolean isFirstByApp;
|
|
|
+ if (isQQ) {
|
|
|
+ boolean isFirstClickQq = KVUtils.getDefault().getBoolean("is_first_click_qq", true);
|
|
|
+ isFirstByApp = isFirstClickQq;
|
|
|
+ if (isFirstClickQq) {
|
|
|
+ KVUtils.getDefault().putBoolean("is_first_click_qq", false);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ boolean isFirstClickWeChat = KVUtils.getDefault().getBoolean("is_first_click_wechat", true);
|
|
|
+ isFirstByApp = isFirstClickWeChat;
|
|
|
+ if (isFirstClickWeChat) {
|
|
|
+ KVUtils.getDefault().putBoolean("is_first_click_wechat", false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ boolean isFirst = KVUtils.getDefault().getBoolean("is_first_click_function", true);
|
|
|
+ if (isFirst) {
|
|
|
+ KVUtils.getDefault().putBoolean("is_first_click_function", false);
|
|
|
+ }
|
|
|
switch (bean.getFunctionId()) {
|
|
|
case FunctionBean.AUDIO_RECOVERY:
|
|
|
AudioRecoverActivity.start(ActivityUtil.getTopActivity());
|
|
|
+ EventHelper.report(EventId.EVENT_3000005, Maps.asMap("id", 104));
|
|
|
+ if (isQQ) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000402, com.atmob.analytics.utils.Maps.of(
|
|
|
+ "qq_id", 104,
|
|
|
+ "is_first_click_qq", isFirstByApp
|
|
|
+ ));
|
|
|
+ if (isFirst) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000403, Maps.asMap("function_id", 109));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ EventHelper.report(EventId.EVENT_3000401, com.atmob.analytics.utils.Maps.of(
|
|
|
+ "weixin_id", 104,
|
|
|
+ "is_first_click_weixin", isFirstByApp
|
|
|
+ ));
|
|
|
+ if (isFirst) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000403, Maps.asMap("function_id", 104));
|
|
|
+ }
|
|
|
+ }
|
|
|
break;
|
|
|
case FunctionBean.FILE_RECOVERY:
|
|
|
FileRecoverActivity.start(ActivityUtil.getTopActivity());
|
|
|
+ EventHelper.report(EventId.EVENT_3000005, Maps.asMap("id", 102));
|
|
|
+ if (isQQ) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000402, com.atmob.analytics.utils.Maps.of(
|
|
|
+ "qq_id", 102,
|
|
|
+ "is_first_click_qq", isFirstByApp
|
|
|
+ ));
|
|
|
+ if (isFirst) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000403, Maps.asMap("function_id", 107));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ EventHelper.report(EventId.EVENT_3000401, com.atmob.analytics.utils.Maps.of(
|
|
|
+ "weixin_id", 102,
|
|
|
+ "is_first_click_weixin", isFirstByApp
|
|
|
+ ));
|
|
|
+ if (isFirst) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000403, Maps.asMap("function_id", 102));
|
|
|
+ }
|
|
|
+ }
|
|
|
break;
|
|
|
case FunctionBean.IMG_CLEARING:
|
|
|
ImageRecoverActivity.start(ActivityUtil.getTopActivity(), MemberType.APP_IMAGE_CLEAN);
|
|
|
+ if (isQQ) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000402, com.atmob.analytics.utils.Maps.of(
|
|
|
+ "qq_id", 105,
|
|
|
+ "is_first_click_qq", isFirstByApp
|
|
|
+ ));
|
|
|
+ if (isFirst) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000403, Maps.asMap("function_id", 110));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ EventHelper.report(EventId.EVENT_3000401, com.atmob.analytics.utils.Maps.of(
|
|
|
+ "weixin_id", 105,
|
|
|
+ "is_first_click_weixin", isFirstByApp
|
|
|
+ ));
|
|
|
+ if (isFirst) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000403, Maps.asMap("function_id", 105));
|
|
|
+ }
|
|
|
+ }
|
|
|
break;
|
|
|
case FunctionBean.VIDEO_RECOVERY:
|
|
|
VideoRecoverActivity.start(ActivityUtil.getTopActivity());
|
|
|
+ EventHelper.report(EventId.EVENT_3000005, Maps.asMap("id", 103));
|
|
|
+ if (isQQ) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000402, com.atmob.analytics.utils.Maps.of(
|
|
|
+ "qq_id", 103,
|
|
|
+ "is_first_click_qq", isFirstByApp
|
|
|
+ ));
|
|
|
+ if (isFirst) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000403, Maps.asMap("function_id", 108));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ EventHelper.report(EventId.EVENT_3000401, com.atmob.analytics.utils.Maps.of(
|
|
|
+ "weixin_id", 103,
|
|
|
+ "is_first_click_weixin", isFirstByApp
|
|
|
+ ));
|
|
|
+ if (isFirst) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000403, Maps.asMap("function_id", 103));
|
|
|
+ }
|
|
|
+ }
|
|
|
break;
|
|
|
case FunctionBean.IMG_RECOVERY:
|
|
|
ImageRecoverActivity.start(ActivityUtil.getTopActivity(), MemberType.APP_IMAGE_RECOVER);
|
|
|
+ EventHelper.report(EventId.EVENT_3000005, Maps.asMap("id", 101));
|
|
|
+ if (isQQ) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000402, com.atmob.analytics.utils.Maps.of(
|
|
|
+ "qq_id", 101,
|
|
|
+ "is_first_click_qq", isFirstByApp
|
|
|
+ ));
|
|
|
+ if (isFirst) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000403, Maps.asMap("function_id", 106));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ EventHelper.report(EventId.EVENT_3000401, com.atmob.analytics.utils.Maps.of(
|
|
|
+ "weixin_id", 101,
|
|
|
+ "is_first_click_weixin", isFirstByApp
|
|
|
+ ));
|
|
|
+ if (isFirst) {
|
|
|
+ EventHelper.report(EventId.EVENT_3000403, Maps.asMap("function_id", 101));
|
|
|
+ }
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
}
|