Skip to content

Commit

Permalink
adding an option for reporting/blocking contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Sep 5, 2019
1 parent 6ba3361 commit f1e6635
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 13 deletions.
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_block_red.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFB71C1C"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM4,12c0,-4.42 3.58,-8 8,-8 1.85,0 3.55,0.63 4.9,1.69L5.69,16.9C4.63,15.55 4,13.85 4,12zM12,20c-1.85,0 -3.55,-0.63 -4.9,-1.69L18.31,7.1C19.37,8.45 20,10.15 20,12c0,4.42 -3.58,8 -8,8z"/>
</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_report_red.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#B71C1C"
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="M15.73,3L8.27,3L3,8.27v7.46L8.27,21h7.46L21,15.73L21,8.27L15.73,3zM12,17.3c-0.72,0 -1.3,-0.58 -1.3,-1.3 0,-0.72 0.58,-1.3 1.3,-1.3 0.72,0 1.3,0.58 1.3,1.3 0,0.72 -0.58,1.3 -1.3,1.3zM13,13h-2L11,7h2v6z"/>
</vector>
77 changes: 64 additions & 13 deletions app/src/main/res/layout/fragment_topic_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,69 @@

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<Button
android:id="@+id/buttonClearMessages"
style="?attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="4sp"
android:text="@string/clear_messages"
android:textColor="@color/colorTextPrimary"
app:drawableStartCompat="@drawable/ic_delete"/>

<Button
android:id="@+id/buttonLeaveP2P"
style="?attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="4sp"
android:text="@string/leave_conversation"
android:textColor="@color/colorDangerDark"
app:drawableStartCompat="@drawable/ic_exit_red"/>

<Button
android:id="@+id/buttonBlock"
style="?attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="4sp"
android:text="@string/block_contact"
android:textColor="@color/colorDangerDark"
app:drawableStartCompat="@drawable/ic_block_red"/>

<Button
android:id="@+id/buttonReportContact"
style="?attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="4sp"
android:text="@string/report_contact"
android:textColor="@color/colorDangerDark"
app:drawableStartCompat="@drawable/ic_report_red"/>

<Button
android:id="@+id/buttonReportGroup"
style="?attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="4sp"
android:text="@string/report_group"
android:textColor="@color/colorDangerDark"
app:drawableStartCompat="@drawable/ic_report_red"/>

<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginTop="@dimen/activity_padding"
android:layout_marginBottom="@dimen/activity_padding"
android:background="@color/grey"/>
</LinearLayout>

<RelativeLayout
android:id="@+id/groupMembersWrapper"
android:layout_width="match_parent"
Expand All @@ -290,24 +353,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/membersTitle"
android:contentDescription="@string/add_members"
android:contentDescription="@string/manage_members"
android:drawablePadding="4sp"
android:text="@string/add_members"
android:textColor="@color/colorTextPrimary"
app:drawableStartCompat="@drawable/ic_person_add"/>

<Button
android:id="@+id/buttonLeaveGroup"
style="?attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/membersTitle"
android:layout_toEndOf="@id/buttonAddMembers"
android:drawablePadding="4sp"
android:text="@string/leave_group"
android:textColor="@color/colorDangerDark"
app:drawableStartCompat="@drawable/ic_exit_red"/>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/groupMembers"
android:layout_width="match_parent"
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,10 @@
<string name="add_credential_title">Add contact</string>
<string name="delete_credential_title">Delete contact</string>
<string name="delete_credential_confirmation">Are you sure you want to remove %1$s:%2$s?</string>
<string name="leave_conversation">Leave Conversation</string>
<string name="block_contact">Block Contact</string>
<string name="report_contact">Report Contact</string>
<string name="report_group">Report Group</string>
<string name="clear_messages">Clear Messages</string>
<string name="manage_members">Manage Members</string>
</resources>

0 comments on commit f1e6635

Please sign in to comment.