mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-26 16:04:07 +08:00
Fix deleted milestone crash in timeline view (#1242)
Closes #1241 Co-authored-by: M M Arif <mmarif@swatian.com> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1242 Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
parent
06a7eb5a0c
commit
77d84dfefe
@ -462,9 +462,9 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
|||||||
|
|
||||||
this.issueComment = timelineComment;
|
this.issueComment = timelineComment;
|
||||||
|
|
||||||
if (timelineLastView) {
|
// if (timelineLastView) {
|
||||||
// timelineLine2.setVisibility(View.GONE);
|
// timelineLine2.setVisibility(View.GONE);
|
||||||
}
|
// }
|
||||||
|
|
||||||
StringBuilder infoBuilder = null;
|
StringBuilder infoBuilder = null;
|
||||||
if (issueComment.getCreatedAt() != null) {
|
if (issueComment.getCreatedAt() != null) {
|
||||||
@ -485,6 +485,7 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
|||||||
.append(context.getString(R.string.modifiedText));
|
.append(context.getString(R.string.modifiedText));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
assert infoBuilder != null;
|
||||||
String info = infoBuilder.toString();
|
String info = infoBuilder.toString();
|
||||||
|
|
||||||
// label view in timeline
|
// label view in timeline
|
||||||
@ -701,17 +702,24 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
|||||||
issueComment.getMilestone().getTitle(),
|
issueComment.getMilestone().getTitle(),
|
||||||
info));
|
info));
|
||||||
} else {
|
} else {
|
||||||
start.setText(
|
if (issueComment.getOldMilestone() != null) {
|
||||||
context.getString(
|
start.setText(
|
||||||
R.string.timelineMilestoneRemoved,
|
context.getString(
|
||||||
issueComment.getUser().getLogin(),
|
R.string.timelineMilestoneRemoved,
|
||||||
issueComment.getOldMilestone().getTitle(),
|
issueComment.getUser().getLogin(),
|
||||||
info));
|
issueComment.getOldMilestone().getTitle(),
|
||||||
|
info));
|
||||||
|
} else {
|
||||||
|
start.setText(
|
||||||
|
context.getString(
|
||||||
|
R.string.timelineMilestoneDeleted,
|
||||||
|
issueComment.getUser().getLogin(),
|
||||||
|
info));
|
||||||
|
}
|
||||||
timelineIcon.setColorFilter(
|
timelineIcon.setColorFilter(
|
||||||
context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||||
}
|
}
|
||||||
start.setTextSize(fontSize);
|
start.setTextSize(fontSize);
|
||||||
|
|
||||||
timelineIcon.setImageDrawable(
|
timelineIcon.setImageDrawable(
|
||||||
ContextCompat.getDrawable(context, R.drawable.ic_milestone));
|
ContextCompat.getDrawable(context, R.drawable.ic_milestone));
|
||||||
timelineData.addView(start);
|
timelineData.addView(start);
|
||||||
|
@ -814,6 +814,7 @@
|
|||||||
<string name="timelineAssigneesAssigned">%1$s was assigned by %2$s %3$s</string>
|
<string name="timelineAssigneesAssigned">%1$s was assigned by %2$s %3$s</string>
|
||||||
<string name="timelineMilestoneAdded">%1$s added this to the %2$s milestone %3$s</string>
|
<string name="timelineMilestoneAdded">%1$s added this to the %2$s milestone %3$s</string>
|
||||||
<string name="timelineMilestoneRemoved">%1$s removed this from the %2$s milestone %3$s</string>
|
<string name="timelineMilestoneRemoved">%1$s removed this from the %2$s milestone %3$s</string>
|
||||||
|
<string name="timelineMilestoneDeleted">%1$s added this to a deleted milestone %2$s</string>
|
||||||
<string name="timelineStatusClosedIssue">%1$s closed this issue %2$s</string>
|
<string name="timelineStatusClosedIssue">%1$s closed this issue %2$s</string>
|
||||||
<string name="timelineStatusReopenedIssue">%1$s reopened this issue %2$s</string>
|
<string name="timelineStatusReopenedIssue">%1$s reopened this issue %2$s</string>
|
||||||
<string name="timelineStatusReopenedPr">%1$s reopened this pull request %2$s</string>
|
<string name="timelineStatusReopenedPr">%1$s reopened this pull request %2$s</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user