add rocket and eyes reaction

This commit is contained in:
k0shk0sh 2019-12-27 22:03:23 +01:00
parent 2986098b02
commit cbbcbdc92d
10 changed files with 258 additions and 153 deletions

View File

@ -2,11 +2,14 @@ package com.fastaccess.data.dao;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.Nullable;
import com.fastaccess.data.dao.model.User;
import com.google.gson.annotations.SerializedName;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
@ -24,12 +27,14 @@ import github.PullRequestTimelineQuery;
public long id;
public String url;
public int total_count;
@SerializedName("+1") public int plusOne;
@SerializedName("-1") public int minusOne;
@SerializedName(value = "+1", alternate = "thumbs_up") public int plusOne;
@SerializedName(value = "-1", alternate = "thumbs_down") public int minusOne;
public int laugh;
public int hooray;
public int confused;
public int heart;
public int rocket;
public int eyes;
public String content;
public User user;
public boolean viewerHasReacted;
@ -37,7 +42,7 @@ import github.PullRequestTimelineQuery;
public ReactionsModel() {}
@Override public String toString() {
@NotNull @Override public String toString() {
return "ReactionsModel{" +
"id=" + id +
", url='" + url + '\'' +
@ -48,6 +53,8 @@ import github.PullRequestTimelineQuery;
", hooray=" + hooray +
", confused=" + confused +
", heart=" + heart +
", rocket=" + rocket +
", eyes=" + eyes +
'}';
}
@ -63,6 +70,8 @@ import github.PullRequestTimelineQuery;
dest.writeInt(this.hooray);
dest.writeInt(this.confused);
dest.writeInt(this.heart);
dest.writeInt(this.rocket);
dest.writeInt(this.eyes);
dest.writeString(this.content);
dest.writeParcelable(this.user, flags);
dest.writeByte(this.isCallingApi ? (byte) 1 : (byte) 0);
@ -78,6 +87,8 @@ import github.PullRequestTimelineQuery;
this.hooray = in.readInt();
this.confused = in.readInt();
this.heart = in.readInt();
this.rocket = in.readInt();
this.eyes = in.readInt();
this.content = in.readString();
this.user = in.readParcelable(User.class.getClassLoader());
this.isCallingApi = in.readByte() != 0;
@ -88,46 +99,4 @@ import github.PullRequestTimelineQuery;
@Override public ReactionsModel[] newArray(int size) {return new ReactionsModel[size];}
};
@NonNull public static List<ReactionsModel> getReactionGroup(@Nullable List<PullRequestTimelineQuery.ReactionGroup> reactions) {
List<ReactionsModel> models = new ArrayList<>();
if (reactions != null && !reactions.isEmpty()) {
for (PullRequestTimelineQuery.ReactionGroup reaction : reactions) {
ReactionsModel model = new ReactionsModel();
model.setContent(reaction.content().name());
model.setViewerHasReacted(reaction.viewerHasReacted());
model.setTotal_count(reaction.users().totalCount());
models.add(model);
}
}
return models;
}
@NonNull public static List<ReactionsModel> getReaction(@Nullable List<PullRequestTimelineQuery.ReactionGroup1> reactions) {
List<ReactionsModel> models = new ArrayList<>();
if (reactions != null && !reactions.isEmpty()) {
for (PullRequestTimelineQuery.ReactionGroup1 reaction : reactions) {
ReactionsModel model = new ReactionsModel();
model.setContent(reaction.content().name());
model.setViewerHasReacted(reaction.viewerHasReacted());
model.setTotal_count(reaction.users().totalCount());
models.add(model);
}
}
return models;
}
@NonNull public static List<ReactionsModel> getReaction2(@Nullable List<PullRequestTimelineQuery.ReactionGroup2> reactions) {
List<ReactionsModel> models = new ArrayList<>();
if (reactions != null && !reactions.isEmpty()) {
for (PullRequestTimelineQuery.ReactionGroup2 reaction : reactions) {
ReactionsModel model = new ReactionsModel();
model.setContent(reaction.content().name());
model.setViewerHasReacted(reaction.viewerHasReacted());
model.setTotal_count(reaction.users().totalCount());
models.add(model);
}
}
return models;
}
}

View File

