mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-25 03:11:10 +01:00
Render gifs in gif search as MP4s.
This commit is contained in:
committed by
Greyson Parrelli
parent
fcc5db2fe6
commit
c31146e902
9
app/src/main/res/drawable/ic_gif_outline_24.xml
Normal file
9
app/src/main/res/drawable/ic_gif_outline_24.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<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="@color/signal_icon_tint_primary"
|
||||
android:pathData="M14.31,3.5c2.55,0 3.23,0.26 3.91,0.62a4,4 0,0 1,1.66 1.66c0.36,0.68 0.62,1.36 0.62,3.91v4.62c0,2.55 -0.26,3.23 -0.62,3.91a4,4 0,0 1,-1.66 1.66c-0.68,0.36 -1.36,0.62 -3.91,0.62L9.69,20.5c-2.55,0 -3.23,-0.26 -3.91,-0.62a4,4 0,0 1,-1.66 -1.66c-0.36,-0.68 -0.62,-1.36 -0.62,-3.91L3.5,9.69c0,-2.55 0.26,-3.23 0.62,-3.91A4,4 0,0 1,5.78 4.12c0.68,-0.36 1.36,-0.62 3.91,-0.62h4.62m0,-1.5L9.69,2C7,2 6.05,2.28 5.07,2.8A5.52,5.52 0,0 0,2.8 5.07C2.28,6.05 2,7 2,9.69v4.62c0,2.67 0.28,3.64 0.8,4.62A5.52,5.52 0,0 0,5.07 21.2c1,0.52 1.95,0.8 4.62,0.8h4.62c2.67,0 3.64,-0.28 4.62,-0.8a5.52,5.52 0,0 0,2.27 -2.27c0.52,-1 0.8,-1.95 0.8,-4.62L22,9.69c0,-2.67 -0.28,-3.64 -0.8,-4.62A5.52,5.52 0,0 0,18.93 2.8C18,2.28 17,2 14.31,2ZM7.12,12h3.11v3.67L9,15.67v-0.81L8.8,14.86a1.3,1.3 0,0 1,-0.48 0.68,1.66 1.66,0 0,1 -1.06,0.28 2.24,2.24 0,0 1,-0.93 -0.19A2.06,2.06 0,0 1,5.57 15a2.9,2.9 0,0 1,-0.51 -0.92,4 4,0 0,1 -0.19,-1.27v-1.7A3.45,3.45 0,0 1,5.08 9.9,2.5 2.5,0 0,1 5.64,9a2.36,2.36 0,0 1,0.85 -0.57,3 3,0 0,1 1.1,-0.19 3,3 0,0 1,1.12 0.2A2.7,2.7 0,0 1,9.54 9a2.35,2.35 0,0 1,0.51 0.85,2.9 2.9,0 0,1 0.18,1L10.23,11L8.86,11v-0.12a1.31,1.31 0,0 0,-0.34 -1,1.26 1.26,0 0,0 -0.95,-0.34 1.27,1.27 0,0 0,-1 0.39,1.89 1.89,0 0,0 -0.37,1.33v1.54c0,1.12 0.45,1.68 1.37,1.68a1.22,1.22 0,0 0,0.92 -0.33,1.15 1.15,0 0,0 0.32,-0.87L7.12,13.28ZM13.12,8.41v7.26L11.7,15.67L11.7,8.37ZM14.53,8.41h4.65v1.3L15.85,9.71v1.67h3.22v1.3L15.85,12.68v3L14.48,15.68Z"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_gif_solid_24.xml
Normal file
9
app/src/main/res/drawable/ic_gif_solid_24.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<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="@color/signal_icon_tint_primary"
|
||||
android:pathData="M21.2,5.07A5.52,5.52 0,0 0,18.93 2.8C18,2.28 17,2 14.31,2L9.69,2C7,2 6.05,2.28 5.07,2.8A5.52,5.52 0,0 0,2.8 5.07C2.28,6.05 2,7 2,9.69v4.62c0,2.67 0.28,3.64 0.8,4.62A5.52,5.52 0,0 0,5.07 21.2c1,0.52 1.95,0.8 4.62,0.8h4.62c2.67,0 3.64,-0.28 4.62,-0.8a5.52,5.52 0,0 0,2.27 -2.27c0.52,-1 0.8,-1.95 0.8,-4.62L22,9.69C22,7 21.72,6.05 21.2,5.07ZM10.23,11L8.86,11v-0.12a1.31,1.31 0,0 0,-0.34 -1,1.26 1.26,0 0,0 -0.95,-0.34 1.27,1.27 0,0 0,-1 0.39,1.89 1.89,0 0,0 -0.37,1.33v1.54c0,1.12 0.45,1.68 1.37,1.68a1.22,1.22 0,0 0,0.92 -0.33,1.15 1.15,0 0,0 0.32,-0.87L7.12,13.28L7.12,12h3.11v3.67L9,15.67v-0.81L8.8,14.86a1.3,1.3 0,0 1,-0.48 0.68,1.66 1.66,0 0,1 -1.06,0.28 2.24,2.24 0,0 1,-0.93 -0.19A2.06,2.06 0,0 1,5.57 15a2.9,2.9 0,0 1,-0.51 -0.92,4 4,0 0,1 -0.19,-1.27v-1.7A3.45,3.45 0,0 1,5.08 9.9,2.5 2.5,0 0,1 5.64,9a2.36,2.36 0,0 1,0.85 -0.57,3 3,0 0,1 1.1,-0.19 3,3 0,0 1,1.12 0.2A2.7,2.7 0,0 1,9.54 9a2.35,2.35 0,0 1,0.51 0.85,2.9 2.9,0 0,1 0.18,1ZM13.07,15.65L11.7,15.65L11.7,8.37h1.37ZM19.13,9.65L15.85,9.65v1.67h3.22v1.3L15.85,12.62v3L14.48,15.62L14.48,8.37h4.65Z"/>
|
||||
</vector>
|
||||
19
app/src/main/res/layout/gif_player.xml
Normal file
19
app/src/main/res/layout/gif_player.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.exoplayer2.ui.PlayerView
|
||||
android:id="@+id/video_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
app:use_controller="false"
|
||||
app:keep_content_on_player_reset="false"
|
||||
app:player_layout_id="@layout/media_preview_exoplayer_layout"
|
||||
app:surface_type="texture_view" />
|
||||
|
||||
</FrameLayout>
|
||||
13
app/src/main/res/layout/giphy_mp4.xml
Normal file
13
app/src/main/res/layout/giphy_mp4.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.exoplayer2.ui.AspectRatioFrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/still_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY" />
|
||||
|
||||
</com.google.android.exoplayer2.ui.AspectRatioFrameLayout>
|
||||
22
app/src/main/res/layout/giphy_mp4_fragment.xml
Normal file
22
app/src/main/res/layout/giphy_mp4_fragment.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/giphy_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/giphy_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/giphy_mp4" />
|
||||
|
||||
<!-- Will Inject N VideoViews @ runtime -->
|
||||
</FrameLayout>
|
||||
15
app/src/main/res/layout/giphy_mp4_keyboard_icon.xml
Normal file
15
app/src/main/res/layout/giphy_mp4_keyboard_icon.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/media_keyboard_provider_icon_margin"
|
||||
android:padding="@dimen/media_keyboard_provider_icon_padding">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_gif_outline_24" />
|
||||
|
||||
</FrameLayout>
|
||||
16
app/src/main/res/layout/giphy_mp4_keyboard_icon_selected.xml
Normal file
16
app/src/main/res/layout/giphy_mp4_keyboard_icon_selected.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/media_keyboard_provider_icon_margin"
|
||||
android:padding="@dimen/media_keyboard_provider_icon_padding"
|
||||
android:background="@drawable/media_keyboard_selected_background">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_gif_solid_24" />
|
||||
|
||||
</FrameLayout>
|
||||
15
app/src/main/res/layout/giphy_mp4_player.xml
Normal file
15
app/src/main/res/layout/giphy_mp4_player.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp">
|
||||
|
||||
<org.thoughtcrime.securesms.giph.mp4.GiphyMp4VideoPlayer
|
||||
android:id="@+id/video_player"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="false"
|
||||
android:contentDescription="@string/conversation_item__mms_image_description"
|
||||
android:longClickable="false" />
|
||||
|
||||
</FrameLayout>
|
||||
7
app/src/main/res/layout/thumbnail_player_stub.xml
Normal file
7
app/src/main/res/layout/thumbnail_player_stub.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.video.VideoPlayer xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="false"
|
||||
android:contentDescription="@string/conversation_item__mms_image_description"
|
||||
android:longClickable="false" />
|
||||
@@ -24,6 +24,15 @@
|
||||
android:scaleType="fitCenter"
|
||||
android:contentDescription="@string/conversation_item__mms_image_description" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/thumbnail_player_stub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="false"
|
||||
android:inflatedId="@id/thumbnail_player_stub"
|
||||
android:layout="@layout/thumbnail_player_stub"
|
||||
android:longClickable="false" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/thumbnail_caption_icon"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user