Add sending messages (#232)
This commit is contained in:

committed by
Rafał Borcz

parent
5ba12cf8c6
commit
c72c301039
10
app/src/main/res/drawable/ic_menu_send_message_24dp.xml
Normal file
10
app/src/main/res/drawable/ic_menu_send_message_24dp.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="#FFFFFF"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z" />
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_send_message_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_send_message_24dp.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="#FF000000"
|
||||
android:pathData="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z" />
|
||||
</vector>
|
@ -24,10 +24,22 @@
|
||||
android:layout_marginTop="48dp"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/openSendMessageButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="16dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:tint="#FFFFFF"
|
||||
app:srcCompat="@drawable/ic_send_message_24dp" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/messageProgress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminate="true" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
145
app/src/main/res/layout/fragment_send_message.xml
Normal file
145
app/src/main/res/layout/fragment_send_message.xml
Normal file
@ -0,0 +1,145 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/sendMessageContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="14dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="@string/send_message_from"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/sendMessageFromTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:enabled="false"
|
||||
android:textColor="?android:attr/textColorPrimaryNoDisable"
|
||||
tools:text="Jan Kowalski" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingLeft="14dp"
|
||||
android:paddingTop="14dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:paddingBottom="14dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="@string/send_message_to"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<com.hootsuite.nachos.NachoTextView
|
||||
android:id="@+id/sendMessageRecipientInput"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:textColor="?attr/chipTextColor"
|
||||
app:chipBackground="?attr/chipBackgroundColor" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/sendMessageSubjectInput"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="66dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:hint="@string/send_message_subject"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:padding="14dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/sendMessageContentInput"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="top|start"
|
||||
android:hint="@string/send_message_content"
|
||||
android:inputType="textMultiLine"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingLeft="14dp"
|
||||
android:paddingTop="18dp"
|
||||
android:paddingEnd="14dp"
|
||||
android:paddingRight="14dp"
|
||||
android:singleLine="false" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/sendMessageEmpty"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:minWidth="100dp"
|
||||
android:minHeight="100dp"
|
||||
app:srcCompat="@drawable/ic_more_messages_24dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/error_unknown"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/sendMessageProgress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</RelativeLayout>
|
10
app/src/main/res/menu/action_menu_send_message.xml
Normal file
10
app/src/main/res/menu/action_menu_send_message.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/sendMessageMenuSend"
|
||||
android:icon="@drawable/ic_menu_send_message_24dp"
|
||||
android:orderInCategory="1"
|
||||
android:title="@string/send_message_title"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
@ -7,6 +7,9 @@
|
||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||
<item name="bottomNavBackground">@color/bottom_nav_background</item>
|
||||
<item name="android:navigationBarColor" tools:targetApi="21">@color/bottom_nav_background</item>
|
||||
<item name="chipBackgroundColor">@color/chip_material_background_inverse</item>
|
||||
<item name="chipTextColor">@color/chip_default_text_color_inverse</item>
|
||||
<item name="dividerColor">@color/divider_inverse</item>
|
||||
|
||||
<!--AboutLibraries specific values-->
|
||||
<item name="about_libraries_window_background">@color/about_libraries_window_background_dark</item>
|
||||
|
@ -168,6 +168,16 @@
|
||||
<item quantity="many">Dostałeś %1$d wiadomości</item>
|
||||
</plurals>
|
||||
|
||||
<!--Send message-->
|
||||
<string name="send_message_title">Wyślij</string>
|
||||
<string name="send_message_from">Od:</string>
|
||||
<string name="send_message_to">Do:</string>
|
||||
<string name="send_message_subject">Temat</string>
|
||||
<string name="send_message_content">Treść</string>
|
||||
<string name="send_message_successful">Wiadomość wysłana pomyślnie</string>
|
||||
<string name="send_message_required_recipients">Musisz wybrać co najmniej 1 adresata</string>
|
||||
<string name="send_message_content_min_length">Treść wiadomości musi zawierać co najmniej 3 znaki</string>
|
||||
|
||||
<!--About-->
|
||||
<string name="about_source_code">Kod źródłowy</string>
|
||||
<string name="about_feedback">Zgłoś błąd</string>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<attr name="bottomNavBackground" format="reference" />
|
||||
<attr name="dividerColor" format="reference" />
|
||||
</resources>
|
||||
|
@ -16,4 +16,10 @@
|
||||
|
||||
<color name="bottom_nav_background">#303030</color>
|
||||
<color name="bottom_nav_background_inverse">#ffffff</color>
|
||||
|
||||
<color name="chip_material_background_inverse">#595959</color>
|
||||
<color name="chip_default_text_color_inverse">#fefefe</color>
|
||||
|
||||
<color name="divider">#cccccc</color>
|
||||
<color name="divider_inverse">#777777</color>
|
||||
</resources>
|
||||
|
@ -155,6 +155,16 @@
|
||||
<item quantity="other">You received %1$d messages</item>
|
||||
</plurals>
|
||||
|
||||
<!--Send message-->
|
||||
<string name="send_message_title">Send</string>
|
||||
<string name="send_message_from">From:</string>
|
||||
<string name="send_message_to">To:</string>
|
||||
<string name="send_message_subject">Subject</string>
|
||||
<string name="send_message_content">Content</string>
|
||||
<string name="send_message_successful">Message sent successfully</string>
|
||||
<string name="send_message_required_recipients">You need to choose at least 1 recipient</string>
|
||||
<string name="send_message_content_min_length">The message content must be at least 3 characters</string>
|
||||
|
||||
<!--About-->
|
||||
<string name="about_source_code">Source code</string>
|
||||
<string name="about_feedback">Report a bug</string>
|
||||
|
@ -14,6 +14,9 @@
|
||||
<item name="subtitleTextColor">@android:color/primary_text_dark</item>
|
||||
<item name="android:colorBackground">@android:color/white</item>
|
||||
<item name="bottomNavBackground">@color/bottom_nav_background_inverse</item>
|
||||
<item name="chipBackgroundColor">@color/chip_material_background</item>
|
||||
<item name="chipTextColor">@color/chip_default_text_color</item>
|
||||
<item name="dividerColor">@color/divider</item>
|
||||
|
||||
<!-- AboutLibraries specific values -->
|
||||
<item name="about_libraries_window_background">@color/about_libraries_window_background</item>
|
||||
|
Reference in New Issue
Block a user