Inline images now have rounded corners

This commit is contained in:
Corewala 2022-01-12 20:42:36 -05:00
parent 84de93fedb
commit 0572976be6
2 changed files with 23 additions and 14 deletions

View File

@ -200,7 +200,7 @@ class GemtextAdapter(
when {
inlineImages.containsKey(position) -> {
holder.itemView.gemtext_inline_image.visible(true)
holder.itemView.rounded_image_frame.visible(true)
holder.itemView.gemtext_inline_image.setImageURI(inlineImages[position])
}
else -> {

View File

@ -2,7 +2,8 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/gemtext_text_link"
@ -19,16 +20,24 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/gemtext_inline_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/screen_margin"
android:layout_marginRight="@dimen/screen_margin"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="#ffffff"
android:visibility="gone"
android:adjustViewBounds="true"
android:layout_below="@+id/gemtext_text_link"/>
<androidx.cardview.widget.CardView
android:id="@+id/rounded_image_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="8dp"
android:layout_marginLeft="@dimen/screen_margin"
android:layout_marginRight="@dimen/screen_margin"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:visibility="gone"
android:layout_below="@+id/gemtext_text_link">
<ImageView
android:id="@+id/gemtext_inline_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:adjustViewBounds="true"/>
</androidx.cardview.widget.CardView>
</RelativeLayout>