mirror of
https://github.com/gitnex-org/gitnex.git
synced 2026-07-20 15:15:54 -05:00
Move text to string file and other UI improvements
This commit is contained in:
@@ -15,6 +15,7 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.core.text.HtmlCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@@ -125,6 +126,7 @@ public class ExploreIssuesAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
private final LinearLayout frameLabels;
|
||||
private final HorizontalScrollView labelsScrollViewDots;
|
||||
private final LinearLayout frameLabelsDots;
|
||||
private final ImageView commentIcon;
|
||||
private Issue issue;
|
||||
|
||||
IssuesHolder(View itemView) {
|
||||
@@ -138,6 +140,7 @@ public class ExploreIssuesAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
frameLabels = itemView.findViewById(R.id.frameLabels);
|
||||
labelsScrollViewDots = itemView.findViewById(R.id.labelsScrollViewDots);
|
||||
frameLabelsDots = itemView.findViewById(R.id.frameLabelsDots);
|
||||
commentIcon = itemView.findViewById(R.id.comment_icon);
|
||||
|
||||
new Handler().postDelayed(() -> {
|
||||
|
||||
@@ -254,6 +257,11 @@ public class ExploreIssuesAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
labelsScrollViewWithText.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if(issue.getComments() > 15) {
|
||||
commentIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_flame));
|
||||
commentIcon.setColorFilter(context.getResources().getColor(R.color.releasePre, null));
|
||||
}
|
||||
|
||||
switch(timeFormat) {
|
||||
case "pretty": {
|
||||
PrettyTime prettyTime = new PrettyTime(locale);
|
||||
|
||||
@@ -347,7 +347,7 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
});
|
||||
|
||||
commentMenuDelete.setOnClickListener(v1 -> {
|
||||
deleteIssueComment(context, Math.toIntExact(issueComment.getId()), getAdapterPosition());
|
||||
deleteIssueComment(context, Math.toIntExact(issueComment.getId()), getBindingAdapterPosition());
|
||||
dialog.dismiss();
|
||||
});
|
||||
|
||||
@@ -414,13 +414,13 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
TextView end = new TextView(context);
|
||||
|
||||
if(issueComment.getBody().equals("")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " removed the ");
|
||||
start.setText(context.getString(R.string.timelineRemovedLabelStart, issueComment.getUser().getLogin()));
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getUser().getLogin() + " added the ");
|
||||
start.setText(context.getString(R.string.timelineAddedLabelStart, issueComment.getUser().getLogin()));
|
||||
}
|
||||
end.setText(" label " + informationBuilder);
|
||||
end.setText(context.getString(R.string.timelineLabelEnd, informationBuilder));
|
||||
end.setTextSize(12);
|
||||
start.setTextSize(12);
|
||||
|
||||
@@ -434,7 +434,7 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
start.setText(issueComment.getUser().getLogin() + " added commit " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineAddedCommit, issueComment.getUser().getLogin(), informationBuilder));
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_person));
|
||||
@@ -448,19 +448,19 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
if(issueComment.isRemovedAssignee()) {
|
||||
|
||||
if(issueComment.getUser().getLogin().equalsIgnoreCase(issueComment.getAssignee().getLogin())) {
|
||||
start.setText(issueComment.getUser().getLogin() + " removed their assignment " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineAssigneesRemoved, issueComment.getUser().getLogin(), informationBuilder));
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getAssignee().getLogin() + " was unassigned by " + issueComment.getUser().getLogin() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineAssigneesUnassigned, issueComment.getAssignee().getLogin(), issueComment.getUser().getLogin(), informationBuilder));
|
||||
}
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
else {
|
||||
if(issueComment.getUser().getLogin().equalsIgnoreCase(issueComment.getAssignee().getLogin())) {
|
||||
start.setText(issueComment.getUser().getLogin() + " self-assigned this " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineAssigneesSelfAssigned, issueComment.getUser().getLogin(), informationBuilder));
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getAssignee().getLogin() + " was assigned by " + issueComment.getUser().getLogin() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineAssigneesAssigned, issueComment.getAssignee().getLogin(), issueComment.getUser().getLogin(), informationBuilder));
|
||||
}
|
||||
}
|
||||
start.setTextSize(12);
|
||||
@@ -474,10 +474,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getMilestone() != null) {
|
||||
start.setText(issueComment.getUser().getLogin() + " added this to the " + issueComment.getMilestone().getTitle() + " milestone " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineMilestoneAdded, issueComment.getUser().getLogin(), issueComment.getMilestone().getTitle(), informationBuilder));
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getUser().getLogin() + " removed this from the " + issueComment.getOldMilestone().getTitle() + " milestone " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineMilestoneRemoved, issueComment.getUser().getLogin(), issueComment.getOldMilestone().getTitle(), informationBuilder));
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
@@ -493,35 +493,35 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
if(issue.getIssueType().equalsIgnoreCase("Issue")) {
|
||||
if(issueComment.getType().equals("close")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " closed this issue " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineStatusClosedIssue, issueComment.getUser().getLogin(), informationBuilder));
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("reopen")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " reopened this issue " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineStatusReopenedIssue, issueComment.getUser().getLogin(), informationBuilder));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("commit_ref")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " referenced this issue from a commit " + issueComment.getRefCommitSha() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineStatusRefIssue, issueComment.getUser().getLogin(), issueComment.getRefCommitSha(), informationBuilder));
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_bookmark));
|
||||
}
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_issue));
|
||||
}
|
||||
else if(issue.getIssueType().equalsIgnoreCase("Pull")) {
|
||||
if(issueComment.getType().equalsIgnoreCase("close")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " closed this pull request " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineStatusClosedPr, issueComment.getUser().getLogin(), informationBuilder));
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_pull_request));
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("merge_pull")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " merged this pull request " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineStatusMergedPr, issueComment.getUser().getLogin(), informationBuilder));
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_pull_request));
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconPrMergedColor, null));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("commit_ref")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " referenced this issue from a commit " + issueComment.getRefCommitSha() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineStatusRefPr, issueComment.getUser().getLogin(), issueComment.getRefCommitSha(), informationBuilder));
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_bookmark));
|
||||
}
|
||||
else {
|
||||
start.setText(issue.getIssueType() + " reopened this pull request " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineStatusReopenedPr, issueComment.getUser().getLogin(), informationBuilder));
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_pull_request));
|
||||
}
|
||||
}
|
||||
@@ -541,7 +541,7 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
timelineView.setVisibility(View.GONE);
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("review_request")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " requested review from " + issueComment.getAssignee().getLogin() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineReviewRequest, issueComment.getUser().getLogin(), issueComment.getAssignee().getLogin(), informationBuilder));
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_unwatch));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
@@ -552,7 +552,7 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
else if(issueComment.getType().equalsIgnoreCase("change_title")) {
|
||||
|
||||
TextView start = new TextView(context);
|
||||
start.setText(issueComment.getUser().getLogin() + " changed title from " + issueComment.getOldTitle() + " to " + issueComment.getNewTitle() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineChangeTitle, issueComment.getUser().getLogin(), issueComment.getOldTitle(), issueComment.getNewTitle(), informationBuilder));
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_edit));
|
||||
@@ -564,11 +564,11 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getType().equalsIgnoreCase("lock")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " locked as " + issueComment.getBody() + " and limited conversation to collaborators " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineLocked, issueComment.getUser().getLogin(), issueComment.getBody(), informationBuilder));
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_lock));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("unlock")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " unlocked this conversation " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineUnlocked, issueComment.getUser().getLogin(), informationBuilder));
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_key));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
@@ -581,11 +581,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getType().equalsIgnoreCase("add_dependency")) {
|
||||
start.setText(
|
||||
issueComment.getUser().getLogin() + " added a new dependency " + context.getResources().getString(R.string.hash) + issueComment.getDependentIssue().getNumber() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineDependencyAdded, issueComment.getUser().getLogin(), issueComment.getDependentIssue().getNumber(), informationBuilder));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("remove_dependency")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " removed a dependency " + context.getResources().getString(R.string.hash) + issueComment.getDependentIssue().getNumber() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineDependencyRemoved, issueComment.getUser().getLogin(), issueComment.getDependentIssue().getNumber(), informationBuilder));
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
@@ -599,10 +598,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getProjectId() > 0) {
|
||||
start.setText(issueComment.getUser().getLogin() + " added this to a project " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineProjectAdded, issueComment.getUser().getLogin(), informationBuilder));
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getUser().getLogin() + " removed this from a project " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineProjectRemoved, issueComment.getUser().getLogin(), informationBuilder));
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
@@ -616,13 +615,14 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getType().equalsIgnoreCase("added_deadline")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " added the due date " + issueComment.getBody() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineDueDateAdded, issueComment.getUser().getLogin(), issueComment.getBody(), informationBuilder));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("modified_deadline")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " modified the due date to " + issueComment.getBody().split("\\|")[0] + " from " + issueComment.getBody().split("\\|")[1] + " " + informationBuilder);
|
||||
start.setText(
|
||||
context.getString(R.string.timelineDueDateModified, issueComment.getUser().getLogin(), issueComment.getBody().split("\\|")[0], issueComment.getBody().split("\\|")[1], informationBuilder));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("removed_deadline")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " removed the due date " + issueComment.getBody() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineDueDateRemoved, issueComment.getUser().getLogin(), issueComment.getBody(), informationBuilder));
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
@@ -636,10 +636,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getType().equalsIgnoreCase("change_target_branch")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " changed target branch from " + issueComment.getOldRef() + " to " + issueComment.getNewRef() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineBranchChanged, issueComment.getUser().getLogin(), issueComment.getOldRef(), issueComment.getNewRef(), informationBuilder));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("delete_branch")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " deleted branch " + issueComment.getOldRef() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineBranchDeleted, issueComment.getUser().getLogin(), issueComment.getOldRef(), informationBuilder));
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
@@ -654,13 +654,13 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getType().equalsIgnoreCase("start_tracking")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " started working " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineTimeTrackingStart, issueComment.getUser().getLogin(), informationBuilder));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("stop_tracking")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " stopped time tracking " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineTimeTrackingStop, issueComment.getUser().getLogin(), informationBuilder));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("cancel_tracking")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " cancelled time tracking " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineTimeTrackingCancel, issueComment.getUser().getLogin(), informationBuilder));
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
@@ -675,18 +675,16 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getType().equalsIgnoreCase("change_issue_ref")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " added reference " + issueComment.getNewRef() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineChangeIssueRef, issueComment.getUser().getLogin(), issueComment.getNewRef(), informationBuilder));
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_branch));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("comment_ref") || issueComment.getType().equalsIgnoreCase("issue_ref") || issueComment.getType().equalsIgnoreCase("pull_ref")) {
|
||||
|
||||
if(issue.getIssueType().equalsIgnoreCase("Issue")) {
|
||||
start.setText(
|
||||
issueComment.getUser().getLogin() + " referenced this issue in " + context.getResources().getString(R.string.hash) + issueComment.getRefIssue().getNumber() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineRefIssue, issueComment.getUser().getLogin(), issueComment.getRefIssue().getNumber(), informationBuilder));
|
||||
}
|
||||
else if(issue.getIssueType().equalsIgnoreCase("Pull")) {
|
||||
start.setText(
|
||||
issueComment.getUser().getLogin() + " referenced this pull request in " + context.getResources().getString(R.string.hash) + issueComment.getRefIssue().getNumber() + " " + informationBuilder);
|
||||
start.setText(context.getString(R.string.timelineRefPr, issueComment.getUser().getLogin(), issueComment.getRefIssue().getNumber(), informationBuilder));
|
||||
}
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_bookmark));
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.core.text.HtmlCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@@ -117,6 +118,7 @@ public class IssuesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
private final LinearLayout frameLabels;
|
||||
private final HorizontalScrollView labelsScrollViewDots;
|
||||
private final LinearLayout frameLabelsDots;
|
||||
private final ImageView commentIcon;
|
||||
private Issue issueObject;
|
||||
|
||||
IssuesHolder(View itemView) {
|
||||
@@ -130,6 +132,7 @@ public class IssuesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
frameLabels = itemView.findViewById(R.id.frameLabels);
|
||||
labelsScrollViewDots = itemView.findViewById(R.id.labelsScrollViewDots);
|
||||
frameLabelsDots = itemView.findViewById(R.id.frameLabelsDots);
|
||||
commentIcon = itemView.findViewById(R.id.comment_icon);
|
||||
|
||||
new Handler().postDelayed(() -> {
|
||||
if(!AppUtil.checkGhostUsers(issueObject.getUser().getLogin())) {
|
||||
@@ -228,6 +231,11 @@ public class IssuesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
}
|
||||
}
|
||||
|
||||
if(issue.getComments() > 15) {
|
||||
commentIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_flame));
|
||||
commentIcon.setColorFilter(context.getResources().getColor(R.color.releasePre, null));
|
||||
}
|
||||
|
||||
switch(timeFormat) {
|
||||
case "pretty": {
|
||||
PrettyTime prettyTime = new PrettyTime(locale);
|
||||
|
||||
@@ -15,6 +15,7 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.core.text.HtmlCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@@ -109,6 +110,7 @@ public class PullRequestsAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
||||
private final LinearLayout frameLabels;
|
||||
private final HorizontalScrollView labelsScrollViewDots;
|
||||
private final LinearLayout frameLabelsDots;
|
||||
private final ImageView commentIcon;
|
||||
private PullRequest pullRequestObject;
|
||||
|
||||
PullRequestsHolder(View itemView) {
|
||||
@@ -122,6 +124,7 @@ public class PullRequestsAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
||||
frameLabels = itemView.findViewById(R.id.frameLabels);
|
||||
labelsScrollViewDots = itemView.findViewById(R.id.labelsScrollViewDots);
|
||||
frameLabelsDots = itemView.findViewById(R.id.frameLabelsDots);
|
||||
commentIcon = itemView.findViewById(R.id.comment_icon);
|
||||
|
||||
View.OnClickListener openPr = v -> {
|
||||
Intent intentPrDetail = new IssueContext(pullRequestObject, ((RepoDetailActivity) context).repository).getIntent(context, IssueDetailActivity.class);
|
||||
@@ -225,6 +228,11 @@ public class PullRequestsAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
||||
this.prCommentsCount.setText(String.valueOf(pullRequest.getComments()));
|
||||
this.prCreatedTime.setText(TimeHelper.formatTime(pullRequest.getCreatedAt(), locale, timeFormat, context));
|
||||
|
||||
if(pullRequest.getComments() > 15) {
|
||||
commentIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_flame));
|
||||
commentIcon.setColorFilter(context.getResources().getColor(R.color.releasePre, null));
|
||||
}
|
||||
|
||||
if(timeFormat.equals("pretty")) {
|
||||
this.prCreatedTime.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(pullRequest.getCreatedAt()), context));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M8.5,14.5A2.5,2.5 0,0 0,11 12c0,-1.38 -0.5,-2 -1,-3 -1.072,-2.143 -0.224,-4.054 2,-6 0.5,2.5 2,4.9 4,6.5 2,1.6 3,3.5 3,5.5a7,7 0,1 1,-14 0c0,-1.153 0.433,-2.294 1,-3a2.5,2.5 0,0 0,2.5 2.5z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
||||
@@ -310,7 +310,7 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="@dimen/dimen72dp" />
|
||||
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/dimen4dp"
|
||||
android:paddingBottom="@dimen/dimen4dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/comment_view"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen4dp"
|
||||
android:layout_marginBottom="@dimen/dimen4dp"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
|
||||
<LinearLayout
|
||||
@@ -112,16 +112,17 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/timeline_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen4dp"
|
||||
android:layout_marginBottom="@dimen/dimen4dp"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="@dimen/dimen24dp"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:backgroundTint="?attr/materialCardBackgroundColor"
|
||||
app:cardCornerRadius="@dimen/dimen12dp"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
@@ -139,11 +140,11 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/timeline_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dimen4dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/dimen6dp"
|
||||
android:layout_marginEnd="@dimen/dimen4dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -61,14 +61,14 @@
|
||||
android:text="@string/newIssueTitle"
|
||||
android:textAlignment="gravity"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:textSize="@dimen/dimen16sp"
|
||||
tools:text="Id illum odio repellat omnis fuga deserunt aut. Ut est aut similique qui incidunt quia et." />
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/labelsScrollViewDots"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:fillViewport="true"
|
||||
android:foregroundGravity="right"
|
||||
android:scrollbarThumbHorizontal="@android:color/transparent"
|
||||
@@ -78,7 +78,7 @@
|
||||
android:id="@+id/frameLabelsDots"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
</HorizontalScrollView>
|
||||
@@ -91,7 +91,7 @@
|
||||
android:id="@+id/labelsScrollViewWithText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:fillViewport="true"
|
||||
android:foregroundGravity="right"
|
||||
android:scrollbarThumbHorizontal="@android:color/transparent"
|
||||
@@ -101,7 +101,7 @@
|
||||
android:id="@+id/frameLabels"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
</HorizontalScrollView>
|
||||
@@ -119,7 +119,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start"
|
||||
android:textColor="?attr/hintColor"
|
||||
android:textSize="12sp"
|
||||
android:textSize="@dimen/dimen12sp"
|
||||
tools:text="10.01.2020" />
|
||||
|
||||
<LinearLayout
|
||||
@@ -127,20 +127,21 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginStart="@dimen/dimen10dp"
|
||||
android:layout_marginEnd="@dimen/dimen6dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingLeft="@dimen/dimen4dp"
|
||||
android:paddingRight="@dimen/dimen4dp"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:id="@+id/comment_icon"
|
||||
android:layout_width="@dimen/dimen16dp"
|
||||
android:layout_height="@dimen/dimen16dp"
|
||||
android:layout_marginStart="@dimen/dimen2dp"
|
||||
android:layout_marginEnd="@dimen/dimen4dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_comment"
|
||||
app:tint="?attr/iconsColor" />
|
||||
@@ -152,7 +153,7 @@
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/repoStars"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp"
|
||||
android:textSize="@dimen/dimen14sp"
|
||||
tools:text="50" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -61,13 +61,13 @@
|
||||
android:text="@string/newIssueTitle"
|
||||
android:textAlignment="gravity"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/labelsScrollViewDots"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:fillViewport="true"
|
||||
android:foregroundGravity="right"
|
||||
android:scrollbarThumbHorizontal="@android:color/transparent">
|
||||
@@ -76,7 +76,7 @@
|
||||
android:id="@+id/frameLabelsDots"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
</HorizontalScrollView>
|
||||
@@ -89,7 +89,7 @@
|
||||
android:id="@+id/labelsScrollViewWithText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"
|
||||
android:fillViewport="true"
|
||||
android:foregroundGravity="right"
|
||||
android:scrollbarThumbHorizontal="@android:color/transparent"
|
||||
@@ -99,7 +99,7 @@
|
||||
android:id="@+id/frameLabels"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
</HorizontalScrollView>
|
||||
@@ -117,27 +117,28 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start"
|
||||
android:textColor="?attr/hintColor"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="@dimen/dimen12sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/frameCommentsCount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginStart="@dimen/dimen10dp"
|
||||
android:layout_marginEnd="@dimen/dimen6dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingLeft="@dimen/dimen4dp"
|
||||
android:paddingRight="@dimen/dimen4dp"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:id="@+id/comment_icon"
|
||||
android:layout_width="@dimen/dimen16dp"
|
||||
android:layout_height="@dimen/dimen16dp"
|
||||
android:layout_marginStart="@dimen/dimen2dp"
|
||||
android:layout_marginEnd="@dimen/dimen4dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_comment"
|
||||
app:tint="?attr/iconsColor" />
|
||||
@@ -149,7 +150,7 @@
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/repoStars"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="@dimen/dimen14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -790,4 +790,42 @@
|
||||
<string name="sourcePosition" translatable="false">%1$d:%2$d</string>
|
||||
<string name="codeEditor" translatable="false">Code Editor</string>
|
||||
<string name="openInCodeEditor">Open in Code Editor</string>
|
||||
|
||||
<!-- timeline -->
|
||||
<string name="timelineAddedLabelStart">%s added the\u0020</string>
|
||||
<string name="timelineRemovedLabelStart">%s removed the\u0020</string>
|
||||
<string name="timelineLabelEnd">\u0020label %s</string>
|
||||
<string name="timelineAddedCommit">%s added commit %s</string>
|
||||
<string name="timelineAssigneesRemoved">%s removed their assignment %s</string>
|
||||
<string name="timelineAssigneesUnassigned">%s was unassigned by %s %s</string>
|
||||
<string name="timelineAssigneesSelfAssigned">%s self-assigned this %s</string>
|
||||
<string name="timelineAssigneesAssigned">%s was assigned by %s %s</string>
|
||||
<string name="timelineMilestoneAdded">%s added this to the %s milestone %s</string>
|
||||
<string name="timelineMilestoneRemoved">%s removed this from the %s milestone %s</string>
|
||||
<string name="timelineStatusClosedIssue">%s closed this issue %s</string>
|
||||
<string name="timelineStatusReopenedIssue">%s reopened this issue %s</string>
|
||||
<string name="timelineStatusRefIssue">%s referenced this issue from a commit %s %s</string>
|
||||
<string name="timelineStatusClosedPr">%s closed this pull request %s</string>
|
||||
<string name="timelineStatusMergedPr">%s merged this pull request %s</string>
|
||||
<string name="timelineStatusRefPr">%s referenced this issue from a commit %s %s</string>
|
||||
<string name="timelineStatusReopenedPr">%s reopened this pull request %s</string>
|
||||
<string name="timelineReviewRequest">%s requested review from %s %s</string>
|
||||
<string name="timelineChangeTitle">%s changed title from %s to %s %s</string>
|
||||
<string name="timelineLocked">%s locked as %s and limited conversation to collaborators %s</string>
|
||||
<string name="timelineUnlocked">%s unlocked this conversation %s</string>
|
||||
<string name="timelineDependencyAdded">%s added a new dependency #%d %s</string>
|
||||
<string name="timelineDependencyRemoved">%s removed a dependency #%d %s</string>
|
||||
<string name="timelineProjectAdded">%s added this to a project %s</string>
|
||||
<string name="timelineProjectRemoved">%s removed this from a project %s</string>
|
||||
<string name="timelineDueDateAdded">%s added the due date %s %s</string>
|
||||
<string name="timelineDueDateModified">%s modified the due date to %s from %s %s</string>
|
||||
<string name="timelineDueDateRemoved">%s removed the due date %s %s</string>
|
||||
<string name="timelineBranchChanged">%s changed target branch from %s to %s %s</string>
|
||||
<string name="timelineBranchDeleted">%s deleted branch %s %s</string>
|
||||
<string name="timelineTimeTrackingStart">%s started working %s</string>
|
||||
<string name="timelineTimeTrackingStop">%s stopped time tracking %s</string>
|
||||
<string name="timelineTimeTrackingCancel">%s cancelled time tracking %s</string>
|
||||
<string name="timelineChangeIssueRef">%s added reference %s %s</string>
|
||||
<string name="timelineRefIssue">%s referenced this issue in #%d %s</string>
|
||||
<string name="timelineRefPr">%s referenced this pull request in #%d %s</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user