feat(link): add button preview back

This commit is contained in:
sneazy-ibo
2024-04-01 18:58:28 +02:00
parent e1215c2030
commit f67c9fc678
2 changed files with 71 additions and 46 deletions

View File

@@ -40,7 +40,7 @@ class DiscordDialogFragment: BottomSheetDialogFragment() {
else -> binding.radioAnilist.isChecked = true
}
// binding.anilistLinkPreview.text = getString(R.string.anilist_link, Anilist.userid.toString()) if you really want it
binding.anilistLinkPreview.text = getString(R.string.anilist_link, PrefManager.getVal<String>(PrefName.AnilistUserName))
binding.radioGroup.setOnCheckedChangeListener { _, checkedId ->
val mode = when (checkedId) {

View File

@@ -52,32 +52,45 @@
android:fontFamily="@font/poppins_semi_bold"
android:text="@string/discord_dantotsu_button" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:id="@+id/dantotsuCard"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_gravity="center"
android:padding="8dp"
app:boxStrokeColor="@color/text_input_layout_stroke_color"
app:cardBackgroundColor="@color/nav_bg"
app:cardCornerRadius="16dp"
app:contentPadding="4dp"
app:contentPaddingLeft="8dp"
app:contentPaddingRight="8dp"
tools:ignore="ContentDescription,TextContrastCheck">
<TextView
<androidx.cardview.widget.CardView
android:id="@+id/dantotsuCard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="48dp"
android:layout_gravity="center"
android:drawablePadding="4dp"
android:fontFamily="@font/poppins_bold"
android:text="@string/stream_on_dantotsu"
android:textColor="?attr/colorPrimary"
app:drawableTint="?attr/colorPrimary" />
</androidx.cardview.widget.CardView>
android:padding="8dp"
app:boxStrokeColor="@color/text_input_layout_stroke_color"
app:cardBackgroundColor="@color/nav_bg"
app:cardCornerRadius="16dp"
app:contentPadding="4dp"
app:contentPaddingLeft="8dp"
app:contentPaddingRight="8dp"
tools:ignore="ContentDescription,TextContrastCheck">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawablePadding="4dp"
android:fontFamily="@font/poppins_bold"
android:text="@string/stream_on_dantotsu"
android:textColor="?attr/colorPrimary"
app:drawableTint="?attr/colorPrimary" />
</androidx.cardview.widget.CardView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppins_bold"
android:text="@string/dantotsu"
android:textColor="?attr/colorPrimary"
app:drawableTint="?attr/colorPrimary" />
</LinearLayout>
<RadioButton
android:id="@+id/radio_anilist"
@@ -86,34 +99,46 @@
android:fontFamily="@font/poppins_semi_bold"
android:text="@string/discord_anilist_button" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:id="@+id/anilistCard"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_gravity="center"
android:padding="8dp"
app:boxStrokeColor="@color/text_input_layout_stroke_color"
app:cardBackgroundColor="@color/nav_bg"
app:cardCornerRadius="16dp"
app:contentPadding="4dp"
app:contentPaddingLeft="8dp"
app:contentPaddingRight="8dp"
tools:ignore="ContentDescription,TextContrastCheck">
<TextView
<androidx.cardview.widget.CardView
android:id="@+id/anilistCard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="48dp"
android:layout_gravity="center"
android:drawablePadding="4dp"
android:fontFamily="@font/poppins_bold"
android:text="@string/view_my_anilist"
android:textColor="?attr/colorPrimary"
app:drawableTint="?attr/colorPrimary" />
</androidx.cardview.widget.CardView>
android:padding="8dp"
app:boxStrokeColor="@color/text_input_layout_stroke_color"
app:cardBackgroundColor="@color/nav_bg"
app:cardCornerRadius="16dp"
app:contentPadding="4dp"
app:contentPaddingLeft="8dp"
app:contentPaddingRight="8dp"
tools:ignore="ContentDescription,TextContrastCheck">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawablePadding="4dp"
android:fontFamily="@font/poppins_bold"
android:text="@string/view_my_anilist"
android:textColor="?attr/colorPrimary"
app:drawableTint="?attr/colorPrimary" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/anilistLinkPreview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppins_bold"
android:text="@string/anilist_link"
android:textColor="?attr/colorPrimary"
app:drawableTint="?attr/colorPrimary" />
</LinearLayout>
</RadioGroup>
</LinearLayout>