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..5690094f 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.setProgress(0); + } + if(currentItem.getDue_on() != null) { if (timeFormat.equals("normal") || timeFormat.equals("pretty")) { 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 @@ + + + + +