mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
Updated report bottomsheet
This commit is contained in:
parent
9f8f42f139
commit
bf010502fa
5 changed files with 68 additions and 49 deletions
|
|
@ -3,7 +3,8 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="@color/material_card_background_color">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottom_sheet"
|
||||
|
|
@ -12,6 +13,13 @@
|
|||
android:orientation="vertical"
|
||||
app:behavior_hideable="true">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="3dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_margin="@dimen/spacing_large"
|
||||
android:src="@color/offset_background" />
|
||||
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
|
|
@ -23,7 +31,8 @@
|
|||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorContentBackground"
|
||||
android:background="@color/material_card_background_color"
|
||||
android:backgroundTint="@color/material_card_background_color"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="@style/Toolbar"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
|
|
@ -32,19 +41,12 @@
|
|||
app:title=""
|
||||
app:titleTextColor="@color/text_primary">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/close_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/transparent"
|
||||
android:paddingEnd="@dimen/spacing_small"
|
||||
android:src="@drawable/ic_close_grey_800_24dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbar_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="36dp"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/report_violation"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="20sp" />
|
||||
|
|
@ -78,38 +80,47 @@
|
|||
android:paddingEnd="24dp"
|
||||
android:paddingBottom="25dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text_view"
|
||||
style="@style/Caption1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="13dp"
|
||||
android:layout_marginBottom="@dimen/spacing_medium"
|
||||
android:textColor="@color/text_primary"
|
||||
tools:text="Report NAME for violation:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message_text_view"
|
||||
style="@style/Body2"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/border_1f000000"
|
||||
android:lineSpacingExtra="4sp"
|
||||
android:paddingStart="13dp"
|
||||
android:paddingTop="11dp"
|
||||
android:paddingEnd="13dp"
|
||||
android:paddingBottom="11dp"
|
||||
android:textColor="@color/text_quad"
|
||||
tools:text="This is the message that is reported" />
|
||||
app:cardBackgroundColor="@color/material_card_background_color"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:strokeColor="@color/text_primary"
|
||||
app:strokeWidth="1dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message_text_view"
|
||||
style="@style/Body2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:lineSpacingExtra="4sp"
|
||||
android:paddingStart="13dp"
|
||||
android:paddingTop="11dp"
|
||||
android:paddingEnd="13dp"
|
||||
android:paddingBottom="11dp"
|
||||
android:textColor="@color/text_quad"
|
||||
tools:text="This is the message that is reported" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/report_reason_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/spacing_large"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/info_text_input_layout"
|
||||
style="@style/TextInputLayoutAppearance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/spacing_large"
|
||||
android:layout_marginTop="@dimen/spacing_small"
|
||||
android:layout_marginBottom="@dimen/spacing_large"
|
||||
android:hint="@string/report_message_hint"
|
||||
android:background="@color/transparent"
|
||||
android:textColorHint="@color/text_quad"
|
||||
android:hint="@string/report_hint"
|
||||
android:theme="@style/TextInputLayoutAppearanceTheme">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
|
|
@ -118,7 +129,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="always"
|
||||
android:paddingStart="@dimen/spacing_large"
|
||||
android:paddingTop="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="@dimen/spacing_large"
|
||||
android:paddingBottom="34dp"
|
||||
android:textColor="@color/text_primary" />
|
||||
|
|
@ -130,10 +142,10 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/spacing_medium"
|
||||
android:gravity="center"
|
||||
android:gravity="start"
|
||||
android:textColor="@color/text_ternary"
|
||||
android:textColorLink="?colorAccent"
|
||||
android:textStyle="italic"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
tools:text="@string/report_user_description" />
|
||||
|
||||
|
|
@ -142,7 +154,7 @@
|
|||
style="@style/Caption3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:gravity="start"
|
||||
android:textColor="@color/text_ternary"
|
||||
android:textColorLink="?colorAccent"
|
||||
tools:text="@string/report_message_explanation" />
|
||||
|
|
|
|||
|
|
@ -806,13 +806,16 @@
|
|||
<string name="x_class">%s Class</string>
|
||||
<string name="report_explanation">**Only** report a post that violates the [Community Guidelines](https://habitica.com/static/community-guidelines) and/or [Terms of Service](https://habitica.com/static/terms). Inappropriately reporting a post may give you an infraction.</string>
|
||||
<string name="report_message_title">Report %s for violation:</string>
|
||||
<string name="report_message_explanation">**Only** report a post that violates the [Community Guidelines](https://habitica.com/static/community-guidelines) and/or [Terms of Service](https://habitica.com/static/terms). Inappropriately reporting a post may give you an infraction.</string>
|
||||
<string name="report_user_explanation">**Only** report for a user that violates the [Community Guidelines](https://habitica.com/static/community-guidelines) and/or [Terms of Service](https://habitica.com/static/terms). Inappropriately reporting a user may give you an infraction.</string>
|
||||
<string name="report_message_explanation">You should only report a post that violates the [Community Guidelines](https://habitica.com/static/community-guidelines) and/or [Terms of Service](https://habitica.com/static/terms). Submitting a false report is a violation of Habitica\'s Community Guidelines.</string>
|
||||
<string name="report_user_explanation">You should only report a player that violates the [Community Guidelines](https://habitica.com/static/community-guidelines) and/or [Terms of Service](https://habitica.com/static/terms). Submitting a false report is a violation of Habitica\'s Community Guidelines.</string>
|
||||
<string name="report_player_title">Report %s?</string>
|
||||
<string name="report_player">Report Player</string>
|
||||
<string name="report_player_hint">Reason for report (required)</string>
|
||||
<string name="report_user_description">This will also block %s - A blocked user cannot send you Private Messages but you will still see their posts.</string>
|
||||
<string name="report_message_hint">Reason for report (optional)</string>
|
||||
<string name="report_hint">Reason for report</string>
|
||||
<string name="report_reason_title_message">Why are you reporting this message?</string>
|
||||
<string name="report_reason_title_player">Why are you reporting this player?</string>
|
||||
<string name="report_user_description">This will also block %s</string>
|
||||
<string name="report_message_hint">Reason for report</string>
|
||||
<string name="report_message">Report Message</string>
|
||||
<string name="report_successful">%s Reported</string>
|
||||
<string name="report_failure">Report failed, please try again later</string>
|
||||
<string name="report_player_toolbar_title">Report %s</string>
|
||||
|
|
|
|||
|
|
@ -76,12 +76,11 @@ class ReportBottomSheetFragment : BottomSheetDialogFragment() {
|
|||
else if (reportType == REPORT_TYPE_USER)
|
||||
reportUser()
|
||||
}
|
||||
binding.closeButton.setOnClickListener { dismiss() }
|
||||
|
||||
if (reportType == REPORT_TYPE_USER) {
|
||||
binding.toolbarTitle.text = getString(R.string.report_player_toolbar_title, profileName)
|
||||
binding.toolbarTitle.text = getString(R.string.report_player)
|
||||
binding.additionalExplanationTextview.visibility = View.VISIBLE
|
||||
binding.infoTextInputLayout.hint = getString(R.string.report_player_hint)
|
||||
binding.infoTextInputLayout.hint = getString(R.string.report_hint)
|
||||
binding.additionalExplanationTextview.setMarkdown(
|
||||
getString(
|
||||
R.string.report_user_description,
|
||||
|
|
@ -89,14 +88,15 @@ class ReportBottomSheetFragment : BottomSheetDialogFragment() {
|
|||
)
|
||||
)
|
||||
binding.reportExplanationTextview.setMarkdown(getString(R.string.report_user_explanation))
|
||||
binding.titleTextView.text = getString(R.string.report_player_title, profileName)
|
||||
binding.messageTextView.visibility = View.GONE
|
||||
binding.messageTextView.text = "@$profileName"
|
||||
binding.reportReasonTitle.text = getString(R.string.report_reason_title_player)
|
||||
} else if (reportType == REPORT_TYPE_MESSAGE) {
|
||||
binding.toolbarTitle.text = getString(R.string.report_message)
|
||||
binding.additionalExplanationTextview.visibility = View.GONE
|
||||
binding.infoTextInputLayout.hint = getString(R.string.report_message_hint)
|
||||
binding.reportExplanationTextview.setMarkdown(getString(R.string.report_message_explanation))
|
||||
binding.titleTextView.text = getString(R.string.report_message_title, profileName)
|
||||
binding.messageTextView.text = messageText
|
||||
binding.reportReasonTitle.text = getString(R.string.report_reason_title_message)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
<color name="text_green">@color/green_500</color>
|
||||
<color name="text_blue">@color/blue_500</color>
|
||||
<color name="text_teal">@color/teal_500</color>
|
||||
<color name="material_card_background_color">@color/gray_5</color>
|
||||
<color name="material_card_background_inverse_color">@color/gray_700</color>
|
||||
<color name="dim_background">#40502B94</color>
|
||||
<color name="divider_color">@color/gray_100</color>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -158,6 +158,8 @@
|
|||
<color name="text_green">@color/green_10</color>
|
||||
<color name="text_blue">@color/blue_10</color>
|
||||
<color name="text_teal">@color/teal_10</color>
|
||||
<color name="material_card_background_color">@color/gray_700</color>
|
||||
<color name="material_card_background_inverse_color">@color/gray_5</color>
|
||||
<color name="divider_color">@color/gray_500</color>
|
||||
|
||||
<color name="dim_background">#40BDA8FF</color>
|
||||
|
|
|
|||
Loading…
Reference in a new issue