chinwag-android/app/src/main/res/layout/activity_about.xml
Nik Clayton 61720c3472
Meet accessibility guidelines for clickable spans (#3382)
Clickable spans in textviews do not normally meet the Android accessibility
guidelines of a minimum 48dp square touch target.

This can't be fixed with a `TouchDelegate`, as the span is not a separate
view to which the delegate can be attached.

Add `ClickableSpanTextView`. If used instead of a `TextView`, any spans
from `ClickableSpan` will have their touchable area extended to meet the
48dp minimum.

The touchable area is still bounded by the size of the view.

If two spans are closer together than 48dp then the closest span to the
touch wins.

Co-authored-by: Konrad Pozniak <connyduck@users.noreply.github.com>
2023-03-18 08:57:39 +01:00

128 lines
5.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.keylesspalace.tusky.AboutActivity">
<include
android:id="@+id/includedToolbar"
layout="@layout/toolbar_basic" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textDirection="anyRtl">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="true"
android:gravity="center"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp">
<TextView
android:id="@+id/versionTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:drawableStart="@mipmap/ic_launcher"
android:drawablePadding="16dp"
android:gravity="center_vertical"
android:textColor="?android:attr/textColorPrimary"
android:textIsSelectable="true"
android:textSize="24sp"
android:textStyle="bold" />
<TextView
android:id="@+id/aboutPoweredByTusky"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:drawablePadding="16dp"
android:gravity="center_vertical"
android:textSize="18sp"
android:text="@string/about_powered_by_tusky"
android:textStyle="bold" />
<com.keylesspalace.tusky.view.ClickableSpanTextView
android:id="@+id/aboutLicenseInfoTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:hyphenationFrequency="full"
android:lineSpacingMultiplier="1.2"
android:paddingStart="@dimen/text_content_margin"
android:paddingEnd="@dimen/text_content_margin"
android:textAlignment="center"
android:textIsSelectable="true"
android:textSize="16sp"
tools:text="@string/about_tusky_license" />
<com.keylesspalace.tusky.view.ClickableSpanTextView
android:id="@+id/aboutWebsiteInfoTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:lineSpacingMultiplier="1.2"
android:paddingStart="@dimen/text_content_margin"
android:paddingEnd="@dimen/text_content_margin"
android:textAlignment="center"
android:textIsSelectable="true"
android:textSize="16sp"
tools:text="@string/about_project_site" />
<com.keylesspalace.tusky.view.ClickableSpanTextView
android:id="@+id/aboutBugsFeaturesInfoTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:lineSpacingMultiplier="1.2"
android:paddingStart="@dimen/text_content_margin"
android:paddingEnd="@dimen/text_content_margin"
android:text="@string/about_bug_feature_request_site"
android:textAlignment="center"
android:textIsSelectable="true"
android:textSize="16sp" />
<Button
android:id="@+id/tuskyProfileButton"
style="@style/TuskyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:lineSpacingMultiplier="1.2"
android:text="@string/about_tusky_account"
android:textAllCaps="false"
android:textSize="16sp" />
<Button
android:id="@+id/aboutLicensesButton"
style="@style/TuskyButton.Outlined"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:lineSpacingMultiplier="1.2"
android:text="@string/title_licenses"
android:textAlignment="center"
android:textAllCaps="false"
android:textSize="16sp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</FrameLayout>
<include layout="@layout/item_status_bottom_sheet" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>