Configuring full-width buttons

This commit is contained in:
Corewala 2022-01-14 22:31:08 -05:00
parent 8e6ca8461a
commit c535861c1e
4 changed files with 62 additions and 50 deletions

View File

@ -2,36 +2,45 @@
<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.AppCompatButton
android:id="@+id/gemtext_text_link"
android:textColor="@color/stroke"
android:textSize="@dimen/default_text_size"
android:clickable="true"
android:focusable="true"
android:drawableEnd="@drawable/vector_photo"
android:drawablePadding="4dp"
android:layout_marginLeft="@dimen/screen_margin"
android:layout_marginRight="@dimen/screen_margin"
android:padding="@dimen/accessibility_button_padding"
android:textAllCaps="false"
tools:text="an image"
android:backgroundTint="@color/accessibility_button_background"
android:textAlignment="viewStart"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.google.android.material.button.MaterialButton
android:id="@+id/gemtext_text_link"
android:textColor="@color/stroke"
android:textSize="@dimen/default_text_size"
android:clickable="true"
android:focusable="true"
android:drawableEnd="@drawable/vector_photo"
android:drawablePadding="4dp"
android:layout_marginLeft="@dimen/screen_margin"
android:layout_marginRight="@dimen/screen_margin"
android:padding="@dimen/accessibility_button_padding"
app:cornerRadius="@dimen/default_margin_big"
android:textAllCaps="false"
tools:text="an image"
android:backgroundTint="@color/accessibility_button_background"
android:textAlignment="viewStart"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<androidx.cardview.widget.CardView
android:id="@+id/rounded_image_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="@dimen/default_margin_big"
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:adjustViewBounds="true"/>
</androidx.cardview.widget.CardView>
<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"/>
</RelativeLayout>

View File

@ -3,24 +3,27 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
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.AppCompatButton
android:id="@+id/gemtext_text_link"
android:textColor="@color/stroke"
android:layout_marginLeft="@dimen/screen_margin"
android:layout_marginRight="@dimen/screen_margin"
android:layout_marginTop="@dimen/default_margin_small"
android:layout_marginBottom="@dimen/default_margin_small"
android:textSize="@dimen/default_text_size"
android:clickable="true"
android:focusable="true"
android:textAllCaps="false"
android:textAlignment="viewStart"
android:padding="@dimen/accessibility_button_padding"
android:backgroundTint="@color/accessibility_button_background"
android:drawablePadding="4dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.google.android.material.button.MaterialButton
android:id="@+id/gemtext_text_link"
android:textColor="@color/stroke"
android:layout_marginLeft="@dimen/screen_margin"
android:layout_marginRight="@dimen/screen_margin"
android:layout_marginTop="@dimen/default_margin_small"
android:layout_marginBottom="@dimen/default_margin_small"
android:textSize="@dimen/default_text_size"
android:clickable="true"
android:focusable="true"
android:textAlignment="viewStart"
android:padding="@dimen/accessibility_button_padding"
app:cornerRadius="@dimen/default_margin_big"
android:textAllCaps="false"
tools:text="a link"
android:backgroundTint="@color/accessibility_button_background"
android:drawablePadding="4dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>

View File

@ -12,5 +12,5 @@
<color name="header_background">#1d1d1d</color>
<color name="navigation_bar_background">#1d1d1d</color>
<color name="stroke">#ffffff</color>
<color name="accessibility_button_background">#3A3A3A</color>
<color name="accessibility_button_background">#26A69A</color>
</resources>

View File

@ -12,5 +12,5 @@
<color name="header_background">#ffffff</color>
<color name="navigation_bar_background">#ffffff</color>
<color name="stroke">#000000</color>
<color name="accessibility_button_background">#f9dede</color>
<color name="accessibility_button_background">#26A69A</color>
</resources>