mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-26 17:57:34 +00:00
Support for receiving arbitrary attachment types
// FREEBIE
This commit is contained in:
BIN
res/drawable-hdpi/ic_insert_drive_file_white_24dp.png
Normal file
BIN
res/drawable-hdpi/ic_insert_drive_file_white_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 153 B |
BIN
res/drawable-mdpi/ic_insert_drive_file_white_24dp.png
Normal file
BIN
res/drawable-mdpi/ic_insert_drive_file_white_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 133 B |
BIN
res/drawable-xhdpi/ic_insert_drive_file_white_24dp.png
Normal file
BIN
res/drawable-xhdpi/ic_insert_drive_file_white_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 206 B |
BIN
res/drawable-xxhdpi/ic_insert_drive_file_white_24dp.png
Normal file
BIN
res/drawable-xxhdpi/ic_insert_drive_file_white_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 283 B |
BIN
res/drawable-xxxhdpi/ic_insert_drive_file_white_24dp.png
Normal file
BIN
res/drawable-xxxhdpi/ic_insert_drive_file_white_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 372 B |
@@ -41,6 +41,18 @@
|
||||
app:foregroundTintColor="@color/grey_500"
|
||||
app:backgroundTintColor="?conversation_item_bubble_background"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.DocumentView
|
||||
android:id="@+id/attachment_document"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:paddingTop="15dp"
|
||||
android:paddingBottom="15dp"
|
||||
app:documentWidgetBackground="?conversation_item_bubble_background"
|
||||
app:documentForegroundTintColor="@color/grey_500"
|
||||
app:documentBackgroundTintColor="?conversation_item_bubble_background"/>
|
||||
|
||||
|
||||
</org.thoughtcrime.securesms.components.RemovableEditableMediaView>
|
||||
|
||||
</FrameLayout>
|
||||
|
@@ -61,6 +61,11 @@
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ViewStub android:id="@+id/document_view_stub"
|
||||
android:layout="@layout/conversation_item_received_document"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
android:id="@+id/conversation_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
|
12
res/layout/conversation_item_received_document.xml
Normal file
12
res/layout/conversation_item_received_document.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.DocumentView
|
||||
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:id="@+id/document_view"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:documentForegroundTintColor="@color/white"
|
||||
app:documentBackgroundTintColor="@color/blue_500"
|
||||
tools:visibility="visible"/>
|
@@ -50,6 +50,11 @@
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ViewStub android:id="@+id/document_view_stub"
|
||||
android:layout="@layout/conversation_item_sent_document"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
android:id="@+id/conversation_item_body"
|
||||
android:autoLink="all"
|
||||
|
12
res/layout/conversation_item_sent_document.xml
Normal file
12
res/layout/conversation_item_sent_document.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.DocumentView
|
||||
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:id="@+id/document_view"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:documentForegroundTintColor="@color/grey_500"
|
||||
app:documentBackgroundTintColor="@color/white"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
105
res/layout/document_view.xml
Normal file
105
res/layout/document_view.xml
Normal file
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:context="org.thoughtcrime.securesms.components.DocumentView">
|
||||
|
||||
<LinearLayout android:id="@+id/document_container"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<org.thoughtcrime.securesms.components.AnimatingToggle
|
||||
android:id="@+id/control_toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:gravity="center">
|
||||
|
||||
<com.pnikosis.materialishprogress.ProgressWheel
|
||||
android:id="@+id/download_progress"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:visibility="gone"
|
||||
android:clickable="false"
|
||||
android:layout_gravity="center"
|
||||
app:matProg_barColor="@color/white"
|
||||
app:matProg_linearProgress="true"
|
||||
app:matProg_spinSpeed="0.333"
|
||||
tools:visibility="gone"/>
|
||||
|
||||
<FrameLayout android:id="@+id/document_background"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@drawable/ic_circle_fill_white_48dp"
|
||||
android:visibility="visible"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
tools:backgroundTint="@color/blue_400">
|
||||
|
||||
<TextView android:id="@+id/document"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:clickable="false"
|
||||
android:visibility="visible"
|
||||
android:background="@drawable/ic_insert_drive_file_white_24dp"
|
||||
android:textAlignment="center"
|
||||
android:scaleType="centerInside"
|
||||
android:textAllCaps="true"
|
||||
android:textSize="8sp"
|
||||
android:paddingTop="8dp"
|
||||
android:typeface="monospace"
|
||||
tools:visibility="visible"
|
||||
tools:text="PDF"
|
||||
tools:textColor="@color/blue_400"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView android:id="@+id/download"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/circle_touch_highlight_background"
|
||||
android:src="@drawable/ic_download_circle_fill_white_48dp"
|
||||
android:contentDescription="@string/audio_view__download_accessibility_description"/>
|
||||
|
||||
</org.thoughtcrime.securesms.components.AnimatingToggle>
|
||||
|
||||
<LinearLayout android:orientation="vertical"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView android:id="@+id/file_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:clickable="false"
|
||||
android:ellipsize="end"
|
||||
tools:text="The-Anarchist-Tension-by-Alfredo-Bonanno.pdf"/>
|
||||
|
||||
<TextView android:id="@+id/file_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textSize="12sp"
|
||||
android:clickable="false"
|
||||
tools:text="24kb"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</merge>
|
@@ -206,22 +206,26 @@
|
||||
<item>image</item>
|
||||
<item>audio</item>
|
||||
<item>video</item>
|
||||
<item>documents</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_media_download_values">
|
||||
<item>@string/arrays__images</item>
|
||||
<item>@string/arrays__audio</item>
|
||||
<item>@string/arrays__video</item>
|
||||
<item>@string/arrays__documents</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_media_download_mobile_data_default">
|
||||
<item>image</item>
|
||||
<item>audio</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_media_download_wifi_default">
|
||||
<item>image</item>
|
||||
<item>audio</item>
|
||||
<item>video</item>
|
||||
<item>documents</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_media_download_roaming_default" />
|
||||
|
@@ -197,4 +197,10 @@
|
||||
<attr name="pickerColors" format="reference" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="DocumentView">
|
||||
<attr name="documentWidgetBackground" format="color"/>
|
||||
<attr name="documentForegroundTintColor" format="color" />
|
||||
<attr name="documentBackgroundTintColor" format="color" />
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
|
@@ -1063,6 +1063,7 @@
|
||||
<string name="arrays__images">Images</string>
|
||||
<string name="arrays__audio">Audio</string>
|
||||
<string name="arrays__video">Video</string>
|
||||
<string name="arrays__documents">Documents</string>
|
||||
|
||||
<!-- plurals.xml -->
|
||||
<plurals name="hours_ago">
|
||||
@@ -1343,6 +1344,8 @@
|
||||
|
||||
<!-- transport_selection_list_item -->
|
||||
<string name="transport_selection_list_item__transport_icon">Transport icon</string>
|
||||
<string name="SaveAttachmentTask_open_directory">Open Directory</string>
|
||||
<string name="DocumentView_unknown_file">unknown file</string>
|
||||
|
||||
<!-- EOF -->
|
||||
|
||||
|
Reference in New Issue
Block a user