|
@@ -41,13 +41,12 @@ import com.sheep.gamegroup.helper.TaskHelper;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.DialogConfig;
|
|
import com.sheep.gamegroup.model.entity.DialogConfig;
|
|
|
import com.sheep.gamegroup.model.entity.Ext;
|
|
import com.sheep.gamegroup.model.entity.Ext;
|
|
|
-import com.sheep.gamegroup.model.entity.FindApp;
|
|
|
|
|
import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
|
|
import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
|
|
|
import com.sheep.gamegroup.model.entity.GameAccountEntity;
|
|
import com.sheep.gamegroup.model.entity.GameAccountEntity;
|
|
|
|
|
+import com.sheep.gamegroup.model.entity.GameApp;
|
|
|
import com.sheep.gamegroup.model.entity.GameEntity;
|
|
import com.sheep.gamegroup.model.entity.GameEntity;
|
|
|
import com.sheep.gamegroup.model.entity.GiftBagApp;
|
|
import com.sheep.gamegroup.model.entity.GiftBagApp;
|
|
|
import com.sheep.gamegroup.model.entity.HomeListEntity;
|
|
import com.sheep.gamegroup.model.entity.HomeListEntity;
|
|
|
-import com.sheep.gamegroup.model.entity.PlayGameEntity;
|
|
|
|
|
import com.sheep.gamegroup.model.entity.RobTask;
|
|
import com.sheep.gamegroup.model.entity.RobTask;
|
|
|
import com.sheep.gamegroup.model.entity.RouserArticlesEntity;
|
|
import com.sheep.gamegroup.model.entity.RouserArticlesEntity;
|
|
|
import com.sheep.gamegroup.model.entity.SlideshowEty;
|
|
import com.sheep.gamegroup.model.entity.SlideshowEty;
|
|
@@ -62,7 +61,6 @@ import com.sheep.gamegroup.model.entity.XiaomiGameEntity;
|
|
|
import com.sheep.gamegroup.model.util.EntityUtils;
|
|
import com.sheep.gamegroup.model.util.EntityUtils;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.usage.AppUsageManager;
|
|
import com.sheep.gamegroup.usage.AppUsageManager;
|
|
|
-import com.sheep.gamegroup.view.activity.ActFindInformation;
|
|
|
|
|
import com.sheep.gamegroup.view.activity.GameTaskOrderListAct;
|
|
import com.sheep.gamegroup.view.activity.GameTaskOrderListAct;
|
|
|
import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
|
|
import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
|
|
|
import com.sheep.gamegroup.view.dialog.DialogShare;
|
|
import com.sheep.gamegroup.view.dialog.DialogShare;
|
|
@@ -540,6 +538,7 @@ public class CommonUtil {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//以龙猫开头的则认为是龙猫app
|
|
//以龙猫开头的则认为是龙猫app
|
|
|
public static final String LONG_MAO_APP_NAME = "龙猫";
|
|
public static final String LONG_MAO_APP_NAME = "龙猫";
|
|
|
public static final String LONG_MAO_APP_PACKAGE_NAME = "com.cfyl.galesaur.guess";
|
|
public static final String LONG_MAO_APP_PACKAGE_NAME = "com.cfyl.galesaur.guess";
|
|
@@ -1978,7 +1977,7 @@ public class CommonUtil {
|
|
|
/**
|
|
/**
|
|
|
* 小米游戏账号领取
|
|
* 小米游戏账号领取
|
|
|
*/
|
|
*/
|
|
|
- public void xiaomiRevieceAcctoun(TextView find_information_game_task_top, final Object items, final Activity activity) {
|
|
|
|
|
|
|
+ public void xiaomiRevieceAcctoun(TextView find_information_game_task_top, final Object item, final Activity activity) {
|
|
|
XIAOMI_GAME_RECEIVE.onEvent();
|
|
XIAOMI_GAME_RECEIVE.onEvent();
|
|
|
find_information_game_task_top.setText("领取福利号");
|
|
find_information_game_task_top.setText("领取福利号");
|
|
|
find_information_game_task_top.setOnClickListener(new View.OnClickListener() {
|
|
find_information_game_task_top.setOnClickListener(new View.OnClickListener() {
|
|
@@ -1986,16 +1985,14 @@ public class CommonUtil {
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
- if (items instanceof XiaomiGameEntity) {
|
|
|
|
|
|
|
+ if (item instanceof XiaomiGameEntity) {
|
|
|
|
|
|
|
|
- jsonObject.put("id", ((XiaomiGameEntity) items).getId());
|
|
|
|
|
- } else if (items instanceof FindApp) {
|
|
|
|
|
- jsonObject.put("id", ((FindApp) items).getId());
|
|
|
|
|
- } else if (items instanceof PlayGameEntity) {
|
|
|
|
|
- jsonObject.put("id", ((PlayGameEntity) items).getId());
|
|
|
|
|
|
|
+ jsonObject.put("id", ((XiaomiGameEntity) item).getId());
|
|
|
|
|
+ } else if (item instanceof GameApp) {
|
|
|
|
|
+ jsonObject.put("id", ((GameApp) item).getId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ViewUtil.newInstance().showProgress((Activity) activity);
|
|
|
|
|
|
|
+ ViewUtil.newInstance().showProgress(activity);
|
|
|
SheepApp.getInstance()
|
|
SheepApp.getInstance()
|
|
|
.getNetComponent()
|
|
.getNetComponent()
|
|
|
.getApiService()
|
|
.getApiService()
|
|
@@ -2006,7 +2003,7 @@ public class CommonUtil {
|
|
|
@Override
|
|
@Override
|
|
|
public void onError(BaseMessage baseMessage) {
|
|
public void onError(BaseMessage baseMessage) {
|
|
|
G.showToast(baseMessage.getMsg());
|
|
G.showToast(baseMessage.getMsg());
|
|
|
- ViewUtil.newInstance().hideProgress((Activity) activity);
|
|
|
|
|
|
|
+ ViewUtil.newInstance().hideProgress(activity);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@SuppressLint({"StringFormatInvalid", "LocalSuppress"})
|
|
@SuppressLint({"StringFormatInvalid", "LocalSuppress"})
|
|
@@ -2084,7 +2081,7 @@ public class CommonUtil {
|
|
|
if (tvProgress == null) {
|
|
if (tvProgress == null) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(isShowSpeed)
|
|
|
|
|
|
|
+ if (isShowSpeed)
|
|
|
tvProgress.setText(String.format(Locale.CHINA, "%d%%(%s)", Math.abs(p), speed));//添加下载速度
|
|
tvProgress.setText(String.format(Locale.CHINA, "%d%%(%s)", Math.abs(p), speed));//添加下载速度
|
|
|
else
|
|
else
|
|
|
tvProgress.setText(String.format(Locale.CHINA, "%d%%", Math.abs(p)));
|
|
tvProgress.setText(String.format(Locale.CHINA, "%d%%", Math.abs(p)));
|
|
@@ -2451,16 +2448,19 @@ public class CommonUtil {
|
|
|
* 0,--------1,已接受任务 2,正在进行中,3完成任务,4放弃任务,5任务失败,6审核失败,7提交审核,8任务已下线,9至少完成了一个任务了
|
|
* 0,--------1,已接受任务 2,正在进行中,3完成任务,4放弃任务,5任务失败,6审核失败,7提交审核,8任务已下线,9至少完成了一个任务了
|
|
|
*/
|
|
*/
|
|
|
public void palyGameDetailBtnValue(final Context context, final GameEntity gameEntity, final TextView detail_task_tv_center, final int type) {
|
|
public void palyGameDetailBtnValue(final Context context, final GameEntity gameEntity, final TextView detail_task_tv_center, final int type) {
|
|
|
|
|
+ if (detail_task_tv_center == null)
|
|
|
|
|
+ return;
|
|
|
|
|
+ final boolean showSimpleText = detail_task_tv_center.getText().length() < 4;
|
|
|
final TaskReleaseEty releaseEty = gameEntity.getRelease_task();
|
|
final TaskReleaseEty releaseEty = gameEntity.getRelease_task();
|
|
|
final TaskEty taskEty = releaseEty != null ? releaseEty.getTask() : null;
|
|
final TaskEty taskEty = releaseEty != null ? releaseEty.getTask() : null;
|
|
|
if (releaseEty != null && taskEty != null) {//游戏任务
|
|
if (releaseEty != null && taskEty != null) {//游戏任务
|
|
|
|
|
|
|
|
if (taskEty.isGameReservationCantDownload()) {//预约
|
|
if (taskEty.isGameReservationCantDownload()) {//预约
|
|
|
if (gameEntity.getStatus() == 1 || gameEntity.getStatus() == 2 || gameEntity.getStatus() == 3) {
|
|
if (gameEntity.getStatus() == 1 || gameEntity.getStatus() == 2 || gameEntity.getStatus() == 3) {
|
|
|
- detail_task_tv_center.setText("已经预约");
|
|
|
|
|
|
|
+ detail_task_tv_center.setText(DownloadTextUtl.getHasReservationText(showSimpleText));
|
|
|
detail_task_tv_center.setEnabled(false);
|
|
detail_task_tv_center.setEnabled(false);
|
|
|
} else {
|
|
} else {
|
|
|
- detail_task_tv_center.setText("预约下载");
|
|
|
|
|
|
|
+ detail_task_tv_center.setText(DownloadTextUtl.getReservationText(showSimpleText));
|
|
|
detail_task_tv_center.setEnabled(true);
|
|
detail_task_tv_center.setEnabled(true);
|
|
|
if (type == 0) {
|
|
if (type == 0) {
|
|
|
detail_task_tv_center.setOnClickListener(new View.OnClickListener() {
|
|
detail_task_tv_center.setOnClickListener(new View.OnClickListener() {
|
|
@@ -2471,7 +2471,7 @@ public class CommonUtil {
|
|
|
public void call(Integer integer) {
|
|
public void call(Integer integer) {
|
|
|
if (integer > 0) {
|
|
if (integer > 0) {
|
|
|
gameEntity.setAccepted_task_id(integer);
|
|
gameEntity.setAccepted_task_id(integer);
|
|
|
- detail_task_tv_center.setText("已预约");
|
|
|
|
|
|
|
+ detail_task_tv_center.setText(DownloadTextUtl.getHasReservationText(showSimpleText));
|
|
|
detail_task_tv_center.setEnabled(false);
|
|
detail_task_tv_center.setEnabled(false);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -2656,6 +2656,7 @@ public class CommonUtil {
|
|
|
TaskHelper.setNumText((TextView) itemView.findViewById(R.id.item_num_tv1), taskReleaseEty);
|
|
TaskHelper.setNumText((TextView) itemView.findViewById(R.id.item_num_tv1), taskReleaseEty);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//使webView支持下载文件
|
|
//使webView支持下载文件
|
|
|
public void setDownloadListener(final Activity activity, WebView webView) {
|
|
public void setDownloadListener(final Activity activity, WebView webView) {
|
|
|
webView.setDownloadListener(new DownloadListener() {
|
|
webView.setDownloadListener(new DownloadListener() {
|
|
@@ -2666,6 +2667,7 @@ public class CommonUtil {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//使webView支持下载文件
|
|
//使webView支持下载文件
|
|
|
public void setDownloadListener(final Activity activity, com.tencent.smtt.sdk.WebView webView) {
|
|
public void setDownloadListener(final Activity activity, com.tencent.smtt.sdk.WebView webView) {
|
|
|
webView.setDownloadListener(new com.tencent.smtt.sdk.DownloadListener() {
|
|
webView.setDownloadListener(new com.tencent.smtt.sdk.DownloadListener() {
|
|
@@ -2677,17 +2679,18 @@ public class CommonUtil {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//显示下载提示框
|
|
//显示下载提示框
|
|
|
- public void showDownloadDialog(final Activity activity, final String url){
|
|
|
|
|
|
|
+ public void showDownloadDialog(final Activity activity, final String url) {
|
|
|
final String fileName = com.sheep.gamegroup.util.FileUtil.getFileName(url);
|
|
final String fileName = com.sheep.gamegroup.util.FileUtil.getFileName(url);
|
|
|
final File saveFile = new File(DIR, fileName);
|
|
final File saveFile = new File(DIR, fileName);
|
|
|
final boolean exists = saveFile.exists();
|
|
final boolean exists = saveFile.exists();
|
|
|
ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("下载提示")
|
|
ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("下载提示")
|
|
|
- .setMsg((exists ? "是否重新下载文件:" : "是否下载文件:" )+ saveFile.getAbsolutePath()).setBtnLeftText("取消下载").setBtnRightText("确认下载")
|
|
|
|
|
|
|
+ .setMsg((exists ? "是否重新下载文件:" : "是否下载文件:") + saveFile.getAbsolutePath()).setBtnLeftText("取消下载").setBtnRightText("确认下载")
|
|
|
.setBtnRightOnClickListener(new View.OnClickListener() {
|
|
.setBtnRightOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
public void onClick(View view) {
|
|
|
- if(exists && saveFile.delete()){
|
|
|
|
|
|
|
+ if (exists && saveFile.delete()) {
|
|
|
LogUtil.println("setDownloadListener", "setDownloadListener", "onDownloadStart", url, saveFile.getAbsolutePath(), "成功删除原来的文件");
|
|
LogUtil.println("setDownloadListener", "setDownloadListener", "onDownloadStart", url, saveFile.getAbsolutePath(), "成功删除原来的文件");
|
|
|
}
|
|
}
|
|
|
DownloadService.sysDownload(activity, url, fileName, "来自小绵羊的下载:" + fileName, fileName, "系统开始下载apk");
|
|
DownloadService.sysDownload(activity, url, fileName, "来自小绵羊的下载:" + fileName, fileName, "系统开始下载apk");
|