1
0
Fork 0
mirror of https://github.com/KokaKiwi/BarInsta synced 2026-03-05 12:01:35 +00:00

Add like/reaction (WIP)

This commit is contained in:
Ammar Githam 2021-01-13 22:22:25 +09:00
parent 02a1a4a5f5
commit cf62d88531
33 changed files with 1406 additions and 149 deletions

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?colorSurface" />
<padding
android:bottom="4dp"
android:left="4dp"
android:right="4dp"
android:top="4dp" />
<corners android:radius="8dp" />
</shape>

View file

@ -1,10 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M18,13h-5v5c0,0.55 -0.45,1 -1,1s-1,-0.45 -1,-1v-5H6c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1h5V6c0,-0.55 0.45,-1 1,-1s1,0.45 1,1v5h5c0.55,0 1,0.45 1,1s-0.45,1 -1,1z"/>
</vector>

View file

@ -143,4 +143,14 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<View
android:id="@+id/long_click_backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:elevation="5dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_height="@dimen/horizontal_divider_height"
android:background="@drawable/pref_list_divider_material" />

View file

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/container"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<!--<androidx.appcompat.widget.AppCompatImageView-->
<!-- android:id="@+id/img1"-->
<!-- android:layout_width="48dp"-->
<!-- android:layout_height="0dp"-->
<!-- android:padding="4dp"-->
<!-- android:scaleType="fitCenter"-->
<!-- app:layout_constraintBottom_toTopOf="@id/divider"-->
<!-- app:layout_constraintDimensionRatio="1"-->
<!-- app:layout_constraintEnd_toStartOf="@id/img2"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- tools:srcCompat="@mipmap/ic_launcher" />-->
<!--<androidx.appcompat.widget.AppCompatImageView-->
<!-- android:id="@+id/img2"-->
<!-- android:layout_width="48dp"-->
<!-- android:layout_height="0dp"-->
<!-- android:padding="4dp"-->
<!-- android:scaleType="fitCenter"-->
<!-- app:layout_constraintDimensionRatio="1"-->
<!-- app:layout_constraintEnd_toStartOf="@id/img3"-->
<!-- app:layout_constraintStart_toEndOf="@id/img1"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- tools:srcCompat="@mipmap/ic_launcher" />-->
<!--<awais.instagrabber.customviews.SquareImageView-->
<!-- android:id="@+id/img3"-->
<!-- android:layout_width="48dp"-->
<!-- android:layout_height="48dp"-->
<!-- android:padding="4dp"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toEndOf="@id/img2"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- tools:srcCompat="@mipmap/ic_launcher" />-->
<!--<include-->
<!-- android:id="@+id/divider"-->
<!-- layout="@layout/item_pref_divider"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="1dp"-->
<!-- app:layout_constraintEnd_toEndOf="@id/img3"-->
<!-- app:layout_constraintStart_toStartOf="@id/img1"-->
<!-- app:layout_constraintTop_toBottomOf="@id/img1" />-->
<!--<androidx.appcompat.widget.AppCompatTextView-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="test"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@id/divider" />-->
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<awais.instagrabber.customviews.DirectItemFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@ -10,7 +10,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:padding="4dp">
android:clipToPadding="false"
android:paddingStart="4dp"
android:paddingTop="4dp"
android:paddingEnd="4dp"
tools:layout_gravity="end"
tools:paddingBottom="@dimen/dm_reaction_adjust_margin">
<View
android:id="@+id/quote_line"
@ -114,11 +119,11 @@
tools:text="@string/app_name"
tools:visibility="visible" />
<!--app:layout_constraintBottom_toTopOf="@id/reactions"-->
<awais.instagrabber.customviews.ChatMessageLayout
android:id="@+id/chat_message_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@id/reactions"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivProfilePic"
app:layout_constraintTop_toBottomOf="@id/tvUsername"
@ -129,7 +134,9 @@
<FrameLayout
android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
tools:layout_height="200dp"
tools:layout_width="100dp" />
<LinearLayout
android:id="@+id/message_info"
@ -158,7 +165,7 @@
android:layout_gravity="bottom"
android:layout_marginStart="4dp"
android:gravity="center_vertical"
android:visibility="visible"
android:visibility="gone"
app:srcCompat="@drawable/ic_check_all_24"
app:tint="@color/grey_500"
tools:visibility="visible" />
@ -166,24 +173,49 @@
</awais.instagrabber.customviews.ChatMessageLayout>
<FrameLayout
android:id="@+id/reactions"
<androidx.emoji.widget.EmojiAppCompatTextView
android:id="@+id/emojis"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginBottom="4dp"
android:background="@drawable/bg_rounded_corner"
android:elevation="1dp"
android:maxLines="1"
android:padding="4dp"
android:textColor="?android:textColorPrimary"
android:textSize="18sp"
android:translationY="@dimen/dm_reaction_translation_y_type_1"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@id/chat_message_layout"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="@id/chat_message_layout"
app:layout_constraintTop_toBottomOf="@id/chat_message_layout"
tools:visibility="visible">
app:layout_constraintTop_toBottomOf="parent"
app:layout_constraintWidth_max="wrap"
tools:text="😀"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/emojis"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:textColor="?android:textColorPrimary"
tools:text="😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀" />
</FrameLayout>
<!--<FrameLayout-->
<!-- android:id="@+id/reactions"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:background="@drawable/bg_rounded_corner"-->
<!-- android:elevation="1dp"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintEnd_toEndOf="@id/chat_message_layout"-->
<!-- app:layout_constraintStart_toStartOf="@id/chat_message_layout"-->
<!-- app:layout_constraintTop_toBottomOf="@id/chat_message_layout"-->
<!-- tools:visibility="visible">-->
<!-- <androidx.appcompat.widget.AppCompatTextView-->
<!-- android:id="@+id/emojis"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:padding="4dp"-->
<!-- android:textColor="?android:textColorPrimary"-->
<!-- tools:text="😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀" />-->
<!--</FrameLayout>-->
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</awais.instagrabber.customviews.DirectItemFrameLayout>

View file

@ -3,9 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/media_share_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.Barrier
android:id="@+id/top_barrier"

View file

@ -32,7 +32,17 @@
<dimen name="dm_message_item_margin">80dp</dimen>
<dimen name="dm_message_item_avatar_size">48dp</dimen>
<dimen name="dm_message_info_padding_small">4dp</dimen>
<dimen name="dm_reaction_adjust_margin">22dp</dimen>
<dimen name="dm_reaction_translation_y_type_1">6dp</dimen>
<dimen name="dm_reaction_translation_y_type_2">-12dp</dimen>
<dimen name="feed_item_bottom_icon_size">32dp</dimen>
<dimen name="keyboard_height">200dp</dimen>
<dimen name="reaction_picker_emoji_size">40dp</dimen>
<dimen name="reaction_picker_emoji_margin">8dp</dimen>
<dimen name="reaction_picker_option_height">48dp</dimen>
<dimen name="reaction_picker_add_padding_adjustment">4dp</dimen>
<dimen name="horizontal_divider_height">1dp</dimen>
</resources>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="reply" type="id" />
<item name="unsend" type="id" />
</resources>

View file

@ -396,4 +396,5 @@
<string name="dms_action_remove_admin">Remove as Admin</string>
<string name="edit_unsuccessful">Edit was unsuccessful</string>
<string name="message">Message</string>
<string name="reply">Reply</string>
</resources>