diff --git a/app/src/main/java/org/mian/gitnex/interfaces/ApiInterface.java b/app/src/main/java/org/mian/gitnex/interfaces/ApiInterface.java index 019d583..3c5dc15 100644 --- a/app/src/main/java/org/mian/gitnex/interfaces/ApiInterface.java +++ b/app/src/main/java/org/mian/gitnex/interfaces/ApiInterface.java @@ -6,6 +6,7 @@ import org.mian.gitnex.models.Branches; import org.mian.gitnex.models.Commits; import org.mian.gitnex.models.ExploreRepositories; import org.mian.gitnex.models.Files; +import org.mian.gitnex.models.IssueReaction; import org.mian.gitnex.models.MergePullRequest; import org.mian.gitnex.models.NewFile; import org.mian.gitnex.models.PullRequests; @@ -174,6 +175,15 @@ public interface ApiInterface { @PATCH("repos/{owner}/{repo}/issues/comments/{commentId}") // edit a comment Call patchIssueComment(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("commentId") int commentId, @Body IssueComments jsonStr); + @GET("repos/{owner}/{repo}/issues/comments/{commentId}/reactions") // get comment reactions + Call> getIssueCommentReaction(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("commentId") int commentId); + + @PUT("repos/{owner}/{repo}/issues/comments/{commentId}/reactions") // add reaction to a comment + Call setIssueCommentReaction(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("commentId") int commentId, @Body IssueReaction jsonStr); + + @DELETE("repos/{owner}/{repo}/issues/comments/{commentId}/reactions") // delete a reaction of a comment + Call delIssueCommentReaction(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("commentId") int commentId, @Body IssueReaction jsonStr); + @GET("user/followers") // get user followers Call> getFollowers(@Header("Authorization") String token); @@ -192,6 +202,15 @@ public interface ApiInterface { @PUT("repos/{owner}/{repo}/issues/{index}/labels") // replace an issue's labels Call updateIssueLabels(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int issueIndex, @Body Labels jsonStr); + @GET("repos/{owner}/{repo}/issues/{index}/reactions") // get issue reactions + Call> getIssueReactions(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int issueIndex); + + @PUT("repos/{owner}/{repo}/issues/{index}/reactions") // add reaction to an issue + Call setIssueReaction(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int issueIndex, @Body IssueReaction jsonStr); + + @DELETE("repos/{owner}/{repo}/issues/{index}/reactions") // delete a reaction of an issue + Call delIssueReaction(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int issueIndex, @Body IssueReaction jsonStr); + @GET("repos/{owner}/{repo}/raw/{filename}") // get file contents Call getFileContents(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("filename") String filename); diff --git a/app/src/main/java/org/mian/gitnex/models/IssueReaction.java b/app/src/main/java/org/mian/gitnex/models/IssueReaction.java new file mode 100644 index 0000000..8aad0f2 --- /dev/null +++ b/app/src/main/java/org/mian/gitnex/models/IssueReaction.java @@ -0,0 +1,71 @@ +package org.mian.gitnex.models; + +import java.util.Date; + +/** + * Author 6543 + */ + +public class IssueReaction { + + private String content; + private userObject user; + private Date created_at; + + public IssueReaction(String content) { + this.content = content; + } + + public class userObject { + + private int id; + private String login; + private String full_name; + private String email; + private String avatar_url; + private String language; + private String username; + + public int getId() { + return id; + } + + public String getLogin() { + return login; + } + + public String getFull_name() { + return full_name; + } + + public String getEmail() { + return email; + } + + public String getAvatar_url() { + return avatar_url; + } + + public String getLanguage() { + return language; + } + + public String getUsername() { + return username; + } + + } + + public String getContent() { + return content; + } + + public userObject getUser() { + return user; + } + + public Date getCreated_at() { + return created_at; + } + +} diff --git a/app/src/main/res/drawable/circle_reactions.xml b/app/src/main/res/drawable/circle_reactions.xml new file mode 100644 index 0000000..247fc6a --- /dev/null +++ b/app/src/main/res/drawable/circle_reactions.xml @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/round_corners_reactions.xml b/app/src/main/res/drawable/round_corners_reactions.xml new file mode 100644 index 0000000..61ffacd --- /dev/null +++ b/app/src/main/res/drawable/round_corners_reactions.xml @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_issue_detail.xml b/app/src/main/res/layout/activity_issue_detail.xml index b04a941..0a913a4 100644 --- a/app/src/main/res/layout/activity_issue_detail.xml +++ b/app/src/main/res/layout/activity_issue_detail.xml @@ -189,8 +189,20 @@ + + + + + + - + android:orientation="vertical" + android:paddingTop="5dp" + android:paddingBottom="8dp"> + android:layout_height="wrap_content" + android:orientation="vertical"> + + + android:textSize="16sp" /> + android:textSize="16sp" /> + android:textSize="16sp" /> diff --git a/app/src/main/res/layout/bottom_sheet_single_issue.xml b/app/src/main/res/layout/bottom_sheet_single_issue.xml index 17257e8..b9629ad 100644 --- a/app/src/main/res/layout/bottom_sheet_single_issue.xml +++ b/app/src/main/res/layout/bottom_sheet_single_issue.xml @@ -6,7 +6,7 @@ android:orientation="vertical" android:paddingBottom="8dp" android:background="?attr/primaryBackgroundColor" - android:paddingTop="8dp"> + android:paddingTop="5dp"> + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/layout_reactions.xml b/app/src/main/res/layout/layout_reactions.xml new file mode 100644 index 0000000..b3b2c17 --- /dev/null +++ b/app/src/main/res/layout/layout_reactions.xml @@ -0,0 +1,33 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/list_issue_comments.xml b/app/src/main/res/layout/list_issue_comments.xml index 9acece3..92f6635 100644 --- a/app/src/main/res/layout/list_issue_comments.xml +++ b/app/src/main/res/layout/list_issue_comments.xml @@ -59,26 +59,27 @@ android:id="@+id/issueComment" android:layout_width="match_parent" android:layout_height="wrap_content" - android:textIsSelectable="true" - android:textColor="?attr/primaryTextColor" + android:layout_marginBottom="5dp" android:autoLink="web" + android:textColor="?attr/primaryTextColor" android:textColorLink="@color/lightBlue" + android:textIsSelectable="true" android:textSize="16sp" /> + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="3dp" + android:layout_weight=".90" + android:orientation="horizontal"> + android:text="@string/modifiedText" + android:textColor="?attr/primaryTextColor" + android:textSize="12sp" /> + android:src="@drawable/ic_dotted_menu_horizontal" /> + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 5bd6a62..0f03812 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -37,7 +37,7 @@ #e0e0e0 #646565 #f9f9f9 - #b6bbbf + #D4D7DA #212121 #dbdbdb