Report UI tweaks

This commit is contained in:
Hafizzle 2023-09-29 13:07:01 -04:00
parent 0bc2d6edd4
commit 4ce05d4c0d
5 changed files with 33 additions and 8 deletions

View file

@ -46,10 +46,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="36dp"
android:fontFamily="sans-serif-medium"
android:text="@string/report_violation"
android:textColor="@color/text_primary"
android:textSize="20sp"
android:textStyle="bold" />
android:textSize="20sp" />
<Button
android:id="@+id/report_button"
@ -87,7 +87,7 @@
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/material_card_background_color"
app:cardCornerRadius="8dp"
app:strokeColor="@color/text_quad"
app:strokeColor="@color/gray200_gray400"
app:strokeWidth="1dp">
<TextView
@ -111,6 +111,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_large"
android:layout_marginBottom="@dimen/spacing_small"
android:fontFamily="sans-serif-medium"
android:textColor="@color/text_primary"
android:textSize="16sp" />
@ -136,7 +138,7 @@
android:padding="16dp"
android:paddingTop="12dp"
android:textColor="@color/text_primary"
android:textColorHint="@color/text_quad" />
android:textColorHint="@color/gray200_gray400" />
</com.google.android.material.card.MaterialCardView>
@ -147,9 +149,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_medium"
android:fontFamily="sans-serif-medium"
android:gravity="start"
android:textColor="@color/text_ternary"
android:textColorLink="?colorAccent"
android:textSize="14sp"
android:textStyle="bold"
android:visibility="gone"
tools:text="@string/report_user_description" />
@ -159,9 +163,11 @@
style="@style/Caption3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:gravity="start"
android:textColor="@color/text_ternary"
android:textColorLink="?colorAccent"
android:textColorLink="@color/purple400_purple500"
android:textSize="14sp"
tools:text="@string/report_message_explanation" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -60,6 +60,7 @@
<color name="widget_background">#2B203A</color>
<color name="text_gold">@color/yellow_100</color>
<color name="purple400_purple500">@color/brand_500</color>
<color name="text_green10_green500">@color/green_500</color>
<color name="gray100_gray400">@color/gray_400</color>
<color name="gray200_gray400">@color/gray_400</color>

View file

@ -127,6 +127,7 @@
<color name="text_green1_green500">@color/green_1</color>
<color name="text_gold">@color/yellow_1</color>
<color name="purple400_purple500">@color/brand_400</color>
<color name="text_green10_green500">@color/green_10</color>
<color name="gray100_gray400">@color/gray_10</color>
<color name="gray200_gray400">@color/gray_200</color>

View file

@ -814,8 +814,8 @@
<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_formatted_name"><b>%1$s</b>\n@%2$s</string>
<string name="report_user_description">This will also block %s</string>
<string name="report_formatted_name">%1$s\n@%2$s</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>

View file

@ -3,6 +3,9 @@ package com.habitrpg.android.habitica.ui.fragments
import android.app.Dialog
import android.content.DialogInterface
import android.os.Bundle
import android.text.Spannable
import android.text.SpannableStringBuilder
import android.text.style.TypefaceSpan
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -90,7 +93,21 @@ class ReportBottomSheetFragment : BottomSheetDialogFragment() {
)
)
binding.reportExplanationTextview.setMarkdown(getString(R.string.report_user_explanation))
binding.messageTextView.text = getString(R.string.report_formatted_name, displayName, profileName)
val formattedString = getString(R.string.report_formatted_name, displayName, profileName)
val spannable = SpannableStringBuilder(formattedString)
spannable.setSpan(
TypefaceSpan("sans-serif-medium"),
0,
displayName?.length ?: 0,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
spannable.setSpan(
TypefaceSpan("sans-serif"),
displayName?.length ?: 0,
formattedString.length,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
binding.messageTextView.text = spannable
binding.reportReasonTitle.text = getString(R.string.report_reason_title_player)
} else if (reportType == REPORT_TYPE_MESSAGE) {
binding.toolbarTitle.text = getString(R.string.report_message)