public final void notifyProgress(Download paramDownload, DownloadProgress paramDownloadProgress) { if (paramDownloadProgress.equals(paramDownload.getProgress())) { return; } paramDownload.setProgress(paramDownloadProgress); int i; if ((paramDownloadProgress.statusCode == this.mPreviousProgressStatus) && (this.mPreviousContentUri != null)) { boolean bool = this.mPreviousContentUri.equals(paramDownload.getContentUri()); i = 0; if (bool) {} } else { i = 1; } if (i != 0) { Object[] arrayOfObject = new Object[2]; arrayOfObject[0] = paramDownload; arrayOfObject[1] = paramDownloadProgress.toString(); FinskyLog.d("%s: onProgress %s.", arrayOfObject); this.mPreviousContentUri = paramDownload.getContentUri(); this.mPreviousProgressStatus = paramDownloadProgress.statusCode; } notifyListeners(2, paramDownload); }
public void render(int x, int y, int width, int height) { MCRenderDelegate r = (MCRenderDelegate) SpoutClient.getInstance().getRenderDelegate(); FontRenderer font = SpoutClient.getHandle().fontRenderer; String sResolution = resolution + "x"; int sWidth = font.getStringWidth(sResolution); font.drawStringWithShadow(sResolution, x + width - sWidth - 2, y + 2, 0xffaaaaaa); String name = r.getFittingText(getName(), width - 29 - sWidth - 2 - x); font.drawStringWithShadow(name, x + 29, y + 2, 0xffffffff); String sStatus = ""; if (size > 1024 * 1024 * 9000) { sStatus = ChatColor.RED + "It's over 9000! "; } if (size > 1024 * 1024) { sStatus += size / (1024 * 1024) + " MB"; } else if (size > 1024) { sStatus = size / 1024 + " KB"; } else { sStatus = size + " Bytes"; } if (isDownloading()) { sStatus = "Downloading: " + ChatColor.WHITE + download.getProgress() + "%"; } if (downloadFail != null) { sStatus = downloadFail; } if (installed) { sStatus = ChatColor.GREEN + "Installed"; } if (sStatus != null) { sWidth = font.getStringWidth(sStatus); font.drawStringWithShadow(sStatus, x + width - sWidth - 2, y + 11, 0xffaaaaaa); } String author = "by " + ChatColor.WHITE + getAuthor(); author = r.getFittingText(author, width - 29 - sWidth - 2 - x); font.drawStringWithShadow(author, x + 29, y + 11, 0xffaaaaaa); String desc = r.getFittingText(getDescription(), width - 2 - 29); font.drawStringWithShadow(desc, x + 29, y + 20, 0xffaaaaaa); String iconUrl = getIconUrl(); Texture icon = CustomTextureManager.getTextureFromUrl(iconUrl); if (icon == null) { CustomTextureManager.downloadTexture(iconUrl, true); } else { GL11.glPushMatrix(); GL11.glTranslated(x + 2, y + 2, 0); r.drawTexture(icon, 25, 25); GL11.glPopMatrix(); } }
private void notifyListeners(int paramInt, final Download paramDownload) { final DownloadProgress localDownloadProgress; if (paramDownload == null) { localDownloadProgress = null; label6: if (paramDownload != null) { break label72; } } label72: for (final int i = -1;; i = paramDownload.getHttpStatus()) { switch (paramInt) { default: throw new IllegalStateException("Bad listener type."); localDownloadProgress = paramDownload.getProgress(); break label6; } } Object localObject = new ListenerNotifier(paramInt, paramDownload) { public final void updateListener(DownloadQueueListener paramAnonymousDownloadQueueListener) { paramAnonymousDownloadQueueListener.onNotificationClicked(paramDownload); } }; for (;;) { new Handler(Looper.getMainLooper()).post((Runnable)localObject); return; localObject = new ListenerNotifier(paramInt, paramDownload) { public final void updateListener(DownloadQueueListener paramAnonymousDownloadQueueListener) { paramAnonymousDownloadQueueListener.onComplete(paramDownload); } }; continue; localObject = new ListenerNotifier(paramInt, paramDownload) { public final void updateListener(DownloadQueueListener paramAnonymousDownloadQueueListener) { paramAnonymousDownloadQueueListener.onProgress(paramDownload, localDownloadProgress); } }; continue; localObject = new ListenerNotifier(paramInt, paramDownload) { public final void updateListener(DownloadQueueListener paramAnonymousDownloadQueueListener) { paramAnonymousDownloadQueueListener.onCancel(paramDownload); } }; continue; localObject = new ListenerNotifier(paramInt, paramDownload) { public final void updateListener(DownloadQueueListener paramAnonymousDownloadQueueListener) { paramAnonymousDownloadQueueListener.onError(paramDownload, i); } }; continue; localObject = new ListenerNotifier(paramInt, paramDownload) { public final void updateListener(DownloadQueueListener paramAnonymousDownloadQueueListener) { paramAnonymousDownloadQueueListener.onStart(paramDownload); } }; } }