mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2023-12-13 20:50:18 +01:00
Add pagination to comments and some UI updates + refactors
This commit is contained in:
parent
2b225cd7ed
commit
d6a7283e3f
|
@ -124,6 +124,7 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
|||
}
|
||||
}
|
||||
});
|
||||
private int page = 1;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -164,10 +165,11 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
|||
|
||||
viewBinding.pullToRefresh.setOnRefreshListener(() -> new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
|
||||
page = 1;
|
||||
viewBinding.pullToRefresh.setRefreshing(false);
|
||||
issueCommentsModel.loadIssueComments(repoOwner, repoName, issueIndex, ctx);
|
||||
issueCommentsModel.loadIssueComments(repoOwner, repoName, issueIndex, ctx, null);
|
||||
|
||||
}, 500));
|
||||
}, 50));
|
||||
|
||||
Typeface myTypeface = AppUtil.getTypeface(this);
|
||||
viewBinding.toolbarTitle.setTypeface(myTypeface);
|
||||
|
@ -459,7 +461,7 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
|||
|
||||
viewBinding.scrollViewComments.post(() -> {
|
||||
|
||||
issueCommentsModel.loadIssueComments(repoOwner, repoName, issueIndex, ctx);
|
||||
issueCommentsModel.loadIssueComments(repoOwner, repoName, issueIndex, ctx, null);
|
||||
commentEdited = false;
|
||||
});
|
||||
}
|
||||
|
@ -488,9 +490,26 @@ public class IssueDetailActivity extends BaseActivity implements LabelsListAdapt
|
|||
bundle.putInt("issueNumber", issueIndex);
|
||||
|
||||
adapter = new IssueCommentsAdapter(ctx, bundle, issueCommentsMain, getSupportFragmentManager(), this::onResume, issue);
|
||||
adapter.setLoadMoreListener(new IssueCommentsAdapter.OnLoadMoreListener() {
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
|
||||
page += 1;
|
||||
issueCommentsModel.loadMoreIssueComments(owner, repo, index, ctx, page, adapter);
|
||||
viewBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFinished() {
|
||||
|
||||
viewBinding.progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
adapter.notifyDataChanged();
|
||||
viewBinding.recyclerView.setAdapter(adapter);
|
||||
|
||||
viewBinding.progressBar.setVisibility(View.GONE);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -54,16 +54,18 @@ import retrofit2.Callback;
|
|||
* @author M M Arif
|
||||
*/
|
||||
|
||||
public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdapter.IssueCommentViewHolder> {
|
||||
public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
private final Context context;
|
||||
private final TinyDB tinyDB;
|
||||
private final Bundle bundle;
|
||||
private final List<TimelineComment> issuesComments;
|
||||
private final FragmentManager fragmentManager;
|
||||
private final Runnable onInteractedListener;
|
||||
private final Locale locale;
|
||||
private final IssueContext issue;
|
||||
private List<TimelineComment> issuesComments;
|
||||
private OnLoadMoreListener loadMoreListener;
|
||||
private boolean isLoading = false, isMoreDataAvailable = true;
|
||||
|
||||
public IssueCommentsAdapter(Context ctx, Bundle bundle, List<TimelineComment> issuesCommentsMain, FragmentManager fragmentManager, Runnable onInteractedListener, IssueContext issue) {
|
||||
|
||||
|
@ -88,7 +90,7 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
|
|||
|
||||
Call<Void> call = RetrofitClient.getApiInterface(ctx).issueDeleteComment(issue.getRepository().getOwner(), issue.getRepository().getName(), (long) commentId);
|
||||
|
||||
call.enqueue(new Callback<Void>() {
|
||||
call.enqueue(new Callback<>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<Void> call, @NonNull retrofit2.Response<Void> response) {
|
||||
|
@ -129,280 +131,47 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
|
|||
|
||||
@NonNull
|
||||
@Override
|
||||
public IssueCommentsAdapter.IssueCommentViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_issue_comments, parent, false);
|
||||
return new IssueCommentsAdapter.IssueCommentViewHolder(v);
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
LayoutInflater inflater = LayoutInflater.from(context);
|
||||
return new IssueCommentViewHolder(inflater.inflate(R.layout.list_issue_comments, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull IssueCommentsAdapter.IssueCommentViewHolder holder, int position) {
|
||||
|
||||
String timeFormat = tinyDB.getString("dateFormat", "pretty");
|
||||
TimelineComment issueComment = issuesComments.get(position);
|
||||
int imgRadius = AppUtil.getPixelsFromDensity(context, 3);
|
||||
|
||||
holder.userLoginId = issueComment.getUser().getLogin();
|
||||
|
||||
holder.issueComment = issueComment;
|
||||
|
||||
StringBuilder informationBuilder = null;
|
||||
if(issueComment.getCreatedAt() != null) {
|
||||
|
||||
if(timeFormat.equals("pretty")) {
|
||||
informationBuilder = new StringBuilder(TimeHelper.formatTime(issueComment.getCreatedAt(), locale, "pretty", context));
|
||||
holder.information.setOnClickListener(v -> TimeHelper.customDateFormatForToastDateFormat(issueComment.getCreatedAt()));
|
||||
}
|
||||
else if(timeFormat.equals("normal")) {
|
||||
informationBuilder = new StringBuilder(TimeHelper.formatTime(issueComment.getCreatedAt(), locale, "normal", context));
|
||||
}
|
||||
|
||||
if(!issueComment.getCreatedAt().equals(issueComment.getUpdatedAt())) {
|
||||
if(informationBuilder != null) {
|
||||
informationBuilder.append(context.getString(R.string.colorfulBulletSpan)).append(context.getString(R.string.modifiedText));
|
||||
}
|
||||
}
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if(position >= getItemCount() - 1 && isMoreDataAvailable && !isLoading && loadMoreListener != null) {
|
||||
isLoading = true;
|
||||
loadMoreListener.onLoadMore();
|
||||
}
|
||||
|
||||
// label view in timeline
|
||||
if(issueComment.getType().equalsIgnoreCase("label")) {
|
||||
((IssueCommentsAdapter.IssueCommentViewHolder) holder).bindData(issuesComments.get(position));
|
||||
}
|
||||
|
||||
holder.labelView.setVisibility(View.VISIBLE);
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
public void notifyDataChanged() {
|
||||
notifyDataSetChanged();
|
||||
isLoading = false;
|
||||
loadMoreListener.onLoadFinished();
|
||||
}
|
||||
|
||||
int color = Color.parseColor("#" + issueComment.getLabel().getColor());
|
||||
|
||||
ImageView labelsView = new ImageView(context);
|
||||
|
||||
int height = AppUtil.getPixelsFromDensity(context, 20);
|
||||
int textSize = AppUtil.getPixelsFromScaledDensity(context, 12);
|
||||
|
||||
TextDrawable drawable = TextDrawable.builder().beginConfig().useFont(Typeface.DEFAULT).textColor(new ColorInverter().getContrastColor(color)).fontSize(textSize)
|
||||
.width(LabelWidthCalculator.calculateLabelWidth(issueComment.getLabel().getName(), Typeface.DEFAULT, textSize, AppUtil.getPixelsFromDensity(context, 10))).height(height).endConfig()
|
||||
.buildRoundRect(issueComment.getLabel().getName(), color, AppUtil.getPixelsFromDensity(context, 18));
|
||||
|
||||
labelsView.setImageDrawable(drawable);
|
||||
|
||||
TextView start = new TextView(context);
|
||||
TextView end = new TextView(context);
|
||||
|
||||
if(issueComment.getBody().equals("")){
|
||||
start.setText(issueComment.getUser().getLogin() + " removed the ");
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getUser().getLogin() + " added the ");
|
||||
}
|
||||
end.setText(" label " + informationBuilder);
|
||||
end.setTextSize(12);
|
||||
start.setTextSize(12);
|
||||
|
||||
holder.labelData.addView(start);
|
||||
holder.labelData.addView(labelsView);
|
||||
holder.labelData.addView(end);
|
||||
}
|
||||
else {
|
||||
holder.labelView.setVisibility(View.GONE);
|
||||
public void setMoreDataAvailable(boolean moreDataAvailable) {
|
||||
isMoreDataAvailable = moreDataAvailable;
|
||||
if(!isMoreDataAvailable) {
|
||||
loadMoreListener.onLoadFinished();
|
||||
}
|
||||
}
|
||||
|
||||
// pull/push/commit data view in timeline
|
||||
if(issueComment.getType().equalsIgnoreCase("pull_push")) {
|
||||
public void setLoadMoreListener(OnLoadMoreListener loadMoreListener) {
|
||||
this.loadMoreListener = loadMoreListener;
|
||||
}
|
||||
|
||||
holder.commitView.setVisibility(View.VISIBLE);
|
||||
public void updateList(List<TimelineComment> list) {
|
||||
issuesComments = list;
|
||||
notifyDataChanged();
|
||||
}
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
start.setText(issueComment.getUser().getLogin() + " added commit " + informationBuilder);
|
||||
start.setTextSize(12);
|
||||
|
||||
holder.commitData.addView(start);
|
||||
}
|
||||
else {
|
||||
holder.commitView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// assignees data view in timeline
|
||||
if(issueComment.getType().equalsIgnoreCase("assignees")) {
|
||||
|
||||
holder.assigneesView.setVisibility(View.VISIBLE);
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getUser().getLogin().equalsIgnoreCase(issueComment.getAssignee().getLogin())) {
|
||||
start.setText(issueComment.getUser().getLogin() + " self-assigned this " + informationBuilder);
|
||||
}
|
||||
else if(issueComment.isRemovedAssignee()) {
|
||||
|
||||
if(issueComment.getUser().getLogin().equalsIgnoreCase(issueComment.getAssignee().getLogin())) {
|
||||
start.setText(issueComment.getUser().getLogin() + " removed their assignment " + informationBuilder);
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getAssignee().getLogin() + " was unassigned by " + issueComment.getUser().getLogin() + " " + informationBuilder);
|
||||
}
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getAssignee().getLogin() + " was assigned by " + issueComment.getUser().getLogin() + " " + informationBuilder);
|
||||
}
|
||||
|
||||
|
||||
start.setTextSize(12);
|
||||
|
||||
holder.assigneesData.addView(start);
|
||||
}
|
||||
else {
|
||||
holder.assigneesView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// milestone data view in timeline
|
||||
if(issueComment.getType().equalsIgnoreCase("milestone")) {
|
||||
|
||||
holder.milestoneView.setVisibility(View.VISIBLE);
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getMilestone() != null) {
|
||||
start.setText(issueComment.getUser().getLogin() + " added this to the " + issueComment.getMilestone().getTitle() + " milestone " + informationBuilder);
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getUser().getLogin() + " removed this from the " + issueComment.getOldMilestone().getTitle() + " milestone " + informationBuilder);
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
holder.milestoneData.addView(start);
|
||||
}
|
||||
else {
|
||||
holder.milestoneView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// status view in timeline
|
||||
if(issueComment.getType().equalsIgnoreCase("close") || issueComment.getType().equalsIgnoreCase("reopen") || issueComment.getType().equalsIgnoreCase("merge_pull") || issueComment.getType().equalsIgnoreCase("commit_ref")) {
|
||||
|
||||
holder.statusView.setVisibility(View.VISIBLE);
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issue.getIssueType().equalsIgnoreCase("Issue")) {
|
||||
if(issueComment.getType().equals("close")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " closed this issue " + informationBuilder);
|
||||
holder.statusIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("reopen")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " reopened this issue " + informationBuilder);
|
||||
}
|
||||
}
|
||||
else if(issue.getIssueType().equalsIgnoreCase("Pull")) {
|
||||
if(issueComment.getType().equalsIgnoreCase("close")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " closed this pull request " + informationBuilder);
|
||||
holder.statusIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_pull_request));
|
||||
holder.statusIcon.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);
|
||||
holder.statusIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_pull_request));
|
||||
holder.statusIcon.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);
|
||||
holder.statusIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_bookmark));
|
||||
}
|
||||
else {
|
||||
start.setText(issue.getIssueType() + " reopened this pull request " + informationBuilder);
|
||||
holder.statusIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_pull_request));
|
||||
}
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
holder.statusData.addView(start);
|
||||
}
|
||||
else {
|
||||
holder.statusView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// review data view in timeline
|
||||
if(issueComment.getType().equalsIgnoreCase("review") || issueComment.getType().equalsIgnoreCase("review_request")) {
|
||||
|
||||
holder.reviewView.setVisibility(View.VISIBLE);
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
/*if(issueComment.getType().equalsIgnoreCase("review")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " approved these changes " + informationBuilder);
|
||||
}
|
||||
else*/ if(issueComment.getType().equalsIgnoreCase("review_request")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " requested review from " + issueComment.getAssignee().getLogin() + " " + informationBuilder);
|
||||
holder.reviewIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_unwatch));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
holder.reviewData.addView(start);
|
||||
}
|
||||
else {
|
||||
holder.reviewView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// change title data view in timeline
|
||||
if(issueComment.getType().equalsIgnoreCase("change_title")) {
|
||||
|
||||
holder.changeTitleView.setVisibility(View.VISIBLE);
|
||||
|
||||
TextView start = new TextView(context);
|
||||
start.setText(issueComment.getUser().getLogin() + " changed title from " + issueComment.getOldTitle() + " to " + issueComment.getNewTitle() + " " + informationBuilder);
|
||||
start.setTextSize(12);
|
||||
|
||||
holder.changeTitleData.addView(start);
|
||||
}
|
||||
else {
|
||||
holder.changeTitleView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// lock/unlock data view in timeline
|
||||
if(issueComment.getType().equalsIgnoreCase("lock") || issueComment.getType().equalsIgnoreCase("unlock")) {
|
||||
|
||||
holder.lockView.setVisibility(View.VISIBLE);
|
||||
|
||||
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);
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("unlock")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " unlocked this conversation " + informationBuilder);
|
||||
holder.lockIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_key));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
holder.lockData.addView(start);
|
||||
}
|
||||
else {
|
||||
holder.lockView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// comment data view in timeline
|
||||
if(issueComment.getType().equalsIgnoreCase("comment")) {
|
||||
|
||||
holder.author.setText(issueComment.getUser().getLogin());
|
||||
|
||||
PicassoService.getInstance(context).get().load(issueComment.getUser().getAvatarUrl()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(imgRadius, 0))
|
||||
.resize(AppUtil.getPixelsFromDensity(context, 35), AppUtil.getPixelsFromDensity(context, 35)).centerCrop().into(holder.avatar);
|
||||
|
||||
Markdown.render(context, EmojiParser.parseToUnicode(issueComment.getBody()), holder.comment, issue.getRepository());
|
||||
|
||||
holder.information.setText(informationBuilder);
|
||||
|
||||
Bundle bundle1 = new Bundle();
|
||||
bundle1.putAll(bundle);
|
||||
bundle1.putInt("commentId", Math.toIntExact(issueComment.getId()));
|
||||
|
||||
ReactionList reactionList = new ReactionList(context, bundle1);
|
||||
|
||||
holder.commentReactionBadges.addView(reactionList);
|
||||
reactionList.setOnReactionAddedListener(() -> {
|
||||
|
||||
if(holder.commentReactionBadges.getVisibility() != View.VISIBLE) {
|
||||
holder.commentReactionBadges.post(() -> holder.commentReactionBadges.setVisibility(View.VISIBLE));
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
holder.commentView.setVisibility(View.GONE);
|
||||
}
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -415,6 +184,14 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
|
|||
}
|
||||
}
|
||||
|
||||
public interface OnLoadMoreListener {
|
||||
|
||||
void onLoadMore();
|
||||
|
||||
void onLoadFinished();
|
||||
|
||||
}
|
||||
|
||||
class IssueCommentViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private final ImageView avatar;
|
||||
|
@ -422,38 +199,13 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
|
|||
private final TextView information;
|
||||
private final RecyclerView comment;
|
||||
private final LinearLayout commentReactionBadges;
|
||||
private final MaterialCardView commentView;
|
||||
private final LinearLayout timelineView;
|
||||
private final LinearLayout timelineData;
|
||||
private final ImageView timelineIcon;
|
||||
private String userLoginId;
|
||||
private TimelineComment issueComment;
|
||||
|
||||
private final MaterialCardView commentView;
|
||||
|
||||
private final LinearLayout labelView;
|
||||
private final LinearLayout labelData;
|
||||
|
||||
private final LinearLayout commitView;
|
||||
private final LinearLayout commitData;
|
||||
|
||||
private final LinearLayout assigneesView;
|
||||
private final LinearLayout assigneesData;
|
||||
|
||||
private final LinearLayout milestoneView;
|
||||
private final LinearLayout milestoneData;
|
||||
|
||||
private final LinearLayout statusView;
|
||||
private final LinearLayout statusData;
|
||||
private final ImageView statusIcon;
|
||||
|
||||
private final LinearLayout reviewView;
|
||||
private final LinearLayout reviewData;
|
||||
private final ImageView reviewIcon;
|
||||
|
||||
private final LinearLayout changeTitleView;
|
||||
private final LinearLayout changeTitleData;
|
||||
|
||||
private final LinearLayout lockView;
|
||||
private final LinearLayout lockData;
|
||||
private final ImageView lockIcon;
|
||||
|
||||
private IssueCommentViewHolder(View view) {
|
||||
|
||||
super(view);
|
||||
|
@ -467,32 +219,9 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
|
|||
|
||||
commentView = view.findViewById(R.id.comment_view);
|
||||
|
||||
labelView = view.findViewById(R.id.label_view);
|
||||
labelData = view.findViewById(R.id.label_data);
|
||||
|
||||
commitView = view.findViewById(R.id.commit_view);
|
||||
commitData = view.findViewById(R.id.commit_data);
|
||||
|
||||
assigneesView = view.findViewById(R.id.assignees_view);
|
||||
assigneesData = view.findViewById(R.id.assignees_data);
|
||||
|
||||
milestoneView = view.findViewById(R.id.milestone_view);
|
||||
milestoneData = view.findViewById(R.id.milestone_data);
|
||||
|
||||
statusView = view.findViewById(R.id.status_view);
|
||||
statusData = view.findViewById(R.id.status_data);
|
||||
statusIcon = view.findViewById(R.id.status_icon);
|
||||
|
||||
reviewView = view.findViewById(R.id.review_view);
|
||||
reviewData = view.findViewById(R.id.review_data);
|
||||
reviewIcon = view.findViewById(R.id.review_icon);
|
||||
|
||||
changeTitleView = view.findViewById(R.id.change_title_view);
|
||||
changeTitleData = view.findViewById(R.id.change_title_data);
|
||||
|
||||
lockView = view.findViewById(R.id.lock_unlock_view);
|
||||
lockData = view.findViewById(R.id.lock_unlock_data);
|
||||
lockIcon = view.findViewById(R.id.lock_unlock_icon);
|
||||
timelineView = view.findViewById(R.id.timeline_view);
|
||||
timelineData = view.findViewById(R.id.timeline_data);
|
||||
timelineIcon = view.findViewById(R.id.timeline_icon);
|
||||
|
||||
menu.setOnClickListener(v -> {
|
||||
|
||||
|
@ -640,6 +369,374 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
|
|||
}, 500);
|
||||
}
|
||||
|
||||
void bindData(TimelineComment timelineComment) {
|
||||
|
||||
String timeFormat = tinyDB.getString("dateFormat", "pretty");
|
||||
int imgRadius = AppUtil.getPixelsFromDensity(context, 3);
|
||||
|
||||
userLoginId = timelineComment.getUser().getLogin();
|
||||
|
||||
this.issueComment = timelineComment;
|
||||
|
||||
StringBuilder informationBuilder = null;
|
||||
if(issueComment.getCreatedAt() != null) {
|
||||
|
||||
if(timeFormat.equals("pretty")) {
|
||||
informationBuilder = new StringBuilder(TimeHelper.formatTime(issueComment.getCreatedAt(), locale, "pretty", context));
|
||||
information.setOnClickListener(v -> TimeHelper.customDateFormatForToastDateFormat(issueComment.getCreatedAt()));
|
||||
}
|
||||
else if(timeFormat.equals("normal")) {
|
||||
informationBuilder = new StringBuilder(TimeHelper.formatTime(issueComment.getCreatedAt(), locale, "normal", context));
|
||||
}
|
||||
|
||||
if(!issueComment.getCreatedAt().equals(issueComment.getUpdatedAt())) {
|
||||
if(informationBuilder != null) {
|
||||
informationBuilder.append(context.getString(R.string.colorfulBulletSpan)).append(context.getString(R.string.modifiedText));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// label view in timeline
|
||||
if(issueComment.getType().equalsIgnoreCase("label")) {
|
||||
|
||||
ImageView labelsView = new ImageView(context);
|
||||
int color = Color.parseColor("#" + issueComment.getLabel().getColor());
|
||||
int height = AppUtil.getPixelsFromDensity(context, 20);
|
||||
int textSize = AppUtil.getPixelsFromScaledDensity(context, 12);
|
||||
|
||||
TextDrawable drawable = TextDrawable.builder().beginConfig().useFont(Typeface.DEFAULT).textColor(new ColorInverter().getContrastColor(color)).fontSize(textSize)
|
||||
.width(LabelWidthCalculator.calculateLabelWidth(issueComment.getLabel().getName(), Typeface.DEFAULT, textSize, AppUtil.getPixelsFromDensity(context, 10))).height(height).endConfig()
|
||||
.buildRoundRect(issueComment.getLabel().getName(), color, AppUtil.getPixelsFromDensity(context, 18));
|
||||
|
||||
labelsView.setImageDrawable(drawable);
|
||||
|
||||
TextView start = new TextView(context);
|
||||
TextView end = new TextView(context);
|
||||
|
||||
if(issueComment.getBody().equals("")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " removed the ");
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getUser().getLogin() + " added the ");
|
||||
}
|
||||
end.setText(" label " + informationBuilder);
|
||||
end.setTextSize(12);
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_tag));
|
||||
timelineData.addView(start);
|
||||
timelineData.addView(labelsView);
|
||||
timelineData.addView(end);
|
||||
}
|
||||
// pull/push/commit data view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("pull_push")) {
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
start.setText(issueComment.getUser().getLogin() + " added commit " + informationBuilder);
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_person));
|
||||
timelineData.addView(start);
|
||||
}
|
||||
// assignees data view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("assignees")) {
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.isRemovedAssignee()) {
|
||||
|
||||
if(issueComment.getUser().getLogin().equalsIgnoreCase(issueComment.getAssignee().getLogin())) {
|
||||
start.setText(issueComment.getUser().getLogin() + " removed their assignment " + informationBuilder);
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getAssignee().getLogin() + " was unassigned by " + 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);
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getAssignee().getLogin() + " was assigned by " + issueComment.getUser().getLogin() + " " + informationBuilder);
|
||||
}
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_person));
|
||||
timelineData.addView(start);
|
||||
}
|
||||
// milestone data view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("milestone")) {
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getMilestone() != null) {
|
||||
start.setText(issueComment.getUser().getLogin() + " added this to the " + issueComment.getMilestone().getTitle() + " milestone " + informationBuilder);
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getUser().getLogin() + " removed this from the " + issueComment.getOldMilestone().getTitle() + " milestone " + informationBuilder);
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_milestone));
|
||||
timelineData.addView(start);
|
||||
}
|
||||
// status view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("close") || issueComment.getType().equalsIgnoreCase("reopen") || issueComment.getType().equalsIgnoreCase("merge_pull") || issueComment.getType()
|
||||
.equalsIgnoreCase("commit_ref")) {
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issue.getIssueType().equalsIgnoreCase("Issue")) {
|
||||
if(issueComment.getType().equals("close")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " closed this issue " + 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);
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("commit_ref")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " referenced this issue from a commit " + 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);
|
||||
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);
|
||||
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);
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_bookmark));
|
||||
}
|
||||
else {
|
||||
start.setText(issue.getIssueType() + " reopened this pull request " + informationBuilder);
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_pull_request));
|
||||
}
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineData.addView(start);
|
||||
}
|
||||
// review data view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("review_request") || issueComment.getType().equalsIgnoreCase("review") || issueComment.getType().equalsIgnoreCase("dismiss_review")) {
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getType().equalsIgnoreCase("review")) {
|
||||
timelineView.setVisibility(View.GONE);
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("dismiss_review")) {
|
||||
timelineView.setVisibility(View.GONE);
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("review_request")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " requested review from " + issueComment.getAssignee().getLogin() + " " + informationBuilder);
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_unwatch));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineData.addView(start);
|
||||
}
|
||||
// change title data view in timeline
|
||||
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.setTextSize(12);
|
||||
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_edit));
|
||||
timelineData.addView(start);
|
||||
}
|
||||
// lock/unlock data view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("lock") || issueComment.getType().equalsIgnoreCase("unlock")) {
|
||||
|
||||
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);
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_lock));
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("unlock")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " unlocked this conversation " + informationBuilder);
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_key));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineData.addView(start);
|
||||
}
|
||||
// dependency data view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("add_dependency") || issueComment.getType().equalsIgnoreCase("remove_dependency")) {
|
||||
|
||||
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);
|
||||
}
|
||||
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);
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_dependency));
|
||||
timelineData.addView(start);
|
||||
}
|
||||
// project data view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("project") || issueComment.getType().equalsIgnoreCase("project_board")) {
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getProjectId() > 0) {
|
||||
start.setText(issueComment.getUser().getLogin() + " added this to a project " + informationBuilder);
|
||||
}
|
||||
else {
|
||||
start.setText(issueComment.getUser().getLogin() + " removed this from a project " + informationBuilder);
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_kanban));
|
||||
timelineData.addView(start);
|
||||
}
|
||||
// due date/deadline data view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("added_deadline") || issueComment.getType().equalsIgnoreCase("modified_deadline") || issueComment.getType().equalsIgnoreCase("removed_deadline")) {
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getType().equalsIgnoreCase("added_deadline")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " added the due date " + 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);
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("removed_deadline")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " removed the due date " + issueComment.getBody() + " " + informationBuilder);
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_clock));
|
||||
timelineData.addView(start);
|
||||
}
|
||||
// branch data view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("change_target_branch") || issueComment.getType().equalsIgnoreCase("delete_branch")) {
|
||||
|
||||
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);
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("delete_branch")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " deleted branch " + issueComment.getOldRef() + " " + informationBuilder);
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_branch));
|
||||
timelineData.addView(start);
|
||||
}
|
||||
// time tracking data view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("start_tracking") || issueComment.getType().equalsIgnoreCase("stop_tracking") || issueComment.getType()
|
||||
.equalsIgnoreCase("cancel_tracking") || issueComment.getType().equalsIgnoreCase("add_time_manual") || issueComment.getType().equalsIgnoreCase("delete_time_manual")) {
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getType().equalsIgnoreCase("start_tracking")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " started working " + informationBuilder);
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("stop_tracking")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " stopped time tracking " + informationBuilder);
|
||||
}
|
||||
else if(issueComment.getType().equalsIgnoreCase("cancel_tracking")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " cancelled time tracking " + informationBuilder);
|
||||
timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_clock));
|
||||
timelineData.addView(start);
|
||||
}
|
||||
// issue/pr refs data view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("change_issue_ref") || issueComment.getType().equalsIgnoreCase("issue_ref") || issueComment.getType().equalsIgnoreCase("comment_ref") || issueComment.getType()
|
||||
.equalsIgnoreCase("pull_ref")) {
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if(issueComment.getType().equalsIgnoreCase("change_issue_ref")) {
|
||||
start.setText(issueComment.getUser().getLogin() + " added reference " + 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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
timelineIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_bookmark));
|
||||
}
|
||||
start.setTextSize(12);
|
||||
|
||||
timelineData.addView(start);
|
||||
}
|
||||
// code data view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("code")) {
|
||||
timelineView.setVisibility(View.GONE);
|
||||
}
|
||||
// schedule pr view in timeline
|
||||
else if(issueComment.getType().equalsIgnoreCase("pull_scheduled_merge") || issueComment.getType().equalsIgnoreCase("pull_cancel_scheduled_merge")) {
|
||||
timelineView.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
timelineView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// comment data view in timeline
|
||||
if(issueComment.getType().equalsIgnoreCase("comment")) {
|
||||
|
||||
author.setText(issueComment.getUser().getLogin());
|
||||
|
||||
PicassoService.getInstance(context).get().load(issueComment.getUser().getAvatarUrl()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(imgRadius, 0))
|
||||
.resize(AppUtil.getPixelsFromDensity(context, 35), AppUtil.getPixelsFromDensity(context, 35)).centerCrop().into(avatar);
|
||||
|
||||
Markdown.render(context, EmojiParser.parseToUnicode(issueComment.getBody()), comment, issue.getRepository());
|
||||
|
||||
information.setText(informationBuilder);
|
||||
|
||||
Bundle bundle1 = new Bundle();
|
||||
bundle1.putAll(bundle);
|
||||
bundle1.putInt("commentId", Math.toIntExact(issueComment.getId()));
|
||||
|
||||
ReactionList reactionList = new ReactionList(context, bundle1);
|
||||
|
||||
commentReactionBadges.addView(reactionList);
|
||||
reactionList.setOnReactionAddedListener(() -> {
|
||||
|
||||
if(commentReactionBadges.getVisibility() != View.VISIBLE) {
|
||||
commentReactionBadges.post(() -> commentReactionBadges.setVisibility(View.VISIBLE));
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
commentView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,13 +26,13 @@ import org.mian.gitnex.viewmodels.IssuesViewModel;
|
|||
|
||||
public class MyIssuesFragment extends Fragment {
|
||||
|
||||
public String state = "open";
|
||||
public boolean assignedToMe = false;
|
||||
private IssuesViewModel issuesViewModel;
|
||||
private FragmentIssuesBinding fragmentIssuesBinding;
|
||||
private ExploreIssuesAdapter adapter;
|
||||
private int page = 1;
|
||||
private Menu menu;
|
||||
public String state = "open";
|
||||
public boolean assignedToMe = false;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
@ -75,8 +75,6 @@ public class MyIssuesFragment extends Fragment {
|
|||
return fragmentIssuesBinding.getRoot();
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
private void fetchDataAsync(String query, String state, boolean assignedToMe) {
|
||||
|
||||
issuesViewModel.getIssuesList(query, "issues", true, state, assignedToMe, getContext()).observe(getViewLifecycleOwner(), issuesListMain -> {
|
||||
|
|
|
@ -7,7 +7,9 @@ import androidx.lifecycle.MutableLiveData;
|
|||
import androidx.lifecycle.ViewModel;
|
||||
import org.gitnex.tea4j.v2.models.TimelineComment;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.IssueCommentsAdapter;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.helpers.Constants;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import java.util.List;
|
||||
import retrofit2.Call;
|
||||
|
@ -21,22 +23,19 @@ import retrofit2.Response;
|
|||
public class IssueCommentsViewModel extends ViewModel {
|
||||
|
||||
private MutableLiveData<List<TimelineComment>> issueComments;
|
||||
private int resultLimit;
|
||||
|
||||
public LiveData<List<TimelineComment>> getIssueCommentList(String owner, String repo, int index, Context ctx) {
|
||||
|
||||
issueComments = new MutableLiveData<>();
|
||||
loadIssueComments(owner, repo, index, ctx);
|
||||
|
||||
return issueComments;
|
||||
}
|
||||
|
||||
public void loadIssueComments(String owner, String repo, int index, Context ctx) {
|
||||
resultLimit = Constants.getCurrentResultLimit(ctx);
|
||||
loadIssueComments(owner, repo, index, ctx, null);
|
||||
return issueComments;
|
||||
}
|
||||
|
||||
public void loadIssueComments(String owner, String repo, int index, Context ctx, Runnable onLoadingFinished) {
|
||||
|
||||
Call<List<TimelineComment>> call = RetrofitClient.getApiInterface(ctx).issueGetCommentsAndTimeline(owner, repo, (long) index, null, null, 25, null);
|
||||
Call<List<TimelineComment>> call = RetrofitClient.getApiInterface(ctx).issueGetCommentsAndTimeline(owner, repo, (long) index, null, 1, resultLimit, null);
|
||||
|
||||
call.enqueue(new Callback<>() {
|
||||
|
||||
|
@ -62,4 +61,39 @@ public class IssueCommentsViewModel extends ViewModel {
|
|||
});
|
||||
}
|
||||
|
||||
public void loadMoreIssueComments(String owner, String repo, int index, Context ctx, int page, IssueCommentsAdapter adapter) {
|
||||
|
||||
Call<List<TimelineComment>> call = RetrofitClient.getApiInterface(ctx).issueGetCommentsAndTimeline(owner, repo, (long) index, null, page, resultLimit, null);
|
||||
|
||||
call.enqueue(new Callback<>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<List<TimelineComment>> call, @NonNull Response<List<TimelineComment>> response) {
|
||||
|
||||
if(response.isSuccessful()) {
|
||||
|
||||
if(response.body() != null) {
|
||||
|
||||
List<TimelineComment> list = issueComments.getValue();
|
||||
assert list != null;
|
||||
assert response.body() != null;
|
||||
|
||||
list.addAll(response.body());
|
||||
}
|
||||
else {
|
||||
adapter.setMoreDataAvailable(false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Toasty.error(ctx, ctx.getString(R.string.genericError));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<List<TimelineComment>> call, @NonNull Throwable t) {
|
||||
Toasty.error(ctx, ctx.getString(R.string.genericServerResponseError));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,32 +3,46 @@
|
|||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M6,3L6,15"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"/>
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M18,6m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"/>
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M6,18m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"/>
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M18,9a9,9 0,0 1,-9 9"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"/>
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M7,18m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M7,6m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M17,6m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M7,8L7,16"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,18h6a2,2 0,0 0,2 -2v-5"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M14,14l3,-3l3,3"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
</vector>
|
||||
|
|
20
app/src/main/res/drawable/ic_clock.xml
Normal file
20
app/src/main/res/drawable/ic_clock.xml
Normal file
|
@ -0,0 +1,20 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M12,12m-9,0a9,9 0,1 1,18 0a9,9 0,1 1,-18 0"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M12,7l0,5l3,3"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
</vector>
|
41
app/src/main/res/drawable/ic_dependency.xml
Normal file
41
app/src/main/res/drawable/ic_dependency.xml
Normal file
|
@ -0,0 +1,41 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="m16,16 l2,2 4,-4"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M21,10V8a2,2 0,0 0,-1 -1.73l-7,-4a2,2 0,0 0,-2 0l-7,4A2,2 0,0 0,3 8v8a2,2 0,0 0,1 1.73l7,4a2,2 0,0 0,2 0l2,-1.14"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M16.5,9.4 L7.55,4.24"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M3.29,7l8.71,5l8.71,-5"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M12,22L12,12"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
</vector>
|
|
@ -3,16 +3,39 @@
|
|||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="?attr/iconsColor"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M12,21a1.75,1.75 0,1 1,0 -3.5,1.75 1.75,0 0,1 0,3.5zM8.75,19.25a3.25,3.25 0,1 0,6.5 0,3.25 3.25,0 0,0 -6.5,0zM5.75,6.5a1.75,1.75 0,1 1,0 -3.5,1.75 1.75,0 0,1 0,3.5zM2.5,4.75a3.25,3.25 0,1 0,6.5 0,3.25 3.25,0 0,0 -6.5,0zM18.25,6.5a1.75,1.75 0,1 1,0 -3.5,1.75 1.75,0 0,1 0,3.5zM15,4.75a3.25,3.25 0,1 0,6.5 0,3.25 3.25,0 0,0 -6.5,0z"/>
|
||||
<path
|
||||
android:fillColor="?attr/iconsColor"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M6.5,7.75v1A2.25,2.25 0,0 0,8.75 11h6.5a2.25,2.25 0,0 0,2.25 -2.25v-1H19v1a3.75,3.75 0,0 1,-3.75 3.75h-6.5A3.75,3.75 0,0 1,5 8.75v-1h1.5z"/>
|
||||
<path
|
||||
android:fillColor="?attr/iconsColor"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M11.25,16.25v-5h1.5v5h-1.5z"/>
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M12,18m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M7,6m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M17,6m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M7,8v2a2,2 0,0 0,2 2h6a2,2 0,0 0,2 -2v-2"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M12,12L12,16"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
</vector>
|
||||
|
|
20
app/src/main/res/drawable/ic_history.xml
Normal file
20
app/src/main/res/drawable/ic_history.xml
Normal file
|
@ -0,0 +1,20 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M12,8l0,4l2,2"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M3.05,11a9,9 0,1 1,0.5 4m-0.5,5v-5h5"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
</vector>
|
34
app/src/main/res/drawable/ic_kanban.xml
Normal file
34
app/src/main/res/drawable/ic_kanban.xml
Normal file
|
@ -0,0 +1,34 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M4,4L10,4"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M14,4L20,4"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M6,8L8,8A2,2 0,0 1,10 10L10,18A2,2 0,0 1,8 20L6,20A2,2 0,0 1,4 18L4,10A2,2 0,0 1,6 8z"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M16,8L18,8A2,2 0,0 1,20 10L20,12A2,2 0,0 1,18 14L16,14A2,2 0,0 1,14 12L14,10A2,2 0,0 1,16 8z"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
</vector>
|
|
@ -4,10 +4,10 @@
|
|||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M4,4v5h0.582m15.356,2A8.001,8.001 0,0 0,4.582 9m0,0H9m11,11v-5h-0.581m0,0a8.003,8.003 0,0 1,-15.357 -2m15.357,2H15"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M4,4v5h0.582m15.356,2A8.001,8.001 0,0 0,4.582 9m0,0H9m11,11v-5h-0.581m0,0a8.003,8.003 0,0 1,-15.357 -2m15.357,2H15"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"/>
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round" />
|
||||
</vector>
|
|
@ -1,27 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M23,4l0,6l-6,0"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"/>
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M1,20l0,-6l6,0"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"/>
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M3.51,9a9,9 0,0 1,14.85 -3.36L23,10M1,14l4.64,4.36A9,9 0,0 0,20.49 15"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="?attr/iconsColor"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"/>
|
||||
</vector>
|
|
@ -1,19 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:elevation="@dimen/dimen0dp"
|
||||
android:theme="@style/Widget.AppCompat.SearchView">
|
||||
android:theme="@style/Widget.AppCompat.SearchView"
|
||||
app:elevation="@dimen/dimen0dp">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
|
@ -25,20 +24,20 @@
|
|||
android:id="@+id/issuePrState"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_issue"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:paddingStart="@dimen/dimen0dp"
|
||||
android:paddingEnd="@dimen/dimen8dp"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/generalImgContentText"/>
|
||||
android:src="@drawable/ic_issue"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbar_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="@dimen/dimen20sp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:id="@+id/toolbar_title"/>
|
||||
android:textSize="@dimen/dimen20sp" />
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
|
||||
|
@ -46,31 +45,31 @@
|
|||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.Material3.LinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen56dp"
|
||||
android:indeterminate="true"
|
||||
style="@style/Widget.Material3.LinearProgressIndicator"
|
||||
app:indicatorColor="?attr/progressIndicatorColor"/>
|
||||
app:indicatorColor="?attr/progressIndicatorColor" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/addNewComment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dimen16dp"
|
||||
android:text="@string/commentButtonText"
|
||||
android:contentDescription="@string/commentButtonText"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:backgroundTint="?attr/fabColor"
|
||||
android:layout_gravity="bottom|end"
|
||||
app:iconTint="@color/colorWhite"
|
||||
app:icon="@drawable/ic_reply"/>
|
||||
android:layout_margin="@dimen/dimen16dp"
|
||||
android:backgroundTint="?attr/fabColor"
|
||||
android:contentDescription="@string/commentButtonText"
|
||||
android:text="@string/commentButtonText"
|
||||
android:textColor="@color/colorWhite"
|
||||
app:icon="@drawable/ic_reply"
|
||||
app:iconTint="@color/colorWhite" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/relativeMainLayoutFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="@dimen/dimen56dp"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dimen64dp">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/pullToRefresh"
|
||||
|
@ -78,30 +77,33 @@
|
|||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/scrollViewComments"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/scrollViewComments"
|
||||
android:fillViewport="true">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/relativeLayoutFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
android:paddingStart="@dimen/dimen8dp"
|
||||
android:paddingTop="@dimen/dimen2dp"
|
||||
android:paddingEnd="@dimen/dimen8dp"
|
||||
android:paddingBottom="@dimen/dimen8dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/mainThreadCard"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_marginBottom="@dimen/dimen4dp"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/materialCardBackgroundColor"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
|
@ -113,38 +115,38 @@
|
|||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/assigneeAvatarFrame"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="@dimen/dimen24dp"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
app:cardElevation="@dimen/dimen0dp"
|
||||
android:layout_marginEnd="@dimen/dimen12dp"
|
||||
app:cardCornerRadius="@dimen/dimen12dp">
|
||||
app:cardCornerRadius="@dimen/dimen12dp"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/assigneeAvatar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/generalImgContentText"/>
|
||||
android:contentDescription="@string/generalImgContentText" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueTitle"
|
||||
android:layout_toEndOf="@+id/assigneeAvatarFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@+id/assigneeAvatarFrame"
|
||||
android:gravity="start"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="@dimen/dimen16sp"/>
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/msdueFrame"
|
||||
android:layout_toEndOf="@+id/assigneeAvatarFrame"
|
||||
android:layout_below="@+id/issueTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/issueTitle"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:layout_toEndOf="@+id/assigneeAvatarFrame"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -159,8 +161,8 @@
|
|||
<ImageView
|
||||
android:layout_width="@dimen/dimen20dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_calendar"
|
||||
android:contentDescription="@string/generalImgContentText"/>
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_calendar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueDueDate"
|
||||
|
@ -169,7 +171,7 @@
|
|||
android:layout_marginStart="@dimen/dimen8dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen14sp"/>
|
||||
android:textSize="@dimen/dimen14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -185,8 +187,8 @@
|
|||
<ImageView
|
||||
android:layout_width="@dimen/dimen20dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_milestone"
|
||||
android:contentDescription="@string/generalImgContentText"/>
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_milestone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueMilestone"
|
||||
|
@ -195,92 +197,92 @@
|
|||
android:layout_marginStart="@dimen/dimen8dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen14sp"/>
|
||||
android:textSize="@dimen/dimen14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_below="@+id/msdueFrame"
|
||||
android:id="@+id/assigneesScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/assigneesScrollView"
|
||||
android:layout_below="@+id/msdueFrame"
|
||||
android:layout_alignParentEnd="false"
|
||||
android:fillViewport="true"
|
||||
android:foregroundGravity="right"
|
||||
android:scrollbarThumbHorizontal="@android:color/transparent"
|
||||
android:fillViewport="true">
|
||||
android:scrollbarThumbHorizontal="@android:color/transparent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/frameAssignees"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:gravity="end"
|
||||
android:layout_marginTop="@dimen/dimen10dp">
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/issueDescription"
|
||||
android:layout_below="@+id/assigneesScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/assigneesScrollView"
|
||||
android:autoLink="web"
|
||||
android:gravity="start"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:autoLink="web"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="@dimen/dimen14sp"/>
|
||||
android:textSize="@dimen/dimen14sp" />
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_below="@+id/issueDescription"
|
||||
android:id="@+id/labelsScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/labelsScrollView"
|
||||
android:layout_below="@+id/issueDescription"
|
||||
android:layout_alignParentEnd="false"
|
||||
android:fillViewport="true"
|
||||
android:foregroundGravity="right"
|
||||
android:scrollbarThumbHorizontal="@android:color/transparent"
|
||||
android:fillViewport="true">
|
||||
android:scrollbarThumbHorizontal="@android:color/transparent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/frameLabels"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/dimen10dp">
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/issueTimeFrame"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/issueTimeFrame"
|
||||
android:layout_below="@+id/labelsScrollView"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/dimen10dp">
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueCreatedTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start"
|
||||
android:visibility="gone"
|
||||
android:textColor="?attr/hintColor"
|
||||
android:textSize="@dimen/dimen12sp"/>
|
||||
android:textSize="@dimen/dimen12sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueModified"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/hintColor"
|
||||
android:layout_toEndOf="@+id/issueCreatedTime"
|
||||
android:text="@string/modifiedText"
|
||||
android:textColor="?attr/hintColor"
|
||||
android:textSize="@dimen/dimen12sp"
|
||||
android:visibility="gone"
|
||||
android:text="@string/modifiedText"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -289,9 +291,9 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/issueTimeFrame"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dimen10dp"
|
||||
android:orientation="horizontal"/>
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -302,15 +304,15 @@
|
|||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:layout_below="@+id/mainThreadCard">
|
||||
android:layout_below="@+id/mainThreadCard"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/dimen72dp"
|
||||
android:clipToPadding="false"/>
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="@dimen/dimen72dp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -23,7 +22,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:orientation="horizontal"/>
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<View
|
||||
android:id="@+id/reactionDivider"
|
||||
|
@ -31,7 +30,7 @@
|
|||
android:layout_height="4dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="?attr/dividerColor"/>
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottomSheetHeaderFrame"
|
||||
|
@ -47,7 +46,7 @@
|
|||
android:gravity="center"
|
||||
android:text="@string/issue"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"/>
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -73,7 +72,7 @@
|
|||
android:textSize="16sp"
|
||||
android:visibility="gone"
|
||||
app:drawableTopCompat="@drawable/ic_file"
|
||||
app:layout_alignSelf="flex_start"/>
|
||||
app:layout_alignSelf="flex_start" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mergePullRequest"
|
||||
|
@ -87,7 +86,7 @@
|
|||
android:textSize="16sp"
|
||||
android:visibility="gone"
|
||||
app:drawableTopCompat="@drawable/ic_pull_request"
|
||||
app:layout_alignSelf="flex_start"/>
|
||||
app:layout_alignSelf="flex_start" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/updatePullRequest"
|
||||
|
@ -100,8 +99,8 @@
|
|||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone"
|
||||
app:drawableTopCompat="@drawable/ic_update"
|
||||
app:layout_alignSelf="flex_start"/>
|
||||
app:drawableTopCompat="@drawable/ic_refresh"
|
||||
app:layout_alignSelf="flex_start" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/deletePrHeadBranch"
|
||||
|
@ -114,7 +113,7 @@
|
|||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableTopCompat="@drawable/ic_branch"
|
||||
app:layout_alignSelf="flex_start"/>
|
||||
app:layout_alignSelf="flex_start" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/editIssue"
|
||||
|
@ -127,7 +126,7 @@
|
|||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableTopCompat="@drawable/ic_edit"
|
||||
app:layout_alignSelf="flex_start"/>
|
||||
app:layout_alignSelf="flex_start" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/addRemoveAssignees"
|
||||
|
@ -140,7 +139,7 @@
|
|||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableTopCompat="@drawable/ic_person_add"
|
||||
app:layout_alignSelf="flex_start"/>
|
||||
app:layout_alignSelf="flex_start" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/editLabels"
|
||||
|
@ -153,7 +152,7 @@
|
|||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableTopCompat="@drawable/ic_tag"
|
||||
app:layout_alignSelf="flex_start"/>
|
||||
app:layout_alignSelf="flex_start" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subscribeIssue"
|
||||
|
@ -166,7 +165,7 @@
|
|||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableTopCompat="@drawable/ic_unwatch"
|
||||
app:layout_alignSelf="flex_start"/>
|
||||
app:layout_alignSelf="flex_start" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/unsubscribeIssue"
|
||||
|
@ -180,7 +179,7 @@
|
|||
android:textSize="16sp"
|
||||
android:visibility="gone"
|
||||
app:drawableTopCompat="@drawable/ic_watchers"
|
||||
app:layout_alignSelf="flex_start"/>
|
||||
app:layout_alignSelf="flex_start" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/closeIssue"
|
||||
|
@ -193,7 +192,7 @@
|
|||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableTopCompat="@drawable/ic_issue_closed"
|
||||
app:layout_alignSelf="flex_start"/>
|
||||
app:layout_alignSelf="flex_start" />
|
||||
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
|
||||
|
@ -202,7 +201,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="?attr/dividerColor"/>
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/issuePrShareSection"
|
||||
|
@ -225,7 +224,7 @@
|
|||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableTopCompat="@drawable/ic_copy"
|
||||
app:layout_alignSelf="flex_start"/>
|
||||
app:layout_alignSelf="flex_start" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/shareIssue"
|
||||
|
@ -238,7 +237,7 @@
|
|||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableTopCompat="@drawable/ic_share"
|
||||
app:layout_alignSelf="flex_start"/>
|
||||
app:layout_alignSelf="flex_start" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/open"
|
||||
|
@ -251,7 +250,7 @@
|
|||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
app:drawableTopCompat="@drawable/ic_browser"
|
||||
app:layout_alignSelf="flex_start"/>
|
||||
app:layout_alignSelf="flex_start" />
|
||||
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
|
||||
|
|
|
@ -10,18 +10,18 @@
|
|||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/comment_view"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/materialCardBackgroundColor"
|
||||
android:padding="@dimen/dimen12dp"
|
||||
android:orientation="vertical">
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/dimen12dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -30,11 +30,11 @@
|
|||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="@dimen/dimen24dp"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
app:cardElevation="@dimen/dimen0dp"
|
||||
app:cardCornerRadius="@dimen/dimen12dp">
|
||||
app:cardCornerRadius="@dimen/dimen12dp"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
|
@ -42,7 +42,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
tools:srcCompat="@tools:sample/avatars"/>
|
||||
tools:srcCompat="@tools:sample/avatars" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
@ -63,7 +63,7 @@
|
|||
android:singleLine="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/information"
|
||||
|
@ -72,7 +72,7 @@
|
|||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/hintColor"
|
||||
android:textSize="12sp"/>
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
|
@ -81,9 +81,9 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:layout_weight="0"
|
||||
android:contentDescription="@string/menuContentDesc"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
app:srcCompat="@drawable/ic_dotted_menu_horizontal"/>
|
||||
android:contentDescription="@string/menuContentDesc"
|
||||
app:srcCompat="@drawable/ic_dotted_menu_horizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -92,333 +92,59 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textIsSelectable="true"
|
||||
android:autoLink="web"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textSize="14sp"/>
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/commentReactionBadges"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal"/>
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/label_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dimen4dp"
|
||||
android:layout_marginBottom="@dimen/dimen4dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="@dimen/dimen24dp"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
app:cardElevation="@dimen/dimen0dp"
|
||||
app:cardCornerRadius="@dimen/dimen12dp"
|
||||
android:backgroundTint="?attr/materialCardBackgroundColor">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/label"
|
||||
android:layout_width="@dimen/dimen16dp"
|
||||
android:layout_height="@dimen/dimen16dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_tag"
|
||||
tools:srcCompat="@drawable/ic_tag"/>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/label_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="@dimen/dimen4dp"
|
||||
android:layout_marginEnd="@dimen/dimen4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/commit_view"
|
||||
android:id="@+id/timeline_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dimen4dp"
|
||||
android:layout_marginBottom="@dimen/dimen4dp">
|
||||
android:layout_marginBottom="@dimen/dimen4dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="@dimen/dimen24dp"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
app:cardElevation="@dimen/dimen0dp"
|
||||
android:backgroundTint="?attr/materialCardBackgroundColor"
|
||||
app:cardCornerRadius="@dimen/dimen12dp"
|
||||
android:backgroundTint="?attr/materialCardBackgroundColor">
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/commit_icon"
|
||||
android:id="@+id/timeline_icon"
|
||||
android:layout_width="@dimen/dimen16dp"
|
||||
android:layout_height="@dimen/dimen16dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_commit"
|
||||
tools:srcCompat="@drawable/ic_commit"/>
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:src="@drawable/ic_history"
|
||||
tools:srcCompat="@drawable/ic_history" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/commit_data"
|
||||
android:id="@+id/timeline_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="@dimen/dimen4dp"
|
||||
android:layout_marginEnd="@dimen/dimen4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/assignees_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dimen4dp"
|
||||
android:layout_marginBottom="@dimen/dimen4dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="@dimen/dimen24dp"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
app:cardElevation="@dimen/dimen0dp"
|
||||
app:cardCornerRadius="@dimen/dimen12dp"
|
||||
android:backgroundTint="?attr/materialCardBackgroundColor">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/assignees_icon"
|
||||
android:layout_width="@dimen/dimen16dp"
|
||||
android:layout_height="@dimen/dimen16dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_person"
|
||||
tools:srcCompat="@drawable/ic_person"/>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/assignees_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="@dimen/dimen4dp"
|
||||
android:layout_marginEnd="@dimen/dimen4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/milestone_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dimen4dp"
|
||||
android:layout_marginBottom="@dimen/dimen4dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="@dimen/dimen24dp"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
app:cardElevation="@dimen/dimen0dp"
|
||||
app:cardCornerRadius="@dimen/dimen12dp"
|
||||
android:backgroundTint="?attr/materialCardBackgroundColor">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/milestone_icon"
|
||||
android:layout_width="@dimen/dimen16dp"
|
||||
android:layout_height="@dimen/dimen16dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_milestone"
|
||||
tools:srcCompat="@drawable/ic_milestone"/>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/milestone_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="@dimen/dimen4dp"
|
||||
android:layout_marginEnd="@dimen/dimen4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/status_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dimen4dp"
|
||||
android:layout_marginBottom="@dimen/dimen4dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="@dimen/dimen24dp"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
app:cardElevation="@dimen/dimen0dp"
|
||||
app:cardCornerRadius="@dimen/dimen12dp"
|
||||
android:backgroundTint="?attr/materialCardBackgroundColor">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/status_icon"
|
||||
android:layout_width="@dimen/dimen16dp"
|
||||
android:layout_height="@dimen/dimen16dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_issue"
|
||||
tools:srcCompat="@drawable/ic_issue"/>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/status_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="@dimen/dimen4dp"
|
||||
android:layout_marginEnd="@dimen/dimen4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/review_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dimen4dp"
|
||||
android:layout_marginBottom="@dimen/dimen4dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="@dimen/dimen24dp"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
app:cardElevation="@dimen/dimen0dp"
|
||||
app:cardCornerRadius="@dimen/dimen12dp"
|
||||
android:backgroundTint="?attr/materialCardBackgroundColor">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/review_icon"
|
||||
android:layout_width="@dimen/dimen16dp"
|
||||
android:layout_height="@dimen/dimen16dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_issue_closed"
|
||||
tools:srcCompat="@drawable/ic_issue_closed"/>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/review_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="@dimen/dimen4dp"
|
||||
android:layout_marginEnd="@dimen/dimen4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/change_title_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dimen4dp"
|
||||
android:layout_marginBottom="@dimen/dimen4dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="@dimen/dimen24dp"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
app:cardElevation="@dimen/dimen0dp"
|
||||
app:cardCornerRadius="@dimen/dimen12dp"
|
||||
android:backgroundTint="?attr/materialCardBackgroundColor">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/change_title_icon"
|
||||
android:layout_width="@dimen/dimen16dp"
|
||||
android:layout_height="@dimen/dimen16dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_edit"
|
||||
tools:srcCompat="@drawable/ic_edit"/>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/change_title_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="@dimen/dimen4dp"
|
||||
android:layout_marginEnd="@dimen/dimen4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lock_unlock_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dimen4dp"
|
||||
android:layout_marginBottom="@dimen/dimen4dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="@dimen/dimen24dp"
|
||||
android:layout_height="@dimen/dimen24dp"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
app:cardElevation="@dimen/dimen0dp"
|
||||
app:cardCornerRadius="@dimen/dimen12dp"
|
||||
android:backgroundTint="?attr/materialCardBackgroundColor">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/lock_unlock_icon"
|
||||
android:layout_width="@dimen/dimen16dp"
|
||||
android:layout_height="@dimen/dimen16dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_lock"
|
||||
tools:srcCompat="@drawable/ic_lock"/>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lock_unlock_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="@dimen/dimen4dp"
|
||||
android:layout_marginEnd="@dimen/dimen4dp" />
|
||||
android:layout_marginEnd="@dimen/dimen4dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -9,18 +9,18 @@
|
|||
android:paddingBottom="@dimen/dimen4dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/materialCardBackgroundColor"
|
||||
android:padding="@dimen/dimen12dp"
|
||||
android:orientation="vertical">
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/dimen12dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/org_info_frame"
|
||||
|
@ -38,7 +38,7 @@
|
|||
android:layout_marginStart="@dimen/dimen0dp"
|
||||
android:layout_marginEnd="@dimen/dimen10dp"
|
||||
android:contentDescription="@string/repoContentAvatar"
|
||||
android:src="@drawable/ic_android"/>
|
||||
android:src="@drawable/ic_android" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/org_name"
|
||||
|
@ -46,7 +46,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen14sp"
|
||||
tools:text="@string/orgName"/>
|
||||
tools:text="@string/orgName" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -57,13 +57,13 @@
|
|||
android:text="@string/repoName"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen16sp"
|
||||
android:textStyle="bold"/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:id="@+id/spacer_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="@dimen/dimen8dp"/>
|
||||
android:layout_marginBottom="@dimen/dimen8dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/repo_info_frame"
|
||||
|
@ -78,7 +78,7 @@
|
|||
android:layout_marginEnd="@dimen/dimen6dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_trending"
|
||||
app:tint="?attr/iconsColor"/>
|
||||
app:tint="?attr/iconsColor" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/most_visited"
|
||||
|
@ -87,7 +87,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen14sp"
|
||||
tools:text="@string/repoStars"/>
|
||||
tools:text="@string/repoStars" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/repo_info_end_frame"
|
||||
|
@ -106,8 +106,8 @@
|
|||
android:layout_marginStart="@dimen/dimen16dp"
|
||||
android:layout_marginEnd="@dimen/dimen2dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_reset"
|
||||
app:tint="?attr/iconsColor"/>
|
||||
app:srcCompat="@drawable/ic_delete"
|
||||
app:tint="?attr/iconsColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
<item
|
||||
android:id="@+id/reset_menu_item"
|
||||
android:icon="@drawable/ic_reset"
|
||||
android:title="@string/menuContentDesc"
|
||||
android:icon="@drawable/ic_delete"
|
||||
android:orderInCategory="1"
|
||||
app:showAsAction="ifRoom"/>
|
||||
android:title="@string/menuContentDesc"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
</menu>
|
||||
|
|
Loading…
Reference in a new issue