0.4.2
This commit is contained in:
1 parent
3aff219639
commit
b69c71a54b
5 files changed
+18
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,7 @@
|
||||
Version 0.4.2 (2014-04-04)
|
||||
* 添加内置存储空间或 Sd Card 检测
|
||||
* 修正由于 gif 格式图片导致的崩溃
|
||||
* 修正由文件夹名而可能产生的错误
|
||||
* 优化网络连接
|
||||
|
||||
Version 0.4.1 (2014-04-02)
|
||||
|
||||
@@ -29,6 +29,9 @@ import com.hippo.ehviewer.util.ThreadPool.JobContext;
|
||||
import com.hippo.ehviewer.view.AlertButton;
|
||||
import com.hippo.ehviewer.widget.DialogBuilder;
|
||||
|
||||
|
||||
// TODO return onFailure when downloading update or check update
|
||||
|
||||
public class UpdateHelper {
|
||||
@SuppressWarnings("unused")
|
||||
private static final String TAG = "UpdateHelper";
|
||||
@@ -40,6 +43,8 @@ public class UpdateHelper {
|
||||
private static final int GOOGLE = 0;
|
||||
private static final int QINIU = 1;
|
||||
|
||||
private static boolean isWorking = false;
|
||||
|
||||
private Activity mActivity;
|
||||
private String updateFileName;
|
||||
private OnCheckUpdateListener mListener;
|
||||
@@ -70,6 +75,14 @@ public class UpdateHelper {
|
||||
}
|
||||
|
||||
public void checkUpdate() {
|
||||
if (isWorking) {
|
||||
if (mListener != null)
|
||||
mListener.onFailure("正在检查更新"); // TODO
|
||||
return;
|
||||
} else {
|
||||
isWorking = true;
|
||||
}
|
||||
|
||||
final AppContext appContext = (AppContext)(mActivity.getApplicationContext());
|
||||
final HttpHelper hp = new HttpHelper(mActivity.getApplicationContext());
|
||||
ThreadPool threadPool = appContext.getNetworkThreadPool();
|
||||
@@ -103,6 +116,8 @@ public class UpdateHelper {
|
||||
});
|
||||
}
|
||||
|
||||
// TODO move dialog into listener
|
||||
|
||||
// TODO
|
||||
@SuppressLint("HandlerLeak")
|
||||
private Handler mHandler = new Handler() {
|
||||
@@ -178,6 +193,8 @@ public class UpdateHelper {
|
||||
if (listener != null)
|
||||
listener.onFailure(checkUpdatePackage.hp.getEMsg());
|
||||
}
|
||||
|
||||
isWorking = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user