@ -17,7 +17,9 @@ public enum ReactionTypes {
PLUS_ONE("thumbs_up", R.id.thumbsUp, R.id.thumbsUpReaction),
MINUS_ONE("thumbs_down", R.id.thumbsDown, R.id.thumbsDownReaction),
CONFUSED("confused", R.id.sad, R.id.sadReaction),
LAUGH("laugh", R.id.laugh, R.id.laughReaction);
LAUGH("laugh", R.id.laugh, R.id.laughReaction),
ROCKET("rocket", R.id.rocket, R.id.rocketReaction),
EYES("eyes", R.id.eyes, R.id.eyeReaction);
private String content;
private int vId;

View File

@ -1,8 +1,10 @@
package com.fastaccess.provider.timeline;
import android.content.Context;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import android.view.View;
import android.widget.TextView;
@ -16,6 +18,8 @@ import com.fastaccess.data.dao.types.ReactionTypes;
import com.fastaccess.provider.tasks.git.ReactionService;
import com.fastaccess.ui.widgets.SpannableBuilder;
import org.w3c.dom.Text;
import java.util.ArrayList;
import java.util.List;
@ -31,41 +35,14 @@ public class CommentsHelper {
private static final int THUMBS_DOWN = 0x1f44e;
private static final int HOORAY = 0x1f389;
private static final int HEART = 0x2764;
private static final int ROCKET = 0x1f680;
private static final int EYES = 0x1f440;
public static boolean isOwner(@NonNull String currentLogin, @NonNull String repoOwner, @NonNull String commentUser) {
return currentLogin.equalsIgnoreCase(repoOwner) || currentLogin.equalsIgnoreCase(commentUser);
}
public static void handleReactions(@NonNull Context context, @NonNull String login, @NonNull String repoId,
@IdRes int id, long commentId, boolean commit, boolean isDelete,
boolean isEnterprise) {
ReactionTypes type = null;
switch (id) {
case R.id.heart:
type = ReactionTypes.HEART;
break;
case R.id.sad:
type = ReactionTypes.CONFUSED;
break;
case R.id.thumbsDown:
type = ReactionTypes.MINUS_ONE;
break;
case R.id.thumbsUp:
type = ReactionTypes.PLUS_ONE;
break;
case R.id.laugh:
type = ReactionTypes.LAUGH;
break;
case R.id.hurray:
type = ReactionTypes.HOORAY;
break;
}
if (type != null) {
ReactionService.start(context, login, repoId, commentId, type, commit, isDelete, isEnterprise);
}
}
private static String getEmojiByUnicode(int unicode) {
return new String(Character.toChars(unicode));
}
@ -76,14 +53,16 @@ public class CommentsHelper {
return getHeart();
case HOORAY:
return getHooray();
case PLUS_ONE:
return getThumbsUp();
case MINUS_ONE:
return getThumbsDown();
case CONFUSED:
return getSad();
case LAUGH:
return getLaugh();
case ROCKET:
return getRocket();
case EYES:
return getEyes();
default:
return getThumbsUp();
}
@ -113,6 +92,14 @@ public class CommentsHelper {
return getEmojiByUnicode(HEART);
}
public static String getRocket() {
return getEmojiByUnicode(ROCKET);
}
public static String getEyes() {
return getEmojiByUnicode(EYES);
}
@NonNull public static ArrayList<String> getUsers(@NonNull List<Comment> comments) {
return Stream.of(comments)
.filter(comment -> comment.getUser() != null)
@ -129,13 +116,17 @@ public class CommentsHelper {
.collect(Collectors.toCollection(ArrayList::new));
}
public static void appendEmojies(@NonNull ReactionsModel reaction, @NonNull TextView thumbsUp,
@NonNull TextView thumbsUpReaction, @NonNull TextView thumbsDown,
@NonNull TextView thumbsDownReaction, @NonNull TextView hurray,
@NonNull TextView hurrayReaction, @NonNull TextView sad,
@NonNull TextView sadReaction, @NonNull TextView laugh,
@NonNull TextView laughReaction, @NonNull TextView heart,
@NonNull TextView heartReaction, @NonNull View reactionsList) {
public static void appendEmojies(
@NonNull ReactionsModel reaction, @NonNull TextView thumbsUp,
@NonNull TextView thumbsUpReaction, @NonNull TextView thumbsDown,
@NonNull TextView thumbsDownReaction, @NonNull TextView hurray,
@NonNull TextView hurrayReaction, @NonNull TextView sad,
@NonNull TextView sadReaction, @NonNull TextView laugh,
@NonNull TextView laughReaction, @NonNull TextView heart,
@NonNull TextView heartReaction, @NonNull TextView rocket,
@NonNull TextView rocketReaction, @NonNull TextView eye,
@NonNull TextView eyeReaction, @NonNull View reactionsList
) {
SpannableBuilder spannableBuilder = SpannableBuilder.builder()
.append(CommentsHelper.getThumbsUp()).append(" ")
.append(String.valueOf(reaction.getPlusOne()))
@ -173,10 +164,27 @@ public class CommentsHelper {
laughReaction.setVisibility(reaction.getLaugh() > 0 ? View.VISIBLE : View.GONE);
spannableBuilder = SpannableBuilder.builder()
.append(CommentsHelper.getHeart()).append(" ")
.append(String.valueOf(reaction.getHeart()));
.append(String.valueOf(reaction.getHeart()))
.append(" ");
heart.setText(spannableBuilder);
heartReaction.setText(spannableBuilder);
heartReaction.setVisibility(reaction.getHeart() > 0 ? View.VISIBLE : View.GONE);
spannableBuilder = SpannableBuilder.builder()
.append(CommentsHelper.getRocket()).append(" ")
.append(String.valueOf(reaction.getRocket()))
.append(" ");
rocket.setText(spannableBuilder);
rocketReaction.setText(spannableBuilder);
rocketReaction.setVisibility(reaction.getRocket() > 0 ? View.VISIBLE : View.GONE);
spannableBuilder = SpannableBuilder.builder()
.append(CommentsHelper.getEyes()).append(" ")
.append(String.valueOf(reaction.getEyes()));
eye.setText(spannableBuilder);
eyeReaction.setText(spannableBuilder);
eyeReaction.setVisibility(reaction.getEyes() > 0 ? View.VISIBLE : View.GONE);
if (reaction.getPlusOne() > 0 || reaction.getMinusOne() > 0
|| reaction.getLaugh() > 0 || reaction.getHooray() > 0
|| reaction.getConfused() > 0 || reaction.getHeart() > 0) {

View File

@ -69,6 +69,10 @@ public class IssueDetailsViewHolder extends BaseViewHolder<TimelineModel> {
@BindView(R.id.hurrayReaction) FontTextView hurrayReaction;
@BindView(R.id.sadReaction) FontTextView sadReaction;
@BindView(R.id.heartReaction) FontTextView heartReaction;
@BindView(R.id.rocketReaction) FontTextView rocketReaction;
@BindView(R.id.eyeReaction) FontTextView eyeReaction;
@BindView(R.id.rocket) FontTextView rocket;
@BindView(R.id.eyes) FontTextView eyes;
private OnToggleView onToggleView;
private ReactionsCallback reactionsCallback;
private ViewGroup viewGroup;
@ -187,6 +191,14 @@ public class IssueDetailsViewHolder extends BaseViewHolder<TimelineModel> {
case R.id.hurrayReaction:
reactionsModel.setHooray(!isReacted ? reactionsModel.getHooray() + 1 : reactionsModel.getHooray() - 1);
break;
case R.id.rocket:
case R.id.rocketReaction:
reactionsModel.setRocket(!isReacted ? reactionsModel.getRocket() + 1 : reactionsModel.getRocket() - 1);
break;
case R.id.eyes:
case R.id.eyeReaction:
reactionsModel.setEyes(!isReacted ? reactionsModel.getEyes() + 1 : reactionsModel.getEyes() - 1);
break;
}
if (pullRequest != null) {
pullRequest.setReactions(reactionsModel);
@ -254,7 +266,7 @@ public class IssueDetailsViewHolder extends BaseViewHolder<TimelineModel> {
private void appendEmojies(ReactionsModel reaction) {
CommentsHelper.appendEmojies(reaction, thumbsUp, thumbsUpReaction, thumbsDown, thumbsDownReaction, hooray, hurrayReaction, sad,
sadReaction, laugh, laughReaction, heart, heartReaction, reactionsList);
sadReaction, laugh, laughReaction, heart, heartReaction, rocket, rocketReaction, eyes, eyeReaction, reactionsList);
}
private void onToggle(boolean expanded, boolean animate) {

View File

@ -56,6 +56,10 @@ public class ReviewCommentsViewHolder extends BaseViewHolder<ReviewCommentModel>
@BindView(R.id.hurrayReaction) FontTextView hurrayReaction;
@BindView(R.id.sadReaction) FontTextView sadReaction;
@BindView(R.id.heartReaction) FontTextView heartReaction;
@BindView(R.id.rocketReaction) FontTextView rocketReaction;
@BindView(R.id.eyeReaction) FontTextView eyeReaction;
@BindView(R.id.rocket) FontTextView rocket;
@BindView(R.id.eyes) FontTextView eyes;
private OnToggleView onToggleView;
private ReactionsCallback reactionsCallback;
private ViewGroup viewGroup;
@ -201,6 +205,14 @@ public class ReviewCommentsViewHolder extends BaseViewHolder<ReviewCommentModel>
case R.id.hurrayReaction:
reactionsModel.setHooray(!isReacted ? reactionsModel.getHooray() + 1 : reactionsModel.getHooray() - 1);
break;
case R.id.rocket:
case R.id.rocketReaction:
reactionsModel.setRocket(!isReacted ? reactionsModel.getRocket() + 1 : reactionsModel.getRocket() - 1);
break;
case R.id.eyes:
case R.id.eyeReaction:
reactionsModel.setEyes(!isReacted ? reactionsModel.getEyes() + 1 : reactionsModel.getEyes() - 1);
break;
}
comment.setReactions(reactionsModel);
appendEmojies(reactionsModel);
@ -210,7 +222,7 @@ public class ReviewCommentsViewHolder extends BaseViewHolder<ReviewCommentModel>
private void appendEmojies(ReactionsModel reaction) {
CommentsHelper.appendEmojies(reaction, thumbsUp, thumbsUpReaction, thumbsDown, thumbsDownReaction, hurray, hurrayReaction, sad,
sadReaction, laugh, laughReaction, heart, heartReaction, reactionsList);
sadReaction, laugh, laughReaction, heart, heartReaction, rocket, rocketReaction, eyes, eyeReaction, reactionsList);
}
private long getId() {

View File

@ -64,6 +64,10 @@ public class TimelineCommentsViewHolder extends BaseViewHolder<TimelineModel> {
@BindView(R.id.hurrayReaction) FontTextView hurrayReaction;
@BindView(R.id.sadReaction) FontTextView sadReaction;
@BindView(R.id.heartReaction) FontTextView heartReaction;
@BindView(R.id.rocketReaction) FontTextView rocketReaction;
@BindView(R.id.eyeReaction) FontTextView eyeReaction;
@BindView(R.id.rocket) FontTextView rocket;
@BindView(R.id.eyes) FontTextView eyes;
private OnToggleView onToggleView;
private boolean showEmojies;
private ReactionsCallback reactionsCallback;
@ -237,6 +241,14 @@ public class TimelineCommentsViewHolder extends BaseViewHolder<TimelineModel> {
case R.id.hurrayReaction:
reactionsModel.setHooray(!isReacted ? reactionsModel.getHooray() + 1 : reactionsModel.getHooray() - 1);
break;
case R.id.rocket:
case R.id.rocketReaction:
reactionsModel.setRocket(!isReacted ? reactionsModel.getRocket() + 1 : reactionsModel.getRocket() - 1);
break;
case R.id.eyes:
case R.id.eyeReaction:
reactionsModel.setEyes(!isReacted ? reactionsModel.getEyes() + 1 : reactionsModel.getEyes() - 1);
break;
}
comment.setReactions(reactionsModel);
appendEmojies(reactionsModel);
@ -247,7 +259,7 @@ public class TimelineCommentsViewHolder extends BaseViewHolder<TimelineModel> {
private void appendEmojies(ReactionsModel reaction) {
CommentsHelper.appendEmojies(reaction, thumbsUp, thumbsUpReaction, thumbsDown, thumbsDownReaction, hurray, hurrayReaction, sad,
sadReaction, laugh, laughReaction, heart, heartReaction, reactionsList);
sadReaction, laugh, laughReaction, heart, heartReaction, rocket, rocketReaction, eyes, eyeReaction, reactionsList);
}
private void onToggle(boolean expanded, boolean animate) {

View File

@ -1,18 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/commentOptions"
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/commentOptions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_normal"
android:layout_marginTop="@dimen/spacing_normal"
android:layout_marginBottom="@dimen/spacing_normal"
android:background="?card_background"
android:elevation="2dp"
android:orientation="horizontal"
android:outlineProvider="background"
android:paddingBottom="@dimen/spacing_xs_large"
android:paddingTop="@dimen/spacing_xs_large"
android:paddingBottom="@dimen/spacing_xs_large"
tools:ignore="RtlSymmetry"
tools:showIn="@layout/comments_row_item">
@ -21,8 +20,8 @@
android:id="@+id/emojiesList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:scrollbarStyle="insideOverlay">
<LinearLayout
@ -38,7 +37,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/thumbsDown"
@ -49,7 +48,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/laugh"
@ -60,7 +59,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/hurray"
@ -71,7 +70,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/sad"
@ -82,7 +81,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/heart"
@ -90,9 +89,32 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/rocket"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/eyes"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100" />
</LinearLayout>
</HorizontalScrollView>

View File

@ -203,6 +203,29 @@
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_micro"
android:layout_gravity="center"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/rocketReaction"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_micro"
android:layout_gravity="center"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/eyeReaction"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_micro"
android:layout_gravity="center"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"

View File

@ -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:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -9,13 +8,13 @@
<com.fastaccess.ui.widgets.ForegroundRelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_normal"
android:layout_marginEnd="@dimen/grid_spacing"
android:layout_marginStart="@dimen/grid_spacing"
android:layout_marginTop="@dimen/grid_spacing"
android:layout_marginEnd="@dimen/grid_spacing"
android:layout_marginBottom="@dimen/spacing_normal"
android:background="?card_background"
android:paddingBottom="@dimen/spacing_normal"
android:paddingTop="@dimen/spacing_normal"
android:paddingBottom="@dimen/spacing_normal"
tools:ignore="RtlSymmetry">
<LinearLayout
@ -35,8 +34,8 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/avatar_margin_end"
android:layout_marginStart="@dimen/avatar_margin"/>
android:layout_marginStart="@dimen/avatar_margin"
android:layout_marginEnd="@dimen/avatar_margin_end" />
<LinearLayout
android:layout_width="0dp"
@ -61,7 +60,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorPrimary"
tools:text="When one acquires"/>
tools:text="When one acquires" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/date"
@ -71,7 +70,7 @@
android:layout_gravity="center"
android:maxLines="1"
android:textColor="?android:attr/textColorSecondary"
tools:text="50 minutes"/>
tools:text="50 minutes" />
</LinearLayout>
@ -85,7 +84,7 @@
android:textColor="?android:attr/textColorSecondary"
android:visibility="gone"
tools:text="@string/owner"
tools:visibility="visible"/>
tools:visibility="visible" />
</LinearLayout>
<com.fastaccess.ui.widgets.ForegroundImageView
@ -96,7 +95,7 @@
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/options"
android:padding="@dimen/spacing_micro"
android:src="@drawable/ic_add_emoji"/>
android:src="@drawable/ic_add_emoji" />
<com.fastaccess.ui.widgets.ForegroundImageView
android:id="@+id/commentMenu"
@ -106,33 +105,33 @@
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/options"
android:padding="@dimen/spacing_micro"
android:src="@drawable/ic_overflow"/>
android:src="@drawable/ic_overflow" />
</LinearLayout>
<include layout="@layout/comments_dropdown_layout"/>
<include layout="@layout/comments_dropdown_layout" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_micro"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:layout_marginStart="@dimen/spacing_xs_large"
android:layout_marginTop="@dimen/spacing_micro"
android:textIsSelectable="true"/>
android:layout_marginEnd="@dimen/spacing_xs_large"
android:layout_marginBottom="@dimen/spacing_micro"
android:textIsSelectable="true" />
<HorizontalScrollView
android:id="@+id/reactionsList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:layout_marginStart="@dimen/spacing_xs_large"
android:paddingBottom="@dimen/spacing_normal"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:paddingTop="@dimen/spacing_normal"
android:paddingBottom="@dimen/spacing_normal"
android:scrollbarStyle="insideOverlay"
tools:visibility="visible"
android:visibility="gone">
android:visibility="gone"
tools:visibility="visible">
<LinearLayout
android:layout_width="wrap_content"
@ -147,7 +146,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/thumbsDownReaction"
@ -158,7 +157,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/laughReaction"
@ -169,7 +168,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/hurrayReaction"
@ -180,7 +179,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/sadReaction"
@ -191,7 +190,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/heartReaction"
@ -199,9 +198,32 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/rocketReaction"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/eyeReaction"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100" />
</LinearLayout>
</HorizontalScrollView>
@ -214,13 +236,13 @@
android:id="@+id/labelsHolder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_normal"
android:layout_marginEnd="@dimen/grid_spacing"
android:layout_marginStart="@dimen/grid_spacing"
android:layout_marginTop="@dimen/spacing_normal"
android:layout_marginEnd="@dimen/grid_spacing"
android:layout_marginBottom="@dimen/spacing_normal"
android:background="?card_background"
android:paddingBottom="@dimen/spacing_normal"
android:paddingTop="@dimen/spacing_normal"
android:paddingBottom="@dimen/spacing_normal"
android:visibility="gone"
tools:visibility="visible">
@ -229,7 +251,7 @@
style="@style/TextAppearance.AppCompat.Caption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"/>
android:gravity="center" />
</LinearLayout>
</LinearLayout>

View File

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<com.fastaccess.ui.widgets.ForegroundRelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<com.fastaccess.ui.widgets.ForegroundRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/grid_spacing"
android:paddingBottom="@dimen/spacing_normal"
android:paddingTop="@dimen/spacing_normal"
android:paddingBottom="@dimen/spacing_normal"
tools:ignore="RtlSymmetry">
<LinearLayout
@ -26,8 +25,8 @@
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/avatar_margin_end"
android:layout_marginStart="@dimen/avatar_margin"/>
android:layout_marginStart="@dimen/avatar_margin"
android:layout_marginEnd="@dimen/avatar_margin_end" />
<LinearLayout
android:layout_width="0dp"
@ -52,7 +51,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorPrimary"
tools:text="When one acquires"/>
tools:text="When one acquires" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/date"
@ -62,7 +61,7 @@
android:layout_gravity="center"
android:maxLines="1"
android:textColor="?android:attr/textColorSecondary"
tools:text="50 minutes"/>
tools:text="50 minutes" />
</LinearLayout>
@ -76,7 +75,7 @@
android:textColor="?android:attr/textColorSecondary"
android:visibility="gone"
tools:text="@string/owner"
tools:visibility="visible"/>
tools:visibility="visible" />
</LinearLayout>
<com.fastaccess.ui.widgets.ForegroundImageView
@ -87,7 +86,7 @@
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/reactions"
android:padding="@dimen/spacing_micro"
android:src="@drawable/ic_add_emoji"/>
android:src="@drawable/ic_add_emoji" />
<com.fastaccess.ui.widgets.ForegroundImageView
android:id="@+id/commentMenu"
@ -97,33 +96,34 @@
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/options"
android:padding="@dimen/spacing_micro"
android:src="@drawable/ic_overflow"/>
android:src="@drawable/ic_overflow" />
</LinearLayout>
<include layout="@layout/comments_dropdown_layout"/>
<include layout="@layout/comments_dropdown_layout" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_micro"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:layout_marginStart="@dimen/spacing_xs_large"
android:layout_marginTop="@dimen/spacing_micro"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:layout_marginBottom="@dimen/spacing_micro"
android:textIsSelectable="true"
tools:text="Hello World"/>
tools:text="Hello World" />
<HorizontalScrollView
android:id="@+id/reactionsList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:layout_marginStart="@dimen/avatar_margin"
android:paddingBottom="@dimen/spacing_normal"
android:layout_marginEnd="@dimen/spacing_xs_large"
android:paddingTop="@dimen/spacing_normal"
android:paddingBottom="@dimen/spacing_normal"
android:scrollbarStyle="insideOverlay"
android:visibility="gone">
android:visibility="gone"
tools:visibility="visible">
<LinearLayout
android:layout_width="wrap_content"
@ -138,7 +138,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/thumbsDownReaction"
@ -149,7 +149,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/laughReaction"
@ -160,7 +160,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/hurrayReaction"
@ -171,7 +171,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/sadReaction"
@ -182,7 +182,7 @@
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/heartReaction"
@ -190,9 +190,32 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100"/>
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/rocketReaction"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100" />
<com.fastaccess.ui.widgets.FontTextView
android:id="@+id/eyeReaction"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/spacing_micro"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center"
tools:text="100" />
</LinearLayout>
</HorizontalScrollView>