|
|
@@ -22,6 +22,10 @@ import com.arialyy.aria.core.Aria;
|
|
|
import com.arialyy.aria.core.download.DownloadTarget;
|
|
|
import com.arialyy.aria.core.inf.IEntity;
|
|
|
import com.kfzs.duanduan.datashare.provider.download.DownLoadInfo;
|
|
|
+import com.kfzs.duanduan.event.BigEvent;
|
|
|
+import com.kfzs.duanduan.event.EventTypes;
|
|
|
+import com.kfzs.duanduan.fragment.FgtSmallSheep;
|
|
|
+import com.kfzs.duanduan.utils.dlg.SkipUtils;
|
|
|
import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
import com.sheep.gamegroup.alipay.PayResult;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
@@ -31,22 +35,32 @@ import com.sheep.gamegroup.model.entity.RequestParameEty;
|
|
|
import com.sheep.gamegroup.model.entity.TaskChild;
|
|
|
import com.sheep.gamegroup.model.entity.TaskDescEntity;
|
|
|
import com.sheep.gamegroup.model.entity.TaskEty;
|
|
|
+import com.sheep.gamegroup.model.entity.TaskListen;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
+import com.sheep.gamegroup.model.entity.WebviewEntity;
|
|
|
import com.sheep.gamegroup.model.entity.WithdrawalEty;
|
|
|
import com.sheep.gamegroup.model.util.AutoTaskListUtil;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
|
|
|
+import com.sheep.gamegroup.view.activity.GameTaskOrderListAct;
|
|
|
+import com.sheep.gamegroup.view.activity.RechargeAct;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
+import com.sheep.jiuyan.samllsheep.service.MonitorAppService;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
import com.umeng.socialize.ShareAction;
|
|
|
import com.umeng.socialize.UMAuthListener;
|
|
|
import com.umeng.socialize.UMShareAPI;
|
|
|
+import com.umeng.socialize.UMShareListener;
|
|
|
import com.umeng.socialize.bean.SHARE_MEDIA;
|
|
|
import com.umeng.socialize.media.UMImage;
|
|
|
import com.umeng.socialize.media.UMWeb;
|
|
|
+import com.umeng.socialize.shareboard.SnsPlatform;
|
|
|
+import com.umeng.socialize.utils.ShareBoardlistener;
|
|
|
+
|
|
|
+import org.greenrobot.eventbus.EventBus;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.lang.reflect.Field;
|
|
|
@@ -145,6 +159,7 @@ public class CommonUtil {
|
|
|
count = count + 2;
|
|
|
}
|
|
|
if(maxLen==count || (item>=128 && maxLen+1==count)){
|
|
|
+ endIndex=i;
|
|
|
}
|
|
|
}
|
|
|
// if (count <= maxLen) {
|
|
|
@@ -197,8 +212,41 @@ public class CommonUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 倒计时
|
|
|
+ */
|
|
|
+ public void countDownTimer(final TextView tv, long full_second, SelfCountDownTimer countDownUtil){
|
|
|
+ countDownUtil = new SelfCountDownTimer(full_second * 1000, 1000,(int)full_second) {
|
|
|
+ @Override
|
|
|
+ public void onTimerRest() {
|
|
|
+ tv.setText("");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onTimerTick(long millisUntilFinished, int counTime) {
|
|
|
+ String textStr = counTime + " s";
|
|
|
+ tv.setText("");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onTimerFinish() {
|
|
|
+ tv.setText("");
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 任务倒计时
|
|
|
+ * 组装String
|
|
|
+ * 若00:00:00后任务未完成,视为自动放弃,您可重新接受
|
|
|
+ */
|
|
|
+ public String assemblyString(String date){
|
|
|
+ String str = "若<font color='#ff2d4b'><small>" + date + "</small></font>后任务未完成,视为自动放弃,您可重新接受";
|
|
|
+ return str;
|
|
|
+ }
|
|
|
public String assemblyStrings(String date, String notice){
|
|
|
- return notice + "<font color='#ff2d4b'><small>" + date + "</small></font>";
|
|
|
+ String str = notice + "<font color='#ff2d4b'><small>" + date + "</small></font>";
|
|
|
+ return str;
|
|
|
}
|
|
|
/**
|
|
|
* 任务传送数据组装
|
|
|
@@ -251,8 +299,8 @@ public class CommonUtil {
|
|
|
Drawable mipmap = context.getResources().getDrawable(
|
|
|
getResourceId(source)
|
|
|
);
|
|
|
- mipmap.setBounds(0, 0, mipmap.getIntrinsicWidth(),
|
|
|
- mipmap.getIntrinsicHeight());
|
|
|
+ mipmap.setBounds(0, 0, mipmap.getIntrinsicWidth() / 1,
|
|
|
+ mipmap.getIntrinsicHeight() / 1);
|
|
|
return mipmap;
|
|
|
}
|
|
|
}, null);
|
|
|
@@ -539,7 +587,7 @@ public class CommonUtil {
|
|
|
* 任务详情、连续任务、子任务组装
|
|
|
*/
|
|
|
public void bindDataTaskDetailSon(TaskChild taskChild, TextView textView, int i){
|
|
|
- String state;
|
|
|
+ String state = "";
|
|
|
switch (taskChild.getStatus()){
|
|
|
case 1:
|
|
|
default:
|
|
|
@@ -568,7 +616,7 @@ public class CommonUtil {
|
|
|
}
|
|
|
public void bindDataTaskDetailSonStep(TaskDescEntity taskDescEntity, TextView textView, int i){
|
|
|
|
|
|
- String state;
|
|
|
+ String state = "";
|
|
|
switch (i+1){
|
|
|
case 1:
|
|
|
default:
|
|
|
@@ -636,6 +684,7 @@ public class CommonUtil {
|
|
|
SelfCountDownTimer scTimer = timerHashMap.get(textView);
|
|
|
if(scTimer != null){
|
|
|
scTimer.cancel();
|
|
|
+ scTimer = null;
|
|
|
}
|
|
|
}
|
|
|
public void addTimerHashMap(TextView textView, SelfCountDownTimer selfCountDownTimer){
|
|
|
@@ -654,9 +703,12 @@ public class CommonUtil {
|
|
|
Map.Entry pairs = (Map.Entry) it.next();
|
|
|
SelfCountDownTimer cdt = (SelfCountDownTimer) pairs.getValue();
|
|
|
cdt.cancel();
|
|
|
+ cdt = null;
|
|
|
} catch (Exception ignored) {
|
|
|
}
|
|
|
}
|
|
|
+ it = null;
|
|
|
+ s = null;
|
|
|
timerHashMap.clear();
|
|
|
}
|
|
|
|
|
|
@@ -682,9 +734,16 @@ public class CommonUtil {
|
|
|
SHARE_MEDIA.QQ,
|
|
|
SHARE_MEDIA.WEIXIN)
|
|
|
.setCallback(new UMShareListener())
|
|
|
+// .addButton("copy_share_url","copy_share_url","icon","icon")
|
|
|
+// .setShareboardclickCallback(new ShareBoardlistener() {
|
|
|
+// @Override
|
|
|
+// public void onclick(SnsPlatform snsPlatform, SHARE_MEDIA share_media) {
|
|
|
+//
|
|
|
+// }
|
|
|
+// })
|
|
|
.open();
|
|
|
}else {
|
|
|
- SHARE_MEDIA share_media;
|
|
|
+ SHARE_MEDIA share_media = SHARE_MEDIA.QQ;
|
|
|
if(type.equals("qq")){
|
|
|
share_media = SHARE_MEDIA.QQ;
|
|
|
}else {
|
|
|
@@ -742,15 +801,17 @@ public class CommonUtil {
|
|
|
public void run() {
|
|
|
|
|
|
PayResult payResult = new PayResult(result);
|
|
|
- /*
|
|
|
- 同步返回的结果必须放置到服务端进行验证(验证的规则请看https://doc.open.alipay.com/doc2/
|
|
|
- detail.htm?spm=0.0.0.0.xdvAU6&treeId=59&articleId=103665&
|
|
|
- docType=1) 建议商户依赖异步通知
|
|
|
+ /**
|
|
|
+ * 同步返回的结果必须放置到服务端进行验证(验证的规则请看https://doc.open.alipay.com/doc2/
|
|
|
+ * detail.htm?spm=0.0.0.0.xdvAU6&treeId=59&articleId=103665&
|
|
|
+ * docType=1) 建议商户依赖异步通知
|
|
|
*/
|
|
|
// String resultInfo = payResult.getResult();// 同步返回需要验证的信息
|
|
|
|
|
|
String resultStatus = payResult.getResultStatus();
|
|
|
Jump2View.getInstance().goRechargeResultAct(activity, resultStatus);
|
|
|
+ if(activity instanceof GameTaskOrderListAct)
|
|
|
+ EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.ONFRESH_GAMETASK_ORDER_LIST_PAGE));
|
|
|
if(dialog != null){
|
|
|
dialog.dismiss();
|
|
|
}
|
|
|
@@ -815,6 +876,8 @@ public class CommonUtil {
|
|
|
@Override
|
|
|
public void onError(BaseMessage baseMessage) {
|
|
|
G.showToast(baseMessage.getMsg() +"");
|
|
|
+ ViewUtil.newInstance()
|
|
|
+ .hideProgress(context);
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -825,6 +888,7 @@ public class CommonUtil {
|
|
|
ViewUtil.newInstance()
|
|
|
.hideProgress(context);
|
|
|
if(status == 2){
|
|
|
+ EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.ONFRESH_GAMETASK_ORDER_LIST_PAGE));
|
|
|
return;
|
|
|
}
|
|
|
if(finalPay_type == 1){
|
|
|
@@ -833,6 +897,7 @@ public class CommonUtil {
|
|
|
context,
|
|
|
null);
|
|
|
}else {
|
|
|
+ EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.ONFRESH_GAMETASK_ORDER_LIST_PAGE));
|
|
|
G.showToast("充值成功!");
|
|
|
}
|
|
|
} catch (Exception e) {
|