diff --git a/app/src/main/java/org/mian/gitnex/adapters/ExploreIssuesAdapter.java b/app/src/main/java/org/mian/gitnex/adapters/ExploreIssuesAdapter.java index c4b40202..40ad2cb4 100644 --- a/app/src/main/java/org/mian/gitnex/adapters/ExploreIssuesAdapter.java +++ b/app/src/main/java/org/mian/gitnex/adapters/ExploreIssuesAdapter.java @@ -15,6 +15,7 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; import androidx.core.content.res.ResourcesCompat; import androidx.core.text.HtmlCompat; import androidx.recyclerview.widget.RecyclerView; @@ -125,6 +126,7 @@ public class ExploreIssuesAdapter extends RecyclerView.Adapter { @@ -254,6 +257,11 @@ public class ExploreIssuesAdapter extends RecyclerView.Adapter 15) { + commentIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_flame)); + commentIcon.setColorFilter(context.getResources().getColor(R.color.releasePre, null)); + } + switch(timeFormat) { case "pretty": { PrettyTime prettyTime = new PrettyTime(locale); diff --git a/app/src/main/java/org/mian/gitnex/adapters/IssueCommentsAdapter.java b/app/src/main/java/org/mian/gitnex/adapters/IssueCommentsAdapter.java index 041ba5b2..245338a3 100644 --- a/app/src/main/java/org/mian/gitnex/adapters/IssueCommentsAdapter.java +++ b/app/src/main/java/org/mian/gitnex/adapters/IssueCommentsAdapter.java @@ -347,7 +347,7 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter { - deleteIssueComment(context, Math.toIntExact(issueComment.getId()), getAdapterPosition()); + deleteIssueComment(context, Math.toIntExact(issueComment.getId()), getBindingAdapterPosition()); dialog.dismiss(); }); @@ -414,13 +414,13 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter 0) { - start.setText(issueComment.getUser().getLogin() + " added this to a project " + informationBuilder); + start.setText(context.getString(R.string.timelineProjectAdded, issueComment.getUser().getLogin(), informationBuilder)); } else { - start.setText(issueComment.getUser().getLogin() + " removed this from a project " + informationBuilder); + start.setText(context.getString(R.string.timelineProjectRemoved, issueComment.getUser().getLogin(), informationBuilder)); timelineIcon.setColorFilter(context.getResources().getColor(R.color.iconIssuePrClosedColor, null)); } start.setTextSize(12); @@ -616,13 +615,14 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter private final LinearLayout frameLabels; private final HorizontalScrollView labelsScrollViewDots; private final LinearLayout frameLabelsDots; + private final ImageView commentIcon; private Issue issueObject; IssuesHolder(View itemView) { @@ -130,6 +132,7 @@ public class IssuesAdapter extends RecyclerView.Adapter frameLabels = itemView.findViewById(R.id.frameLabels); labelsScrollViewDots = itemView.findViewById(R.id.labelsScrollViewDots); frameLabelsDots = itemView.findViewById(R.id.frameLabelsDots); + commentIcon = itemView.findViewById(R.id.comment_icon); new Handler().postDelayed(() -> { if(!AppUtil.checkGhostUsers(issueObject.getUser().getLogin())) { @@ -228,6 +231,11 @@ public class IssuesAdapter extends RecyclerView.Adapter } } + if(issue.getComments() > 15) { + commentIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_flame)); + commentIcon.setColorFilter(context.getResources().getColor(R.color.releasePre, null)); + } + switch(timeFormat) { case "pretty": { PrettyTime prettyTime = new PrettyTime(locale); diff --git a/app/src/main/java/org/mian/gitnex/adapters/PullRequestsAdapter.java b/app/src/main/java/org/mian/gitnex/adapters/PullRequestsAdapter.java index 00e98134..204e48a4 100644 --- a/app/src/main/java/org/mian/gitnex/adapters/PullRequestsAdapter.java +++ b/app/src/main/java/org/mian/gitnex/adapters/PullRequestsAdapter.java @@ -15,6 +15,7 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; import androidx.core.content.res.ResourcesCompat; import androidx.core.text.HtmlCompat; import androidx.recyclerview.widget.RecyclerView; @@ -109,6 +110,7 @@ public class PullRequestsAdapter extends RecyclerView.Adapter { Intent intentPrDetail = new IssueContext(pullRequestObject, ((RepoDetailActivity) context).repository).getIntent(context, IssueDetailActivity.class); @@ -225,6 +228,11 @@ public class PullRequestsAdapter extends RecyclerView.Adapter 15) { + commentIcon.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_flame)); + commentIcon.setColorFilter(context.getResources().getColor(R.color.releasePre, null)); + } + if(timeFormat.equals("pretty")) { this.prCreatedTime.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(pullRequest.getCreatedAt()), context)); } diff --git a/app/src/main/res/drawable/ic_flame.xml b/app/src/main/res/drawable/ic_flame.xml new file mode 100644 index 00000000..fa0337ca --- /dev/null +++ b/app/src/main/res/drawable/ic_flame.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/layout/activity_issue_detail.xml b/app/src/main/res/layout/activity_issue_detail.xml index b817b8cd..791a5e21 100644 --- a/app/src/main/res/layout/activity_issue_detail.xml +++ b/app/src/main/res/layout/activity_issue_detail.xml @@ -310,7 +310,7 @@ diff --git a/app/src/main/res/layout/list_issue_comments.xml b/app/src/main/res/layout/list_issue_comments.xml index d9d6dac7..d23cdb81 100644 --- a/app/src/main/res/layout/list_issue_comments.xml +++ b/app/src/main/res/layout/list_issue_comments.xml @@ -4,15 +4,15 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical" - android:paddingTop="@dimen/dimen4dp" - android:paddingBottom="@dimen/dimen4dp"> + android:orientation="vertical"> @@ -139,11 +140,11 @@ diff --git a/app/src/main/res/layout/list_issues.xml b/app/src/main/res/layout/list_issues.xml index a575ebbc..284c39a4 100644 --- a/app/src/main/res/layout/list_issues.xml +++ b/app/src/main/res/layout/list_issues.xml @@ -61,14 +61,14 @@ android:text="@string/newIssueTitle" android:textAlignment="gravity" android:textColor="?attr/primaryTextColor" - android:textSize="16sp" + android:textSize="@dimen/dimen16sp" tools:text="Id illum odio repellat omnis fuga deserunt aut. Ut est aut similique qui incidunt quia et." /> @@ -91,7 +91,7 @@ android:id="@+id/labelsScrollViewWithText" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="8dp" + android:layout_marginBottom="@dimen/dimen8dp" android:fillViewport="true" android:foregroundGravity="right" android:scrollbarThumbHorizontal="@android:color/transparent" @@ -101,7 +101,7 @@ android:id="@+id/frameLabels" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="10dp" + android:layout_marginTop="@dimen/dimen10dp" android:orientation="horizontal" /> @@ -119,7 +119,7 @@ android:layout_height="wrap_content" android:gravity="start" android:textColor="?attr/hintColor" - android:textSize="12sp" + android:textSize="@dimen/dimen12sp" tools:text="10.01.2020" /> @@ -152,7 +153,7 @@ android:gravity="center_vertical" android:text="@string/repoStars" android:textColor="?attr/primaryTextColor" - android:textSize="14sp" + android:textSize="@dimen/dimen14sp" tools:text="50" /> diff --git a/app/src/main/res/layout/list_pr.xml b/app/src/main/res/layout/list_pr.xml index 4c4be78b..7d5fca81 100644 --- a/app/src/main/res/layout/list_pr.xml +++ b/app/src/main/res/layout/list_pr.xml @@ -61,13 +61,13 @@ android:text="@string/newIssueTitle" android:textAlignment="gravity" android:textColor="?attr/primaryTextColor" - android:textSize="16sp" /> + android:textSize="@dimen/dimen16sp" /> @@ -76,7 +76,7 @@ android:id="@+id/frameLabelsDots" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="10dp" + android:layout_marginTop="@dimen/dimen10dp" android:orientation="horizontal" /> @@ -89,7 +89,7 @@ android:id="@+id/labelsScrollViewWithText" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="8dp" + android:layout_marginBottom="@dimen/dimen8dp" android:fillViewport="true" android:foregroundGravity="right" android:scrollbarThumbHorizontal="@android:color/transparent" @@ -99,7 +99,7 @@ android:id="@+id/frameLabels" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="10dp" + android:layout_marginTop="@dimen/dimen10dp" android:orientation="horizontal" /> @@ -117,27 +117,28 @@ android:layout_height="wrap_content" android:gravity="start" android:textColor="?attr/hintColor" - android:textSize="12sp" /> + android:textSize="@dimen/dimen12sp" /> @@ -149,7 +150,7 @@ android:gravity="center_vertical" android:text="@string/repoStars" android:textColor="?attr/primaryTextColor" - android:textSize="14sp" /> + android:textSize="@dimen/dimen14sp" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f5790f9f..064d4c2a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -790,4 +790,42 @@ %1$d:%2$d Code Editor Open in Code Editor + + + %s added the\u0020 + %s removed the\u0020 + \u0020label %s + %s added commit %s + %s removed their assignment %s + %s was unassigned by %s %s + %s self-assigned this %s + %s was assigned by %s %s + %s added this to the %s milestone %s + %s removed this from the %s milestone %s + %s closed this issue %s + %s reopened this issue %s + %s referenced this issue from a commit %s %s + %s closed this pull request %s + %s merged this pull request %s + %s referenced this issue from a commit %s %s + %s reopened this pull request %s + %s requested review from %s %s + %s changed title from %s to %s %s + %s locked as %s and limited conversation to collaborators %s + %s unlocked this conversation %s + %s added a new dependency #%d %s + %s removed a dependency #%d %s + %s added this to a project %s + %s removed this from a project %s + %s added the due date %s %s + %s modified the due date to %s from %s %s + %s removed the due date %s %s + %s changed target branch from %s to %s %s + %s deleted branch %s %s + %s started working %s + %s stopped time tracking %s + %s cancelled time tracking %s + %s added reference %s %s + %s referenced this issue in #%d %s + %s referenced this pull request in #%d %s