Search in sources :

Example 1 with DownloadFinishedCallback

use of de.robv.android.xposed.installer.util.DownloadsUtil.DownloadFinishedCallback in project XposedInstaller by rovo89.

the class StatusInstallerFragment method download.

private void download(Context context, String title, FrameworkZips.Type type, final RunnableWithParam<File> callback) {
    OnlineFrameworkZip zip = FrameworkZips.getOnline(title, type);
    new DownloadsUtil.Builder(context).setTitle(zip.title).setUrl(zip.url).setDestinationFromUrl(DownloadsUtil.DOWNLOAD_FRAMEWORK).setCallback(new DownloadFinishedCallback() {

        @Override
        public void onDownloadFinished(Context context, DownloadInfo info) {
            LOCAL_ZIP_LOADER.triggerReload(true);
            callback.run(new File(info.localFilename));
        }
    }).setMimeType(DownloadsUtil.MIME_TYPES.ZIP).setDialog(true).download();
}
Also used : Context(android.content.Context) DownloadInfo(de.robv.android.xposed.installer.util.DownloadsUtil.DownloadInfo) DownloadsUtil(de.robv.android.xposed.installer.util.DownloadsUtil) DownloadFinishedCallback(de.robv.android.xposed.installer.util.DownloadsUtil.DownloadFinishedCallback) File(java.io.File) OnlineFrameworkZip(de.robv.android.xposed.installer.util.FrameworkZips.OnlineFrameworkZip)

Aggregations

Context (android.content.Context)1 DownloadsUtil (de.robv.android.xposed.installer.util.DownloadsUtil)1 DownloadFinishedCallback (de.robv.android.xposed.installer.util.DownloadsUtil.DownloadFinishedCallback)1 DownloadInfo (de.robv.android.xposed.installer.util.DownloadsUtil.DownloadInfo)1 OnlineFrameworkZip (de.robv.android.xposed.installer.util.FrameworkZips.OnlineFrameworkZip)1 File (java.io.File)1