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();
}
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();
}
Aggregations