Attaching media to toots is now possible. Images over the upload limit are automatically downsized, videos are not.

This commit is contained in:
Vavassor 2017-01-16 13:15:42 -05:00
commit 6b684bceff
17 changed files with 865 additions and 25 deletions

View file

@ -1,17 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_compose"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:inputType="textMultiLine"
android:ems="10"
android:gravity="top|left"
android:id="@+id/field_status"
android:contentDescription="What's Happening?"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_height="wrap_content">
<ImageButton
android:layout_width="48dp"
android:layout_height="48dp"
app:srcCompat="@drawable/media_selector"
style="?android:attr/borderlessButtonStyle"
android:id="@+id/compose_photo_pick"
android:layout_marginLeft="8dp" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="@dimen/compose_mark_sensitive_margin"
android:id="@+id/compose_mark_sensitive"
android:text="@string/action_mark_sensitive" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="textMultiLine"
android:ems="10"
android:gravity="top|start"
android:id="@+id/field_status"
android:contentDescription="@string/description_compose" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/compose_media_preview_bar"
android:layout_alignBottom="@id/field_status">
<!--This is filled at runtime with ImageView's for each preview in the upload queue.-->
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
@ -59,7 +101,7 @@
android:text="500" />
<Button
android:text="TOOT"
android:text="@string/action_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button_send" />

View file

@ -30,17 +30,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text="Domain"
android:contentDescription="@string/description_domain"
android:ems="10"
android:id="@+id/edit_text_domain" />
<Button
android:text="LOG IN"
android:text="@string/action_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button_login"
android:layout_centerHorizontal="false"
android:layout_centerInParent="false" />
android:id="@+id/button_login" />
<TextView
android:layout_width="match_parent"

View file

@ -119,7 +119,7 @@
<com.android.volley.toolbox.NetworkImageView
android:id="@+id/status_media_preview_0"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="@dimen/status_media_preview_height"
android:layout_weight="1"
android:scaleType="centerCrop"
android:layout_marginTop="@dimen/status_media_preview_top_margin" />
@ -127,7 +127,7 @@
<com.android.volley.toolbox.NetworkImageView
android:id="@+id/status_media_preview_1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="@dimen/status_media_preview_height"
android:layout_weight="1"
android:scaleType="centerCrop"
android:layout_marginTop="@dimen/status_media_preview_top_margin" />
@ -141,14 +141,14 @@
<com.android.volley.toolbox.NetworkImageView
android:id="@+id/status_media_preview_2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="@dimen/status_media_preview_height"
android:layout_weight="1"
android:scaleType="centerCrop" />
<com.android.volley.toolbox.NetworkImageView
android:id="@+id/status_media_preview_3"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="@dimen/status_media_preview_height"
android:layout_weight="1"
android:scaleType="centerCrop" />
</LinearLayout>