Files
assistant-android/app/src/main/java/com/gh/gamecenter/DownloadManagerActivity.java
2018-11-30 18:16:18 +08:00

53 lines
2.0 KiB
Java

package com.gh.gamecenter;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.gh.base.fragment.BaseFragment_TabLayout;
import com.gh.common.util.EntranceUtils;
import com.gh.gamecenter.download.DownloadFragment;
/**
* 下载更新管理页面
*
* @author 黄壮华
*/
public class DownloadManagerActivity extends NormalActivity {
public static final int INDEX_DOWNLOAD = 0;
public static final int INDEX_UPDATE = 1;
public static final int INDEX_SEND = 2;
public static final String TAG = "DownloadManagerActivity";
@Override
protected Intent provideNormalIntent() {
return getTargetIntent(this, DownloadManagerActivity.class, DownloadFragment.class);
}
public static Intent getDownloadMangerIntent(Context context, String url, String entrance) {
Bundle bundle = new Bundle();
bundle.putString(EntranceUtils.KEY_URL, url);
bundle.putString(EntranceUtils.KEY_ENTRANCE, entrance);
return getTargetIntent(context, DownloadManagerActivity.class, DownloadFragment.class, bundle);
}
public static Intent getDownloadMangerIntent(Context context, int position, String entrance) {
Bundle bundle = new Bundle();
bundle.putString(EntranceUtils.KEY_ENTRANCE, entrance);
bundle.putInt(BaseFragment_TabLayout.PAGE_INDEX, position);
return getTargetIntent(context, DownloadManagerActivity.class, DownloadFragment.class, bundle);
}
/**
* 根据packageName检查是否可以更新/插件化 如果可以则自动下载
*/
public static Intent getDownloadMangerIntent(Context context, String packageName, int position, String entrance) {
Bundle bundle = new Bundle();
bundle.putString(EntranceUtils.KEY_ENTRANCE, entrance);
bundle.putInt(BaseFragment_TabLayout.PAGE_INDEX, position);
bundle.putString(EntranceUtils.KEY_PACKAGENAME, packageName);
return getTargetIntent(context, DownloadManagerActivity.class, DownloadFragment.class, bundle);
}
}