mirror of
https://codeberg.org/gitnex/GitNex
synced 2025-01-10 17:42:38 +01:00
add Progress Bar function
This commit is contained in:
parent
9688c75106
commit
dcabfa4f14
@ -9,6 +9,7 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.Filter;
|
import android.widget.Filter;
|
||||||
import android.widget.Filterable;
|
import android.widget.Filterable;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import com.amulyakhare.textdrawable.TextDrawable;
|
import com.amulyakhare.textdrawable.TextDrawable;
|
||||||
import com.vdurmont.emoji.EmojiParser;
|
import com.vdurmont.emoji.EmojiParser;
|
||||||
@ -59,6 +60,7 @@ public class MilestonesAdapter extends RecyclerView.Adapter<MilestonesAdapter.Mi
|
|||||||
private TextView msClosedIssues;
|
private TextView msClosedIssues;
|
||||||
private TextView msDueDate;
|
private TextView msDueDate;
|
||||||
private ImageView msStatus;
|
private ImageView msStatus;
|
||||||
|
private ProgressBar msProgress;
|
||||||
|
|
||||||
private MilestonesViewHolder(View itemView) {
|
private MilestonesViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
@ -69,6 +71,7 @@ public class MilestonesAdapter extends RecyclerView.Adapter<MilestonesAdapter.Mi
|
|||||||
msOpenIssues = itemView.findViewById(R.id.milestoneIssuesOpen);
|
msOpenIssues = itemView.findViewById(R.id.milestoneIssuesOpen);
|
||||||
msClosedIssues = itemView.findViewById(R.id.milestoneIssuesClosed);
|
msClosedIssues = itemView.findViewById(R.id.milestoneIssuesClosed);
|
||||||
msDueDate = itemView.findViewById(R.id.milestoneDueDate);
|
msDueDate = itemView.findViewById(R.id.milestoneDueDate);
|
||||||
|
msProgress = itemView.findViewById(R.id.milestoneProgress);
|
||||||
|
|
||||||
/*issueTitle.setOnClickListener(new View.OnClickListener() {
|
/*issueTitle.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -183,6 +186,16 @@ public class MilestonesAdapter extends RecyclerView.Adapter<MilestonesAdapter.Mi
|
|||||||
holder.msClosedIssues.setText(String.valueOf(currentItem.getClosed_issues()));
|
holder.msClosedIssues.setText(String.valueOf(currentItem.getClosed_issues()));
|
||||||
holder.msClosedIssues.setOnClickListener(new ClickListener(mCtx.getResources().getString(R.string.milestoneClosedIssues, currentItem.getClosed_issues()), mCtx));
|
holder.msClosedIssues.setOnClickListener(new ClickListener(mCtx.getResources().getString(R.string.milestoneClosedIssues, currentItem.getClosed_issues()), mCtx));
|
||||||
|
|
||||||
|
if ((currentItem.getOpen_issues() + currentItem.getClosed_issues()) > 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(currentItem.getDue_on() != null) {
|
||||||
|
|
||||||
if (timeFormat.equals("normal") || timeFormat.equals("pretty")) {
|
if (timeFormat.equals("normal") || timeFormat.equals("pretty")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user