+ bTransactionListCancelDownload.setEnabled(true);
+// ColorStateList csl = Colors.getColorStateList();
+// progressBar.setIndeterminateTintList(csl);
+// progressBar.setProgressTintList(csl);
+// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
+// progressBar.setProgress(0, false);
+// else
+// progressBar.setProgress(0);
+ findViewById(R.id.transaction_progress_layout).setVisibility(View.VISIBLE);
+
+ if (progress.isIndeterminate() || (progress.getTotal() <= 0)) {
+ progressBar.setIndeterminate(true);
+ Logger.debug("progress", "indeterminate");
+ }
+ else {
+ if (progressBar.isIndeterminate()) {
+ progressBar.setIndeterminate(false);
+ }
+// Logger.debug("progress",
+// String.format(Locale.US, "%d/%d", progress.getProgress(), progress.getTotal
+// ()));
+ progressBar.setMax(progress.getTotal());
+ // for some reason animation doesn't work - no progress is shown (stick at 0)
+ // on lineageOS 14.1 (Nougat, 7.1.2)
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
+ progressBar.setProgress(progress.getProgress(), false);
+ else
+ progressBar.setProgress(progress.getProgress());
+ }
+ }
+ public void fabShouldShow() {
+ if ((profile != null) && profile.isPostingPermitted() && !drawer.isOpen())
+ fab.show();
+ else
+ fabHide();
+ }
+ public void fabHide() {
+ fab.hide();