diff options
author | Alex Ning <chineseperson5@gmail.com> | 2019-06-13 04:16:04 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2019-06-13 04:16:04 +0000 |
commit | 42c7b316f37b17178518cbf9649a788fcdf0895c (patch) | |
tree | 907e829a37a3534691f968179a7d8d43af91329d /app/src/main/res | |
parent | ef8daed5714cd02f57774c86aab6bd0ca454fcb7 (diff) | |
download | infinity-for-reddit-42c7b316f37b17178518cbf9649a788fcdf0895c.tar infinity-for-reddit-42c7b316f37b17178518cbf9649a788fcdf0895c.tar.gz infinity-for-reddit-42c7b316f37b17178518cbf9649a788fcdf0895c.tar.bz2 infinity-for-reddit-42c7b316f37b17178518cbf9649a788fcdf0895c.tar.lz infinity-for-reddit-42c7b316f37b17178518cbf9649a788fcdf0895c.tar.xz infinity-for-reddit-42c7b316f37b17178518cbf9649a788fcdf0895c.tar.zst infinity-for-reddit-42c7b316f37b17178518cbf9649a788fcdf0895c.zip |
Add CommentActivity for sending comments (not implemented yet). Minor UI tweaks.
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/drawable/ic_insert_comment_white_24dp.xml | 5 | ||||
-rw-r--r-- | app/src/main/res/drawable/ic_send_white_24dp.xml | 5 | ||||
-rw-r--r-- | app/src/main/res/layout/activity_comment.xml | 56 | ||||
-rw-r--r-- | app/src/main/res/layout/activity_view_post_detail.xml | 18 | ||||
-rw-r--r-- | app/src/main/res/menu/comment_activity.xml | 10 | ||||
-rw-r--r-- | app/src/main/res/menu/view_post_detail_activity.xml | 10 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 5 |
7 files changed, 105 insertions, 4 deletions
diff --git a/app/src/main/res/drawable/ic_insert_comment_white_24dp.xml b/app/src/main/res/drawable/ic_insert_comment_white_24dp.xml new file mode 100644 index 00000000..8ab8d733 --- /dev/null +++ b/app/src/main/res/drawable/ic_insert_comment_white_24dp.xml @@ -0,0 +1,5 @@ +<vector android:autoMirrored="true" android:height="24dp" + android:tint="#FFFFFF" android:viewportHeight="24.0" + android:viewportWidth="24.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="#FF000000" android:pathData="M20,2L4,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h14l4,4L22,4c0,-1.1 -0.9,-2 -2,-2zM18,14L6,14v-2h12v2zM18,11L6,11L6,9h12v2zM18,8L6,8L6,6h12v2z"/> +</vector> diff --git a/app/src/main/res/drawable/ic_send_white_24dp.xml b/app/src/main/res/drawable/ic_send_white_24dp.xml new file mode 100644 index 00000000..33efc5c9 --- /dev/null +++ b/app/src/main/res/drawable/ic_send_white_24dp.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" android:tint="#FFFFFF" + android:viewportHeight="24.0" android:viewportWidth="24.0" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="#FF000000" android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/> +</vector> diff --git a/app/src/main/res/layout/activity_comment.xml b/app/src/main/res/layout/activity_comment.xml new file mode 100644 index 00000000..3beff433 --- /dev/null +++ b/app/src/main/res/layout/activity_comment.xml @@ -0,0 +1,56 @@ +<?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" + tools:context=".CommentActivity"> + + <com.google.android.material.appbar.AppBarLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:theme="@style/AppTheme.AppBarOverlay"> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar_comment_activity" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize" + app:navigationIcon="?attr/homeAsUpIndicator" + app:popupTheme="@style/AppTheme.PopupOverlay" /> + + </com.google.android.material.appbar.AppBarLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> + + <TextView + android:id="@+id/comment_parent_text_view_comment_activity" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="16dp" + android:textSize="16sp" /> + + <com.chinalwb.are.AREditText + android:id="@+id/arEditText" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_margin="8dp" + android:layout_weight="1" + android:gravity="top" + android:hint="@string/write_comment_hint" + android:inputType="textMultiLine|textCapSentences" + android:textSize="18sp" + android:textColor="@color/primaryTextColor"/> + + <com.chinalwb.are.styles.toolbar.ARE_ToolbarDefault + android:id="@+id/areToolbar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_vertical" /> + + </LinearLayout> + +</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_view_post_detail.xml b/app/src/main/res/layout/activity_view_post_detail.xml index f70949ce..1810f995 100644 --- a/app/src/main/res/layout/activity_view_post_detail.xml +++ b/app/src/main/res/layout/activity_view_post_detail.xml @@ -7,10 +7,25 @@ android:layout_height="match_parent" tools:context=".ViewPostDetailActivity"> + <com.google.android.material.appbar.AppBarLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:theme="@style/AppTheme.AppBarOverlay"> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar_view_post_detail_activity" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize" + app:popupTheme="@style/AppTheme.PopupOverlay" + app:navigationIcon="?attr/homeAsUpIndicator" /> + + </com.google.android.material.appbar.AppBarLayout> + <androidx.core.widget.NestedScrollView android:id="@+id/nested_scroll_view_view_post_detail_activity" android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> <LinearLayout android:layout_width="match_parent" @@ -339,7 +354,6 @@ </LinearLayout> - </androidx.core.widget.NestedScrollView> </androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/menu/comment_activity.xml b/app/src/main/res/menu/comment_activity.xml new file mode 100644 index 00000000..640f6a43 --- /dev/null +++ b/app/src/main/res/menu/comment_activity.xml @@ -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_comment_activity" + android:orderInCategory="1" + android:title="@string/action_send" + android:icon="@drawable/ic_send_white_24dp" + app:showAsAction="ifRoom" /> +</menu>
\ No newline at end of file diff --git a/app/src/main/res/menu/view_post_detail_activity.xml b/app/src/main/res/menu/view_post_detail_activity.xml index c0f667f9..f5b327d8 100644 --- a/app/src/main/res/menu/view_post_detail_activity.xml +++ b/app/src/main/res/menu/view_post_detail_activity.xml @@ -2,9 +2,15 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item + android:id="@+id/action_comment_view_post_detail_activity" + android:orderInCategory="1" + android:title="@string/action_add_comment" + android:icon="@drawable/ic_insert_comment_white_24dp" + app:showAsAction="ifRoom" /> + + <item android:id="@+id/action_refresh_view_post_detail_activity" android:orderInCategory="2" android:title="@string/action_refresh" - android:icon="@drawable/ic_refresh_white_24dp" - app:showAsAction="always" /> + app:showAsAction="never" /> </menu>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5dd09c72..7a3985eb 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,6 +2,7 @@ <string name="app_name">Infinity</string> <string name="login_activity_label">Login</string> <string name="search_activity_label">Search</string> + <string name="comment_activity_label">Add Comment</string> <string name="navigation_drawer_open">Open navigation drawer</string> <string name="navigation_drawer_close">Close navigation drawer</string> @@ -9,9 +10,11 @@ <string name="action_settings">Settings</string> <string name="action_download">Download</string> <string name="action_refresh">Refresh</string> + <string name="action_add_comment">Add a comment</string> <string name="action_search">Search</string> <string name="action_start_lazy_mode">Start Lazy Mode</string> <string name="action_stop_lazy_mode">Stop Lazy Mode</string> + <string name="action_send">Send</string> <string name="tap_to_retry">Error loading image. Tap to retry.</string> <string name="load_posts_error">Error loading posts.\nTap to retry.</string> @@ -68,4 +71,6 @@ <string name="lazy_mode_start">Lazy Mode starts in %1$.1fs</string> <string name="lazy_mode_stop">Lazy Mode stopped</string> + <string name="write_comment_hint">Your interesting thoughts here</string> + </resources> |