添加下载状态通知功能
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.gh.gamecenter;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentPagerAdapter;
|
||||
@ -19,7 +20,7 @@ import com.gh.gamecenter.download.GameDownLoadFragment;
|
||||
import com.gh.gamecenter.download.GameUpdateFragment;
|
||||
import com.gh.gamecenter.eventbus.EBDownloadChanged;
|
||||
import com.gh.gamecenter.eventbus.EBMiPush;
|
||||
import com.gh.gamecenter.eventbus.EBPerformClick;
|
||||
import com.gh.gamecenter.eventbus.EBSkip;
|
||||
import com.gh.gamecenter.eventbus.EBUISwitch;
|
||||
import com.gh.gamecenter.manager.PackageManager;
|
||||
|
||||
@ -46,6 +47,8 @@ public class DownloadManagerActivity extends BaseFragmentActivity implements
|
||||
|
||||
private int width;
|
||||
|
||||
private Handler handler = new Handler();
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
@ -238,11 +241,20 @@ public class DownloadManagerActivity extends BaseFragmentActivity implements
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onEventMainThread(EBPerformClick click) {
|
||||
if (click.getFrom().equals("update")) {
|
||||
downloadmanager_ll_download.performClick();
|
||||
|
||||
public void onEventMainThread(EBSkip skip) {
|
||||
if ("DownloadManagerActivity".equals(skip.getType())) {
|
||||
if (skip.getCurrentItem() == 0) {
|
||||
handler.postDelayed(runnable, 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
downloadmanager_ll_download.performClick();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user