|
|
@@ -63,6 +63,7 @@ import com.sheep.gamegroup.view.activity.ActMyWelfare;
|
|
|
import com.sheep.gamegroup.view.activity.ActNewAboutUs;
|
|
|
import com.sheep.gamegroup.view.activity.ActNewbieTaskList;
|
|
|
import com.sheep.gamegroup.view.activity.ActNotice;
|
|
|
+import com.sheep.gamegroup.view.activity.ActPay;
|
|
|
import com.sheep.gamegroup.view.activity.ActPlayGameDetail;
|
|
|
import com.sheep.gamegroup.view.activity.ActReservation;
|
|
|
import com.sheep.gamegroup.view.activity.ActSearchApp;
|
|
|
@@ -858,7 +859,7 @@ public class Jump2View {
|
|
|
}
|
|
|
//检查url是否是http或者https开头并添加
|
|
|
if (!url.startsWith("http") && !url.startsWith("https") && !url.contains("://")) {
|
|
|
- url = "http://"+url;
|
|
|
+ url = "http://" + url;
|
|
|
}
|
|
|
try {
|
|
|
Uri uri = Uri.parse(url);
|
|
|
@@ -883,7 +884,7 @@ public class Jump2View {
|
|
|
}
|
|
|
//检查url是否是http或者https开头并添加
|
|
|
if (!url.startsWith("http") && !url.startsWith("https") && !url.contains("://")) {
|
|
|
- url = "http://"+url;
|
|
|
+ url = "http://" + url;
|
|
|
}
|
|
|
Intent intent = new Intent(context, ActWeb.class);
|
|
|
intent.putExtra("url", url);
|
|
|
@@ -1088,6 +1089,7 @@ public class Jump2View {
|
|
|
// intent.putExtra("isShow", isShow);
|
|
|
// context.startService(intent);
|
|
|
// }
|
|
|
+
|
|
|
/**
|
|
|
* 启动小绵羊悬浮窗
|
|
|
*
|
|
|
@@ -1095,10 +1097,10 @@ public class Jump2View {
|
|
|
*/
|
|
|
public void startAutoCheckService(Context context, ArrayList<String> taskList) {
|
|
|
String userId = DataUtil.getInstance().getUserId();
|
|
|
- if(TextUtils.isEmpty(userId)){
|
|
|
+ if (TextUtils.isEmpty(userId)) {
|
|
|
return;
|
|
|
}
|
|
|
- if(AutoCheckService.IS_USE_THIS_SERVICE) {
|
|
|
+ if (AutoCheckService.IS_USE_THIS_SERVICE) {
|
|
|
Intent intent = new Intent(context, AutoCheckService.class);
|
|
|
intent.putStringArrayListExtra(AutoCheckService.EXTRA_KEY_TASK_LIST, taskList);
|
|
|
intent.putExtra(AutoCheckService.EXTRA_KEY_USER_ID, userId);
|
|
|
@@ -1125,6 +1127,7 @@ public class Jump2View {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 启动小绵羊悬浮窗
|
|
|
*
|
|
|
@@ -1132,7 +1135,7 @@ public class Jump2View {
|
|
|
*/
|
|
|
public void startListenerShotService(Context context) {
|
|
|
if (DataUtil.IS_LISTEN_SCREEN_SHOT && (!IS_RECORD_PATH || !TextUtils.isEmpty(DataUtil.getInstance().getUserId()))) {
|
|
|
- if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
|
+ if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
|
Intent intent = new Intent(context, ListenerShotNewService.class);
|
|
|
intent.putExtra(AutoCheckService.EXTRA_KEY_USER_ID, DataUtil.getInstance().getUserId());//记录用户截图方案需要记录当前用户id
|
|
|
context.startForegroundService(intent);
|
|
|
@@ -1141,7 +1144,7 @@ public class Jump2View {
|
|
|
intent.putExtra(AutoCheckService.EXTRA_KEY_USER_ID, DataUtil.getInstance().getUserId());//记录用户截图方案需要记录当前用户id
|
|
|
context.startService(intent);
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1323,7 +1326,7 @@ public class Jump2View {
|
|
|
public void gotoLoginAgain(String o) {
|
|
|
SpUtils.saveToken(SheepApp.getInstance(), "");
|
|
|
DataUtil.getInstance().clearData();
|
|
|
- G.showToast(TextUtils.isEmpty(o)?"请重新登录":o);
|
|
|
+ G.showToast(TextUtils.isEmpty(o) ? "请重新登录" : o);
|
|
|
ActivityManager.getInstance().finishAllActivity();
|
|
|
Jump2View.getInstance().goLoginView(SheepApp.getInstance(), o);
|
|
|
}
|
|
|
@@ -1528,6 +1531,7 @@ public class Jump2View {
|
|
|
intent.putExtra("id", item.getApplication_id());
|
|
|
activity.startActivity(intent);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 发现模块--游戏详情界面
|
|
|
*
|
|
|
@@ -1539,6 +1543,7 @@ public class Jump2View {
|
|
|
intent.putExtra("id", findApp.getId());
|
|
|
activity.startActivity(intent);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 发现模块--游戏详情界面
|
|
|
*
|
|
|
@@ -1564,6 +1569,7 @@ public class Jump2View {
|
|
|
activity.startActivity(intent);
|
|
|
USER_FIND_APP_ORDER.onEvent();
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 发现模块--资讯详情界面
|
|
|
*
|
|
|
@@ -1694,7 +1700,7 @@ public class Jump2View {
|
|
|
*/
|
|
|
public void goAuditTastList(Activity activity, Object object) {
|
|
|
Intent intent = new Intent(activity, ActAudit.class);
|
|
|
- if(object instanceof Integer){
|
|
|
+ if (object instanceof Integer) {
|
|
|
DataUtil.putObject(intent, object);
|
|
|
}
|
|
|
activity.startActivity(intent);
|
|
|
@@ -1792,6 +1798,7 @@ public class Jump2View {
|
|
|
ASK_MAKE_MONEY_INVITATION.onEvent();
|
|
|
activity.startActivity(new Intent(activity, ActInvitation.class));
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 跳到积分兑换界面
|
|
|
*
|
|
|
@@ -1802,6 +1809,7 @@ public class Jump2View {
|
|
|
context.startActivity(intent);
|
|
|
UMConfigUtils.Event.EXCHANGE_CMCC.onEvent();
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 点击看点
|
|
|
*
|
|
|
@@ -1816,12 +1824,13 @@ public class Jump2View {
|
|
|
CommonUtil.getInstance().awakenDetail(entity);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- if(TestUtil.isTest())
|
|
|
+ if (TestUtil.isTest())
|
|
|
G.showToast(e.getMessage());
|
|
|
else
|
|
|
G.showToast(activity.getString(R.string.not_install, entity.getApp_name()));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 通过id尝试打开一个看点
|
|
|
*
|
|
|
@@ -1829,24 +1838,24 @@ public class Jump2View {
|
|
|
*/
|
|
|
public void goWatchFocus(final Activity activity, int id) {
|
|
|
SheepApp.getInstance().getNetComponent().getApiService().awakenAppArticle(id)
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
- @Override
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
- RouserArticlesEntity item = baseMessage.getData(RouserArticlesEntity.class);
|
|
|
- if(item == null){
|
|
|
- G.showToast(R.string.error_data);
|
|
|
- return;
|
|
|
- }
|
|
|
- goWatchFocus(activity, item);
|
|
|
- }
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ RouserArticlesEntity item = baseMessage.getData(RouserArticlesEntity.class);
|
|
|
+ if (item == null) {
|
|
|
+ G.showToast(R.string.error_data);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ goWatchFocus(activity, item);
|
|
|
+ }
|
|
|
|
|
|
- @Override
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
- G.showToast(baseMessage);
|
|
|
- }
|
|
|
- });
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ G.showToast(baseMessage);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
//通过查询发现打开一个发现
|
|
|
@@ -1858,7 +1867,7 @@ public class Jump2View {
|
|
|
@Override
|
|
|
public void onNext(BaseMessage baseMessage) {
|
|
|
FindItem item = baseMessage.getData(FindItem.class);
|
|
|
- if(item == null){
|
|
|
+ if (item == null) {
|
|
|
G.showToast(R.string.error_data);
|
|
|
return;
|
|
|
}
|
|
|
@@ -1871,9 +1880,10 @@ public class Jump2View {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
//打开一个发现
|
|
|
public void goFindItem(Activity activity, FindItem item) {
|
|
|
- switch (item.getType()){//类型 1:游戏 2:咨询 3:转跳 4:任务 5:栏目
|
|
|
+ switch (item.getType()) {//类型 1:游戏 2:咨询 3:转跳 4:任务 5:栏目
|
|
|
case 1:
|
|
|
Jump2View.getInstance().goFindGame(activity, item);
|
|
|
break;
|
|
|
@@ -1891,8 +1901,10 @@ public class Jump2View {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 打开一个homelist项
|
|
|
+ *
|
|
|
* @param item
|
|
|
*/
|
|
|
private void openHomeListItem(final Activity activity, FindItem item) {
|
|
|
@@ -1903,7 +1915,7 @@ public class Jump2View {
|
|
|
@Override
|
|
|
public void onNext(BaseMessage baseMessage) {
|
|
|
HomeListEntity homeListEntity = baseMessage.getData(HomeListEntity.class);
|
|
|
- if(homeListEntity == null){
|
|
|
+ if (homeListEntity == null) {
|
|
|
G.showToast(R.string.error_data);
|
|
|
return;
|
|
|
}
|
|
|
@@ -1916,16 +1928,18 @@ public class Jump2View {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 打开一个链接
|
|
|
+ *
|
|
|
* @param item
|
|
|
*/
|
|
|
private void openLink(Activity activity, FindItem item) {
|
|
|
- if(TextUtils.isEmpty(item.getUrl())){
|
|
|
+ if (TextUtils.isEmpty(item.getUrl())) {
|
|
|
G.showToast(R.string.error_link);
|
|
|
return;
|
|
|
}
|
|
|
- switch (item.getIs_in_url()){//是否外部链接 1:是 0:不是
|
|
|
+ switch (item.getIs_in_url()) {//是否外部链接 1:是 0:不是
|
|
|
case 1:
|
|
|
Jump2View.getInstance().goWeb(activity, item.getUrl());
|
|
|
break;
|
|
|
@@ -1934,4 +1948,18 @@ public class Jump2View {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 跳转支付界面
|
|
|
+ *
|
|
|
+ * @param activity
|
|
|
+ * @param order_no 订单编号
|
|
|
+ * @param token 登录token
|
|
|
+ */
|
|
|
+ public void goActPay(Activity activity, String order_no, String token) {
|
|
|
+ activity.startActivityForResult(new Intent(activity, ActPay.class)
|
|
|
+ .putExtra("order_no", order_no)
|
|
|
+ .putExtra("token", token),
|
|
|
+ ActPay.RESULT_CODE);
|
|
|
+ }
|
|
|
}
|