From dcabfa4f14e0fcc383e494a9ae777908c658cad2 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 27 Sep 2019 23:32:31 +0200 Subject: [PATCH] add Progress Bar function --- .../org/mian/gitnex/adapters/MilestonesAdapter.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/java/org/mian/gitnex/adapters/MilestonesAdapter.java b/app/src/main/java/org/mian/gitnex/adapters/MilestonesAdapter.java index 2aa4e796..c890936c 100644 --- a/app/src/main/java/org/mian/gitnex/adapters/MilestonesAdapter.java +++ b/app/src/main/java/org/mian/gitnex/adapters/MilestonesAdapter.java @@ -9,6 +9,7 @@ import android.view.ViewGroup; import android.widget.Filter; import android.widget.Filterable; import android.widget.ImageView; +import android.widget.ProgressBar; import android.widget.TextView; import com.amulyakhare.textdrawable.TextDrawable; import com.vdurmont.emoji.EmojiParser; @@ -59,6 +60,7 @@ public class MilestonesAdapter extends RecyclerView.Adapter 0) { + if (currentItem.getOpen_issues() == 0) { + holder.msProgress.setProgress(100); + } else { + holder.msProgress.setProgress(100*currentItem.getClosed_issues()/(currentItem.getOpen_issues() + currentItem.getClosed_issues())); + } + } else { + holder.msProgress.setVisibility(View.GONE); + } + if(currentItem.getDue_on() != null) { if (timeFormat.equals("normal") || timeFormat.equals("pretty")) {