Search in sources :

Example 1 with OnlineFrameworkZip

use of de.robv.android.xposed.installer.util.FrameworkZips.OnlineFrameworkZip in project XposedInstaller by rovo89.

the class StatusInstallerFragment method addZipViews.

private boolean addZipViews(LayoutInflater inflater, ViewGroup root, FrameworkZips.Type type) {
    ViewGroup container = null;
    Set<String> allTitles = FrameworkZips.getAllTitles(type);
    for (String title : allTitles) {
        OnlineFrameworkZip online = FrameworkZips.getOnline(title, type);
        LocalFrameworkZip local = FrameworkZips.getLocal(title, type);
        boolean hasOnline = (online != null);
        boolean hasLocal = (local != null);
        FrameworkZip zip = hasOnline ? online : local;
        boolean isOutdated = zip.isOutdated();
        if (isOutdated && !mShowOutdated) {
            continue;
        }
        if (container == null) {
            View card = inflater.inflate(R.layout.framework_zip_group, root, false);
            TextView tv = (TextView) card.findViewById(android.R.id.title);
            tv.setText(type.title);
            container = (ViewGroup) card.findViewById(android.R.id.content);
            root.addView(card);
        }
        addZipView(inflater, container, zip, hasOnline, hasLocal, isOutdated);
    }
    return !allTitles.isEmpty();
}
Also used : LocalFrameworkZip(de.robv.android.xposed.installer.util.FrameworkZips.LocalFrameworkZip) FrameworkZip(de.robv.android.xposed.installer.util.FrameworkZips.FrameworkZip) OnlineFrameworkZip(de.robv.android.xposed.installer.util.FrameworkZips.OnlineFrameworkZip) ViewGroup(android.view.ViewGroup) LocalFrameworkZip(de.robv.android.xposed.installer.util.FrameworkZips.LocalFrameworkZip) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) OnlineFrameworkZip(de.robv.android.xposed.installer.util.FrameworkZips.OnlineFrameworkZip)

Example 2 with OnlineFrameworkZip

use of de.robv.android.xposed.installer.util.FrameworkZips.OnlineFrameworkZip 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

OnlineFrameworkZip (de.robv.android.xposed.installer.util.FrameworkZips.OnlineFrameworkZip)2 Context (android.content.Context)1 View (android.view.View)1 ViewGroup (android.view.ViewGroup)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)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 FrameworkZip (de.robv.android.xposed.installer.util.FrameworkZips.FrameworkZip)1 LocalFrameworkZip (de.robv.android.xposed.installer.util.FrameworkZips.LocalFrameworkZip)1 File (java.io.File)1