aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-08-13 06:25:16 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-08-13 06:25:16 +0000
commit81e0897a1f91a546452a07fb3f3e880e374db368 (patch)
tree7f125bde9242d94cf755c6f6ba3264f468c739dd /app/src/main/res
parentb1b3642ca8ceb159282dc684be2d75afa4b37a91 (diff)
downloadinfinity-for-reddit-81e0897a1f91a546452a07fb3f3e880e374db368.tar
infinity-for-reddit-81e0897a1f91a546452a07fb3f3e880e374db368.tar.gz
infinity-for-reddit-81e0897a1f91a546452a07fb3f3e880e374db368.tar.bz2
infinity-for-reddit-81e0897a1f91a546452a07fb3f3e880e374db368.tar.lz
infinity-for-reddit-81e0897a1f91a546452a07fb3f3e880e374db368.tar.xz
infinity-for-reddit-81e0897a1f91a546452a07fb3f3e880e374db368.tar.zst
infinity-for-reddit-81e0897a1f91a546452a07fb3f3e880e374db368.zip
Editing and deleting comments are now available.
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/drawable/ic_outline_more_vert_24px.xml9
-rw-r--r--app/src/main/res/layout/activity_edit_comment.xml37
-rw-r--r--app/src/main/res/layout/fragment_modify_comment_bottom_sheet.xml38
-rw-r--r--app/src/main/res/layout/fragment_post_type_bottom_sheet.xml1
-rw-r--r--app/src/main/res/layout/item_comment.xml111
-rw-r--r--app/src/main/res/menu/edit_comment_activity.xml10
-rw-r--r--app/src/main/res/values/strings.xml2
7 files changed, 204 insertions, 4 deletions
diff --git a/app/src/main/res/drawable/ic_outline_more_vert_24px.xml b/app/src/main/res/drawable/ic_outline_more_vert_24px.xml
new file mode 100644
index 00000000..568cbb4d
--- /dev/null
+++ b/app/src/main/res/drawable/ic_outline_more_vert_24px.xml
@@ -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="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
+</vector>
diff --git a/app/src/main/res/layout/activity_edit_comment.xml b/app/src/main/res/layout/activity_edit_comment.xml
new file mode 100644
index 00000000..93504c14
--- /dev/null
+++ b/app/src/main/res/layout/activity_edit_comment.xml
@@ -0,0 +1,37 @@
+<?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_edit_comment_activity"
+ tools:context=".EditCommentActivity">
+
+ <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_edit_comment_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>
+
+ <EditText
+ android:id="@+id/post_text_content_edit_text_edit_comment_activity"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="top"
+ android:padding="16dp"
+ android:hint="@string/post_text_content_hint"
+ android:inputType="textCapSentences|textMultiLine"
+ android:textSize="18sp"
+ android:background="#00000000"
+ android:textColor="@color/primaryTextColor"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior" />
+
+</androidx.coordinatorlayout.widget.CoordinatorLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_modify_comment_bottom_sheet.xml b/app/src/main/res/layout/fragment_modify_comment_bottom_sheet.xml
new file mode 100644
index 00000000..a419912e
--- /dev/null
+++ b/app/src/main/res/layout/fragment_modify_comment_bottom_sheet.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingBottom="8dp"
+ android:orientation="vertical"
+ tools:context=".ModifyCommentBottomSheetFragment">
+
+ <TextView
+ android:id="@+id/edit_text_view_modify_comment_bottom_sheet_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
+ android:text="@string/edit"
+ android:textColor="@color/primaryTextColor"
+ android:clickable="true"
+ android:focusable="true"
+ android:background="?attr/selectableItemBackground" />
+
+ <TextView
+ android:id="@+id/delete_text_view_modify_comment_bottom_sheet_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
+ android:text="@string/delete"
+ android:textColor="@color/primaryTextColor"
+ android:clickable="true"
+ android:focusable="true"
+ android:background="?attr/selectableItemBackground" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml b/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml
index 81f20963..9cdce5a0 100644
--- a/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml
+++ b/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml
@@ -96,7 +96,6 @@
android:id="@+id/video_type_linear_layout_post_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
diff --git a/app/src/main/res/layout/item_comment.xml b/app/src/main/res/layout/item_comment.xml
index 82281e14..1283aa5b 100644
--- a/app/src/main/res/layout/item_comment.xml
+++ b/app/src/main/res/layout/item_comment.xml
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:id="@+id/linear_layout_item_comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -7,7 +9,7 @@
<View
android:id="@+id/vertical_block_item_post_comment"
- android:layout_width="wrap_content"
+ android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@color/colorPrimaryDarkDayNightTheme"/>
@@ -50,7 +52,110 @@
android:layout_marginBottom="8dp"
android:textColor="@color/primaryTextColor"/>
- <RelativeLayout
+ <androidx.constraintlayout.widget.ConstraintLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <ImageView
+ android:id="@+id/up_vote_button_item_post_comment"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:background="?actionBarItemBackground"
+ android:clickable="true"
+ android:focusable="true"
+ android:src="@drawable/ic_arrow_upward_black_20dp"
+ android:tint="@android:color/tab_indicator_text"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent" />
+
+ <TextView
+ android:id="@+id/score_text_view_item_post_comment"
+ android:layout_width="64dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:gravity="center"
+ app:layout_constraintStart_toEndOf="@+id/up_vote_button_item_post_comment"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"/>
+
+ <ImageView
+ android:id="@+id/down_vote_button_item_post_comment"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="16dp"
+ android:background="?actionBarItemBackground"
+ android:clickable="true"
+ android:focusable="true"
+ android:src="@drawable/ic_arrow_downward_black_20dp"
+ android:tint="@android:color/tab_indicator_text"
+ app:layout_constraintStart_toEndOf="@+id/score_text_view_item_post_comment"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent" />
+
+ <ImageView
+ android:id="@+id/more_button_item_post_comment"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="16dp"
+ android:background="?actionBarItemBackground"
+ android:clickable="true"
+ android:focusable="true"
+ android:src="@drawable/ic_outline_more_vert_24px"
+ android:tint="@android:color/tab_indicator_text"
+ android:visibility="gone"
+ app:layout_constraintEnd_toStartOf="@+id/expand_button_item_post_comment"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"/>
+
+ <ImageView
+ android:id="@+id/expand_button_item_post_comment"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="16dp"
+ android:background="?actionBarItemBackground"
+ android:clickable="true"
+ android:focusable="true"
+ android:src="@drawable/ic_expand_less_black_20dp"
+ android:tint="@android:color/tab_indicator_text"
+ android:visibility="gone"
+ app:layout_constraintEnd_toStartOf="@+id/share_button_item_post_comment"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"/>
+
+ <ImageView
+ android:id="@+id/share_button_item_post_comment"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="16dp"
+ android:background="?actionBarItemBackground"
+ android:clickable="true"
+ android:focusable="true"
+ android:src="@drawable/ic_outline_share_20px"
+ android:tint="@android:color/tab_indicator_text"
+ app:layout_constraintEnd_toStartOf="@+id/reply_button_item_post_comment"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"/>
+
+ <ImageView
+ android:id="@+id/reply_button_item_post_comment"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="16dp"
+ android:background="?actionBarItemBackground"
+ android:clickable="true"
+ android:focusable="true"
+ android:src="@drawable/ic_reply_black_20dp"
+ android:tint="@android:color/tab_indicator_text"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"/>
+
+ </androidx.constraintlayout.widget.ConstraintLayout>
+
+ <!--<RelativeLayout
android:id="@+id/relative_layout_item_post_comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -128,7 +233,7 @@
android:clickable="true"
android:focusable="true"/>
- </RelativeLayout>
+ </RelativeLayout>-->
</LinearLayout>
diff --git a/app/src/main/res/menu/edit_comment_activity.xml b/app/src/main/res/menu/edit_comment_activity.xml
new file mode 100644
index 00000000..e52e484b
--- /dev/null
+++ b/app/src/main/res/menu/edit_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_edit_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/values/strings.xml b/app/src/main/res/values/strings.xml
index 392ffc9b..9b3dd695 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -182,7 +182,9 @@
<string name="login_first">Login first</string>
<string name="delete_this_post">Delete This Post</string>
+ <string name="delete_this_comment">Delete This Comment</string>
<string name="are_you_sure">Are you sure?</string>
+ <string name="edit">Edit</string>
<string name="delete">Delete</string>
<string name="cancel">Cancel</string>
<string name="delete_post_success">Delete successfully</string>