Add ability to attach and send photos

This commit is contained in:
Moez Bhatti
2018-01-12 18:46:47 -05:00
parent 432f71ee95
commit 161f673914
11 changed files with 230 additions and 42 deletions
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
~
~ This file is part of QKSMS.
~
~ QKSMS is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ QKSMS is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:background="@color/backgroundLight">
<FrameLayout
android:id="@+id/thumbnailBounds"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/rounded_rectangle_2dp">
<ImageView
android:id="@+id/thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
tools:src="@tools:sample/avatars" />
</FrameLayout>
<ImageView
android:id="@+id/detach"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="top|end"
android:layout_margin="2dp"
android:background="@drawable/circle"
android:src="@drawable/ic_cancel_black_24dp"
android:tint="@color/textSecondary"
tools:backgroundTint="@color/backgroundLight" />
</FrameLayout>
+45 -28
View File
@@ -76,36 +76,53 @@
android:layout_weight="1"
android:background="@drawable/rounded_rectangle_shadow"
android:gravity="center_vertical"
android:orientation="horizontal">
android:orientation="vertical">
<ImageView
android:id="@+id/attach"
android:layout_width="44dp"
android:layout_height="44dp"
android:background="@drawable/ripple"
android:padding="10dp"
android:src="@drawable/ic_insert_photo_black_24dp"
tools:tint="@color/textSecondary" />
<presentation.common.widget.Separator
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp" />
<presentation.common.widget.QkEditText
android:id="@+id/message"
style="@style/TextPrimary"
android:layout_width="0dp"
<android.support.v7.widget.RecyclerView
android:id="@+id/attachments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:gravity="center_vertical"
android:hint="@string/compose_hint"
android:inputType="textLongMessage|textCapSentences|textMultiLine"
android:minHeight="44dp"
android:padding="12dp"
app:textColorHint="tertiary" />
android:clipChildren="false"
android:clipToPadding="false"
android:paddingEnd="8dp"
android:paddingStart="8dp"
android:paddingTop="8dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/attach"
android:layout_width="44dp"
android:layout_height="44dp"
android:background="@drawable/ripple"
android:padding="10dp"
android:src="@drawable/ic_insert_photo_black_24dp"
tools:tint="@color/textSecondary" />
<presentation.common.widget.Separator
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp" />
<presentation.common.widget.QkEditText
android:id="@+id/message"
style="@style/TextPrimary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:gravity="center_vertical"
android:hint="@string/compose_hint"
android:inputType="textLongMessage|textCapSentences|textMultiLine"
android:minHeight="44dp"
android:padding="12dp"
app:textColorHint="tertiary" />
</LinearLayout>
</LinearLayout>
-1
View File
@@ -40,7 +40,6 @@
<string name="main_syncing">Optimizing database, this might take a minute…</string>
<string name="compose_attach_unsupported">MMS support will be added shortly!</string>
<string name="compose_hint">Write a message…</string>
<string name="message_status_sending">Sending…</string>