|
|
@@ -1124,12 +1124,12 @@ public class Jump2View {
|
|
|
/**
|
|
|
* 显示多张图片
|
|
|
*
|
|
|
- * @param context
|
|
|
+ * @param activity
|
|
|
* @param position
|
|
|
* @param imgs 多张图片地址,用;分隔
|
|
|
*/
|
|
|
- public void showImgs(Context context, int position, String imgs) {
|
|
|
- showImgList(context, position, ListUtil.asList(imgs.split(";")));
|
|
|
+ public void showImgs(Activity activity, int position, String imgs) {
|
|
|
+ showImgList(activity, position, ListUtil.asList(imgs.split(";")));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1139,8 +1139,7 @@ public class Jump2View {
|
|
|
* @param position
|
|
|
* @param imgList
|
|
|
*/
|
|
|
- public void showImgList(Context context, int position, ArrayList<String> imgList) {
|
|
|
- Activity activity = context instanceof Activity ? (Activity) context : ActivityManager.getInstance().currentActivity();
|
|
|
+ public void showImgList(Activity activity, int position, ArrayList<String> imgList) {
|
|
|
if (activity != null) {
|
|
|
PhotoPreview.builder()
|
|
|
.setPhotos(imgList)
|
|
|
@@ -1153,12 +1152,12 @@ public class Jump2View {
|
|
|
/**
|
|
|
* 显示多张图片
|
|
|
*
|
|
|
- * @param context
|
|
|
+ * @param activity
|
|
|
* @param position
|
|
|
* @param files
|
|
|
*/
|
|
|
- public void showImgFiles(Context context, int position, File... files) {
|
|
|
- showImgList(context, position, ListUtil.asList(new ListUtil.CallBack<File, String>() {
|
|
|
+ public void showImgFiles(Activity activity, int position, File... files) {
|
|
|
+ showImgList(activity, position, ListUtil.asList(new ListUtil.CallBack<File, String>() {
|
|
|
@Override
|
|
|
public String call(File file) {
|
|
|
return file.getAbsolutePath();
|
|
|
@@ -1638,13 +1637,13 @@ public class Jump2View {
|
|
|
/**
|
|
|
* 发现模块--游戏详情界面
|
|
|
*
|
|
|
- * @param activity
|
|
|
+ * @param context
|
|
|
* @param item
|
|
|
*/
|
|
|
- public void goFindGame(Activity activity, Article item) {
|
|
|
- Intent intent = new Intent(activity, ActGcGameAppDetail.class);
|
|
|
+ public void goFindGame(Context context, Article item) {
|
|
|
+ Intent intent = new Intent(context, ActGcGameAppDetail.class);
|
|
|
intent.putExtra("id", item.getApplication_id());
|
|
|
- activity.startActivity(intent);
|
|
|
+ context.startActivity(intent);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1674,25 +1673,25 @@ public class Jump2View {
|
|
|
/**
|
|
|
* 发现模块--资讯详情界面
|
|
|
*
|
|
|
- * @param activity
|
|
|
+ * @param context
|
|
|
* @param item
|
|
|
*/
|
|
|
- public void goFindInformation(Activity activity, Article item) {
|
|
|
- goFindInformation(activity, item.getTitle(), item.getId());
|
|
|
+ public void goFindInformation(Context context, Article item) {
|
|
|
+ goFindInformation(context, item.getTitle(), item.getId());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 发现模块--资讯详情界面
|
|
|
*
|
|
|
- * @param activity
|
|
|
+ * @param context
|
|
|
* @param title
|
|
|
* @param id
|
|
|
*/
|
|
|
- public void goFindInformation(Activity activity, String title, int id) {
|
|
|
- Intent intent = new Intent(activity, ActArticleComment.class);
|
|
|
+ public void goFindInformation(Context context, String title, int id) {
|
|
|
+ Intent intent = new Intent(context, ActArticleComment.class);
|
|
|
DataUtil.putObject(intent, id);
|
|
|
intent.putExtra("title", title);
|
|
|
- activity.startActivity(intent);
|
|
|
+ context.startActivity(intent);
|
|
|
USER_FIND_APP_ORDER.onEvent();
|
|
|
}
|
|
|
|
|
|
@@ -1917,27 +1916,20 @@ public class Jump2View {
|
|
|
/**
|
|
|
* 点击游戏标签
|
|
|
*/
|
|
|
- public void goActPlayGameList(Activity activity, GameListTag item) {
|
|
|
- Intent intent = new Intent(activity, ActPlayGameList.class);
|
|
|
+ public void goActPlayGameList(Context context, GameListTag item) {
|
|
|
+ Intent intent = new Intent(context, ActPlayGameList.class);
|
|
|
DataUtil.putObject(intent, item.toGameListType());
|
|
|
- activity.startActivity(intent);
|
|
|
+ context.startActivity(intent);
|
|
|
GAME_EVERY_DAY_MORE.onEvent("title", item.getName());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 游戏详情
|
|
|
*/
|
|
|
- public void goPlayGameDetail(Activity activity, int id) {
|
|
|
- if (activity == null) {
|
|
|
- activity = ActivityManager.getInstance().currentActivity();
|
|
|
- }
|
|
|
- if (activity == null) {
|
|
|
- G.showToast(R.string.coming_soon);
|
|
|
- return;
|
|
|
- }
|
|
|
- Intent intent = new Intent(activity, ActGcGameAppDetail.class);
|
|
|
+ public void goPlayGameDetail(Context context, int id) {
|
|
|
+ Intent intent = new Intent(context, ActGcGameAppDetail.class);
|
|
|
intent.putExtra("id", id);
|
|
|
- activity.startActivity(intent);
|
|
|
+ context.startActivity(intent);
|
|
|
GAME_PLAY_GAME_DETAIL.onEvent();
|
|
|
}
|
|
|
|
|
|
@@ -2024,7 +2016,7 @@ public class Jump2View {
|
|
|
}
|
|
|
|
|
|
//通过查询发现打开一个发现
|
|
|
- public void goFindItem(final Activity activity, int findItemId) {
|
|
|
+ public void goFindItem(final Context context, int findItemId) {
|
|
|
SheepApp.getInstance().getNetComponent().getApiService().getFindDetail(findItemId)
|
|
|
.subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
|
@@ -2036,7 +2028,7 @@ public class Jump2View {
|
|
|
G.showToast(R.string.error_data);
|
|
|
return;
|
|
|
}
|
|
|
- goFindItem(activity, item);
|
|
|
+ goFindItem(context, item);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -2047,22 +2039,22 @@ public class Jump2View {
|
|
|
}
|
|
|
|
|
|
//打开一个发现
|
|
|
- public void goFindItem(Activity activity, Article item) {
|
|
|
+ public void goFindItem(Context context, Article item) {
|
|
|
switch (item.getType()) {//类型 1:游戏 2:咨询 3:转跳 4:任务 5:栏目
|
|
|
case 1:
|
|
|
- Jump2View.getInstance().goFindGame(activity, item);
|
|
|
+ Jump2View.getInstance().goFindGame(context, item);
|
|
|
break;
|
|
|
case 2:
|
|
|
- Jump2View.getInstance().goFindInformation(activity, item);
|
|
|
+ Jump2View.getInstance().goFindInformation(context, item);
|
|
|
break;
|
|
|
case 3:
|
|
|
- openLink(activity, item);
|
|
|
+ openLink(context, item);
|
|
|
break;
|
|
|
case 4:
|
|
|
- Jump2View.getInstance().goTaskDetailView(activity, item.getRelease_task_id());
|
|
|
+ Jump2View.getInstance().goTaskDetailView(context, item.getRelease_task_id());
|
|
|
break;
|
|
|
case 5:
|
|
|
- openHomeListItem(activity, item);
|
|
|
+ openHomeListItem(context, item);
|
|
|
break;
|
|
|
}
|
|
|
FIND_ITEM.onEvent("find_id", item.getId());
|
|
|
@@ -2085,7 +2077,7 @@ public class Jump2View {
|
|
|
*
|
|
|
* @param item
|
|
|
*/
|
|
|
- private void openHomeListItem(final Activity activity, Article item) {
|
|
|
+ private void openHomeListItem(final Context context, Article item) {
|
|
|
SheepApp.getInstance().getNetComponent().getApiService().getHomeListItem(item.getHome_list_id())
|
|
|
.subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
|
@@ -2097,7 +2089,7 @@ public class Jump2View {
|
|
|
G.showToast(R.string.error_data);
|
|
|
return;
|
|
|
}
|
|
|
- CommonUtil.getInstance().goWhere(activity, homeListEntity, "发现");
|
|
|
+ CommonUtil.getInstance().goWhere(context, homeListEntity, "发现");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -2112,17 +2104,17 @@ public class Jump2View {
|
|
|
*
|
|
|
* @param item
|
|
|
*/
|
|
|
- private void openLink(Activity activity, Article item) {
|
|
|
+ private void openLink(Context context, Article item) {
|
|
|
if (TextUtils.isEmpty(item.getUrl())) {
|
|
|
G.showToast(R.string.error_link);
|
|
|
return;
|
|
|
}
|
|
|
switch (item.getIs_in_url()) {//是否外部链接 1:是 0:不是
|
|
|
case 1:
|
|
|
- Jump2View.getInstance().goWeb(activity, item.getUrl());
|
|
|
+ Jump2View.getInstance().goWeb(context, item.getUrl());
|
|
|
break;
|
|
|
default:
|
|
|
- Jump2View.getInstance().goWeb(activity, item.getUrl(), item.getTitle());
|
|
|
+ Jump2View.getInstance().goWeb(context, item.getUrl(), item.getTitle());
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -2194,21 +2186,21 @@ public class Jump2View {
|
|
|
/**
|
|
|
* 跳转游戏评论详情界面
|
|
|
*
|
|
|
- * @param activity
|
|
|
+ * @param context
|
|
|
* @param user_comment_id
|
|
|
*/
|
|
|
- public void goActAppCommentDetail(Activity activity, int user_comment_id) {
|
|
|
- activity.startActivity(DataUtil.putObject(new Intent(activity, ActUserCommentDetail.class), user_comment_id));
|
|
|
+ public void goActAppCommentDetail(Context context, int user_comment_id) {
|
|
|
+ context.startActivity(DataUtil.putObject(new Intent(context, ActUserCommentDetail.class), user_comment_id));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 跳转个人游戏主页界面
|
|
|
*
|
|
|
- * @param activity
|
|
|
+ * @param context
|
|
|
* @param user_id
|
|
|
*/
|
|
|
- public void goActUserAppHome(Activity activity, int user_id) {
|
|
|
- activity.startActivity(DataUtil.putObject(new Intent(activity, ActUserAppHome.class), user_id));
|
|
|
+ public void goActUserAppHome(Context context, int user_id) {
|
|
|
+ context.startActivity(DataUtil.putObject(new Intent(context, ActUserAppHome.class), user_id));
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -2243,14 +2235,13 @@ public class Jump2View {
|
|
|
/**
|
|
|
* 跳转到游戏详情或者任务详情界面
|
|
|
*/
|
|
|
- public void goTaskOrAppDetail(IHomePageSearch item) {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ public void goTaskOrAppDetail(Context context, IHomePageSearch item) {
|
|
|
switch (item.getLink_type()) {
|
|
|
case IHomePageSearch.LINK_TYPE_RELEASE_TASK:
|
|
|
- goTaskDetailView(activity, item.getLink_id());
|
|
|
+ goTaskDetailView(context, item.getLink_id());
|
|
|
break;
|
|
|
case IHomePageSearch.LINK_TYPE_APPLICATIONS:
|
|
|
- goPlayGameDetail(activity, item.getLink_id());
|
|
|
+ goPlayGameDetail(context, item.getLink_id());
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -2262,7 +2253,7 @@ public class Jump2View {
|
|
|
* @param isCache 是否缓存,方便以后播放
|
|
|
*/
|
|
|
public void goActPlayVideo(String url, boolean isCache) {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ Activity activity = SheepApp.getInstance().getCurrentActivity();
|
|
|
if (isCache) {
|
|
|
HttpProxyCacheServer proxy = SheepApp.getHttpProxyCacheServer();
|
|
|
url = proxy.getProxyUrl(url);
|
|
|
@@ -2276,16 +2267,17 @@ public class Jump2View {
|
|
|
* @param item 视频对象
|
|
|
*/
|
|
|
public void goActPlayVideoArticle(Serializable item) {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ Activity activity = SheepApp.getInstance().getCurrentActivity();
|
|
|
activity.startActivity(DataUtil.putObject(new Intent(activity, ActVideoDetail.class), item));
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 播放视频
|
|
|
*
|
|
|
* @param item 视频对象
|
|
|
*/
|
|
|
public void goActPlayVideoArticle(Serializable item, ArrayList<DiscoveryVideo> videoList) {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ Activity activity = SheepApp.getInstance().getCurrentActivity();
|
|
|
Intent intent = new Intent(activity, ActVideoDetail.class);
|
|
|
intent.putExtra(ArrayList.class.getSimpleName(), videoList);
|
|
|
activity.startActivity(DataUtil.putObject(intent, item));
|
|
|
@@ -2350,7 +2342,7 @@ public class Jump2View {
|
|
|
* 小绵羊3.4.5新增--跳转到我的关注界面
|
|
|
*/
|
|
|
public void goActMyFocus() {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ Activity activity = SheepApp.getInstance().getCurrentActivity();
|
|
|
Intent intent = new Intent(activity, ActMyFocus.class);
|
|
|
activity.startActivity(intent);
|
|
|
}
|
|
|
@@ -2359,7 +2351,7 @@ public class Jump2View {
|
|
|
* 小绵羊3.4.5新增--跳转到足迹界面
|
|
|
*/
|
|
|
public void goActFootPrint() {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ Activity activity = SheepApp.getInstance().getCurrentActivity();
|
|
|
Intent intent = new Intent(activity, ActFootprint.class);
|
|
|
activity.startActivity(intent);
|
|
|
}
|
|
|
@@ -2368,7 +2360,7 @@ public class Jump2View {
|
|
|
* 小绵羊3.4.5新增--跳转到收徒红包界面
|
|
|
*/
|
|
|
public void goActApprenticeRedPacket() {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ Activity activity = SheepApp.getInstance().getCurrentActivity();
|
|
|
Intent intent = new Intent(activity, ActApprenticeRedPacket.class);
|
|
|
activity.startActivity(intent);
|
|
|
}
|
|
|
@@ -2377,7 +2369,7 @@ public class Jump2View {
|
|
|
* 小绵羊3.4.5新增--跳转到兑换商城界面
|
|
|
*/
|
|
|
public void goActExchangeMall() {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ Activity activity = SheepApp.getInstance().getCurrentActivity();
|
|
|
Intent intent = new Intent(activity, ActExchangeMall.class);
|
|
|
activity.startActivity(intent);
|
|
|
}
|
|
|
@@ -2386,7 +2378,7 @@ public class Jump2View {
|
|
|
* 小绵羊3.4.5新增--跳转到每日分享界面
|
|
|
*/
|
|
|
public void goActEveryDayShare() {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ Activity activity = SheepApp.getInstance().getCurrentActivity();
|
|
|
Intent intent = new Intent(activity, ActEveryDayShare.class);
|
|
|
activity.startActivity(intent);
|
|
|
}
|
|
|
@@ -2395,7 +2387,7 @@ public class Jump2View {
|
|
|
* 小绵羊3.4.5新增--跳转到娱乐抽奖界面
|
|
|
*/
|
|
|
public void goActEntertainmentLuckDraw() {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ Activity activity = SheepApp.getInstance().getCurrentActivity();
|
|
|
Intent intent = new Intent(activity, ActEntertainmentLuckDraw.class);
|
|
|
activity.startActivity(intent);
|
|
|
}
|
|
|
@@ -2404,7 +2396,7 @@ public class Jump2View {
|
|
|
* 小绵羊3.4.5新增--跳转到金币中心界面
|
|
|
*/
|
|
|
public void goActCoinCenter() {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ Activity activity = SheepApp.getInstance().getCurrentActivity();
|
|
|
Intent intent = new Intent(activity, ActCoinCenter.class);
|
|
|
activity.startActivity(intent);
|
|
|
}
|
|
|
@@ -2413,7 +2405,7 @@ public class Jump2View {
|
|
|
* 小绵羊3.4.5新增--跳转到发布发现内容的界面
|
|
|
*/
|
|
|
public void gotoActPublishArticle(@ActPublishArticle.Type int type) {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ Activity activity = SheepApp.getInstance().getCurrentActivity();
|
|
|
Intent intent = new Intent(activity, ActPublishArticle.class);
|
|
|
activity.startActivity(DataUtil.putObject(intent, type));
|
|
|
}
|
|
|
@@ -2422,7 +2414,7 @@ public class Jump2View {
|
|
|
* 小绵羊3.4.5新增--跳转到发布发现内容的界面
|
|
|
*/
|
|
|
public void gotoActVideoComment(int video_id) {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ Activity activity = SheepApp.getInstance().getCurrentActivity();
|
|
|
Intent intent = new Intent(activity, ActVideoComment.class);
|
|
|
activity.startActivity(DataUtil.putObject(intent, video_id));
|
|
|
}
|
|
|
@@ -2431,7 +2423,7 @@ public class Jump2View {
|
|
|
* 小绵羊3.4.5新增--跳转到选择视频与图片界面
|
|
|
*/
|
|
|
public void gotoActMediaChoose(@ActPublishArticle.Type int type) {
|
|
|
- Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
+ Activity activity = SheepApp.getInstance().getCurrentActivity();
|
|
|
Intent intent = new Intent(activity, ActMediaChoose.class);
|
|
|
activity.startActivity(DataUtil.putObject(intent, type));
|
|
|
}
|