Prepare to add composing private message feature.

This commit is contained in:
Alex Ning
2020-07-07 23:35:18 +08:00
parent ba2a219168
commit 40fd7bf40f
13 changed files with 327 additions and 5 deletions

View File

@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:id="@+id/coordinator_layout_send_private_message_activity"
tools:context=".Activity.SendPrivateMessageActivity">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_layout_send_private_message_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_send_private_message_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:navigationIcon="?attr/homeAsUpIndicator"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/username_edit_text_send_private_message_activity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00000000"
android:gravity="top"
android:hint="@string/send_message_username_hint"
android:inputType="textCapSentences|textMultiLine"
android:paddingTop="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/content_font_18"
android:fontFamily="?attr/content_font_family" />
<View
android:id="@+id/divider_1_send_private_message_activity"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="16dp" />
<EditText
android:id="@+id/subjet_edit_text_send_private_message_activity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00000000"
android:gravity="top"
android:hint="@string/send_message_subject_hint"
android:inputType="textCapSentences|textMultiLine"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/content_font_18"
android:fontFamily="?attr/content_font_family" />
<View
android:id="@+id/divider_2_send_private_message_activity"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="16dp" />
<EditText
android:id="@+id/content_edit_text_send_private_message_activity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00000000"
android:gravity="top"
android:hint="@string/send_message_content_hint"
android:inputType="textCapSentences|textMultiLine"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/content_font_18"
android:fontFamily="?attr/content_font_family" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View 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/action_send_send_private_message_activity"
android:orderInCategory="1"
android:title="@string/action_send"
android:icon="@drawable/ic_send_toolbar_24dp"
app:showAsAction="ifRoom" />
</menu>

View File

@@ -37,4 +37,10 @@
android:orderInCategory="6"
android:title="@string/action_share"
app:showAsAction="never" />
<item
android:id="@+id/action_send_private_message_view_user_detail_activity"
android:orderInCategory="6"
android:title="@string/action_send_private_message"
app:showAsAction="never" />
</menu>

View File

@@ -28,6 +28,7 @@
<string name="report_activity_label">Report</string>
<string name="view_imgur_media_activity_image_label">Image %1$d/%2$d</string>
<string name="view_imgur_media_activity_video_label">Video %1$d/%2$d</string>
<string name="send_private_message_activity_label">Send PM</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
@@ -63,6 +64,7 @@
<string name="action_report">Report</string>
<string name="action_see_removed">See Removed</string>
<string name="action_set_wallpaper">Set as Wallpaper</string>
<string name="action_send_private_message">Send Private Message</string>
<string name="parse_json_response_error">Error occurred when parsing the JSON response</string>
<string name="retrieve_token_error">Error Retrieving the token</string>
@@ -152,6 +154,9 @@
<string name="send_comment_failed">Could not send this comment</string>
<string name="parse_sent_comment_failed">The comment is sent but unable to get the sent comment</string>
<string name="send_message_username_hint">User</string>
<string name="send_message_subject_hint">Subject</string>
<string name="send_message_content_hint">Message</string>
<string name="reply_message_failed">Could not reply to this message</string>
<string name="error_getting_message">Error getting this message</string>