From 9688c75106d10540780a5d1acda6f4066505c82f Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 27 Sep 2019 22:52:29 +0200 Subject: [PATCH 1/3] add progress bar to layout --- app/src/main/res/layout/milestones_list.xml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/milestones_list.xml b/app/src/main/res/layout/milestones_list.xml index d38de6c9..ce1b71ad 100644 --- a/app/src/main/res/layout/milestones_list.xml +++ b/app/src/main/res/layout/milestones_list.xml @@ -53,7 +53,24 @@ + + + + + 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 2/3] 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")) { From 0ac2a2754974b5a8a37fa5528e6fb26933912455 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 27 Sep 2019 23:58:23 +0200 Subject: [PATCH 3/3] all milestones look similar --- .../main/java/org/mian/gitnex/adapters/MilestonesAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c890936c..5690094f 100644 --- a/app/src/main/java/org/mian/gitnex/adapters/MilestonesAdapter.java +++ b/app/src/main/java/org/mian/gitnex/adapters/MilestonesAdapter.java @@ -193,7 +193,7 @@ public class MilestonesAdapter extends RecyclerView.Adapter