scale text according to system

closes #244
This commit is contained in:
sk 2023-01-09 07:11:00 -03:00 committed by LucasGGamerM
parent e343131670
commit 1fa42fd20f
11 changed files with 43 additions and 39 deletions

View File

@ -107,7 +107,7 @@
android:layout_below="@id/retry_or_cancel_upload" android:layout_below="@id/retry_or_cancel_upload"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:textColor="?colorGray200" android:textColor="?colorGray200"
android:textSize="14dp" android:textSize="14sp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:singleLine="true" android:singleLine="true"
android:ellipsize="end" android:ellipsize="end"

View File

@ -49,8 +49,8 @@
<ImageView <ImageView
android:id="@+id/avatar" android:id="@+id/avatar"
android:layout_width="46dp" android:layout_width="46sp"
android:layout_height="46dp" android:layout_height="46sp"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_marginEnd="12dp" /> android:layout_marginEnd="12dp" />
@ -58,15 +58,16 @@
<org.joinmastodon.android.ui.views.HeaderSubtitleLinearLayout <org.joinmastodon.android.ui.views.HeaderSubtitleLinearLayout
android:id="@+id/name_wrap" android:id="@+id/name_wrap"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="24dp" android:layout_height="wrap_content"
android:layout_marginEnd="12dp" android:layout_marginEnd="12dp"
android:layout_toStartOf="@id/visibility" android:layout_toStartOf="@id/visibility"
android:layout_toEndOf="@id/avatar"> android:layout_toEndOf="@id/avatar"
android:minHeight="24sp">
<TextView <TextView
android:id="@+id/name" android:id="@+id/name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="24dp" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:singleLine="true"
android:textAlignment="viewStart" android:textAlignment="viewStart"
@ -76,7 +77,7 @@
<TextView <TextView
android:id="@+id/extra_text" android:id="@+id/extra_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="24dp" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:ellipsize="end" android:ellipsize="end"
android:fontFamily="sans-serif" android:fontFamily="sans-serif"
@ -89,18 +90,19 @@
<org.joinmastodon.android.ui.views.HeaderSubtitleLinearLayout <org.joinmastodon.android.ui.views.HeaderSubtitleLinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="20dp" android:layout_height="wrap_content"
android:layout_below="@id/name_wrap" android:layout_below="@id/name_wrap"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_toStartOf="@id/visibility" android:layout_toStartOf="@id/visibility"
android:layout_toEndOf="@id/avatar" android:layout_toEndOf="@id/avatar"
android:layoutDirection="locale" android:layoutDirection="locale"
android:minHeight="20sp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/username" android:id="@+id/username"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="20dp" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/m3_title_small" android:textAppearance="@style/m3_title_small"
@ -109,9 +111,9 @@
<TextView <TextView
android:id="@+id/separator" android:id="@+id/separator"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="20dp" android:layout_height="wrap_content"
android:layout_marginLeft="4dp" android:layout_marginLeft="4sp"
android:layout_marginRight="4dp" android:layout_marginRight="4sp"
android:importantForAccessibility="no" android:importantForAccessibility="no"
android:text="·" android:text="·"
android:textAppearance="@style/m3_title_small" /> android:textAppearance="@style/m3_title_small" />
@ -119,7 +121,7 @@
<TextView <TextView
android:id="@+id/timestamp" android:id="@+id/timestamp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="20dp" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/m3_title_small" android:textAppearance="@style/m3_title_small"
tools:text="3h" /> tools:text="3h" />

View File

@ -79,8 +79,8 @@
<ImageView <ImageView
android:id="@+id/self_avatar" android:id="@+id/self_avatar"
android:layout_width="46dp" android:layout_width="46sp"
android:layout_height="46dp" android:layout_height="46sp"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_marginEnd="12dp" /> android:layout_marginEnd="12dp" />
@ -88,8 +88,9 @@
<TextView <TextView
android:id="@+id/self_name" android:id="@+id/self_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="24dp" android:layout_height="wrap_content"
android:layout_toEndOf="@id/self_avatar" android:layout_toEndOf="@id/self_avatar"
android:minHeight="24sp"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/m3_title_medium" android:textAppearance="@style/m3_title_medium"
@ -98,9 +99,10 @@
<TextView <TextView
android:id="@+id/self_username" android:id="@+id/self_username"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="20dp" android:layout_height="wrap_content"
android:layout_below="@id/self_name" android:layout_below="@id/self_name"
android:layout_toEndOf="@id/self_avatar" android:layout_toEndOf="@id/self_avatar"
android:minHeight="20sp"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/m3_title_small" android:textAppearance="@style/m3_title_small"

View File

@ -36,7 +36,7 @@
android:hint="@string/search_hint" android:hint="@string/search_hint"
android:textColorHint="?colorSearchHint" android:textColorHint="?colorSearchHint"
android:textColor="?android:textColorPrimary" android:textColor="?android:textColorPrimary"
android:textSize="16dp" android:textSize="16sp"
android:singleLine="true" android:singleLine="true"
android:inputType="textFilter" android:inputType="textFilter"
android:imeOptions="actionSearch" android:imeOptions="actionSearch"

View File

@ -45,7 +45,7 @@
android:textColor="?colorGray50t" android:textColor="?colorGray50t"
android:textAllCaps="true" android:textAllCaps="true"
android:fontFamily="sans-serif-medium" android:fontFamily="sans-serif-medium"
android:textSize="14dp" android:textSize="14sp"
android:gravity="center" android:gravity="center"
android:background="@drawable/bg_profile_follows_you" android:background="@drawable/bg_profile_follows_you"
android:visibility="gone" android:visibility="gone"

View File

@ -19,7 +19,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginStart="24dp" android:layout_marginStart="24dp"
android:textSize="16dp" android:textSize="16sp"
android:textColor="?android:textColorPrimary" android:textColor="?android:textColorPrimary"
android:singleLine="true" android:singleLine="true"
android:ellipsize="end"/> android:ellipsize="end"/>

View File

@ -6,7 +6,7 @@
android:singleLine="true" android:singleLine="true"
android:ellipsize="end" android:ellipsize="end"
android:fontFamily="sans-serif-medium" android:fontFamily="sans-serif-medium"
android:textSize="12dp" android:textSize="12sp"
android:textColor="?android:textColorSecondary" android:textColor="?android:textColorSecondary"
android:textAllCaps="true" android:textAllCaps="true"
android:paddingTop="24dp" android:paddingTop="24dp"

View File

@ -23,7 +23,7 @@
android:textAllCaps="true" android:textAllCaps="true"
android:textColor="?android:textColorPrimary" android:textColor="?android:textColorPrimary"
android:fontFamily="sans-serif-medium" android:fontFamily="sans-serif-medium"
android:textSize="14dp" android:textSize="14sp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:singleLine="true" android:singleLine="true"
android:ellipsize="end" android:ellipsize="end"

View File

@ -12,13 +12,13 @@
<TextView <TextView
android:id="@+id/number" android:id="@+id/number"
android:layout_width="24dp" android:layout_width="24sp"
android:layout_height="24dp" android:layout_height="wrap_content"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:textColor="?android:colorAccent" android:textColor="?android:colorAccent"
android:fontFamily="sans-serif-condensed" android:fontFamily="sans-serif-condensed"
android:textStyle="bold" android:textStyle="bold"
android:textSize="22dp" android:textSize="22sp"
android:gravity="center" android:gravity="center"
android:includeFontPadding="false" android:includeFontPadding="false"
tools:text="1"/> tools:text="1"/>

View File

@ -14,7 +14,7 @@
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:textColor="?android:textColorPrimary" android:textColor="?android:textColorPrimary"
android:textSize="20dp" android:textSize="20sp"
android:fontFamily="sans-serif-medium" android:fontFamily="sans-serif-medium"
android:singleLine="true" android:singleLine="true"
android:ellipsize="end" android:ellipsize="end"
@ -26,7 +26,7 @@
android:layout_height="32dp" android:layout_height="32dp"
android:background="@drawable/bg_inline_button" android:background="@drawable/bg_inline_button"
android:textColor="?android:textColorPrimary" android:textColor="?android:textColorPrimary"
android:textSize="20dp" android:textSize="20sp"
android:fontFamily="sans-serif-medium" android:fontFamily="sans-serif-medium"
android:paddingLeft="4dp" android:paddingLeft="4dp"
android:paddingRight="4dp" android:paddingRight="4dp"

View File

@ -381,7 +381,7 @@
<style name="Widget.Mastodon.M3.Button" parent="android:Widget.Material.Button"> <style name="Widget.Mastodon.M3.Button" parent="android:Widget.Material.Button">
<item name="android:textAllCaps">false</item> <item name="android:textAllCaps">false</item>
<item name="android:textSize">14dp</item> <item name="android:textSize">14sp</item>
<item name="android:minHeight">40dp</item> <item name="android:minHeight">40dp</item>
<item name="android:fontFamily">sans-serif-medium</item> <item name="android:fontFamily">sans-serif-medium</item>
<item name="android:stateListAnimator">@null</item> <item name="android:stateListAnimator">@null</item>
@ -403,45 +403,45 @@
<style name="alert_title"> <style name="alert_title">
<item name="android:textColor">?android:textColorPrimary</item> <item name="android:textColor">?android:textColorPrimary</item>
<item name="android:textSize">24dp</item> <item name="android:textSize">24sp</item>
<item name="android:minHeight">38dp</item> <item name="android:minHeight">38dp</item>
<item name="android:gravity">center_vertical</item> <item name="android:gravity">center_vertical</item>
</style> </style>
<style name="m3_body_large"> <style name="m3_body_large">
<item name="android:textSize">16dp</item> <item name="android:textSize">16sp</item>
<item name="android:textColor">?android:textColorPrimary</item> <item name="android:textColor">?android:textColorPrimary</item>
<item name="android:lineSpacingExtra">5dp</item> <item name="android:lineSpacingExtra">5dp</item>
</style> </style>
<style name="m3_body_medium"> <style name="m3_body_medium">
<item name="android:textSize">14dp</item> <item name="android:textSize">14sp</item>
<item name="android:textColor">?android:textColorPrimary</item> <item name="android:textColor">?android:textColorPrimary</item>
<item name="android:lineSpacingExtra">4dp</item> <item name="android:lineSpacingExtra">4dp</item>
</style> </style>
<style name="m3_body_small"> <style name="m3_body_small">
<item name="android:textSize">12dp</item> <item name="android:textSize">12sp</item>
<item name="android:textColor">?android:textColorSecondary</item> <item name="android:textColor">?android:textColorSecondary</item>
<item name="android:lineSpacingExtra">2dp</item> <item name="android:lineSpacingExtra">2dp</item>
</style> </style>
<style name="m3_title_medium"> <style name="m3_title_medium">
<item name="android:fontFamily">sans-serif-medium</item> <item name="android:fontFamily">sans-serif-medium</item>
<item name="android:textSize">16dp</item> <item name="android:textSize">16sp</item>
<item name="android:textColor">?android:textColorPrimary</item> <item name="android:textColor">?android:textColorPrimary</item>
<item name="android:lineSpacingExtra">5dp</item> <item name="android:lineSpacingExtra">5dp</item>
</style> </style>
<style name="m3_title_small"> <style name="m3_title_small">
<item name="android:fontFamily">sans-serif-medium</item> <item name="android:fontFamily">sans-serif-medium</item>
<item name="android:textSize">14dp</item> <item name="android:textSize">14sp</item>
<item name="android:textColor">?android:textColorSecondary</item> <item name="android:textColor">?android:textColorSecondary</item>
</style> </style>
<style name="m3_label_medium"> <style name="m3_label_medium">
<item name="android:fontFamily">sans-serif-medium</item> <item name="android:fontFamily">sans-serif-medium</item>
<item name="android:textSize">12dp</item> <item name="android:textSize">12sp</item>
<item name="android:textColor">?android:textColorPrimary</item> <item name="android:textColor">?android:textColorPrimary</item>
<item name="android:lineSpacingMultiplier">1.14</item> <item name="android:lineSpacingMultiplier">1.14</item>
</style> </style>
@ -449,12 +449,12 @@
<style name="m3_label_large"> <style name="m3_label_large">
<item name="android:fontFamily">sans-serif-medium</item> <item name="android:fontFamily">sans-serif-medium</item>
<item name="android:textColor">?android:textColorSecondary</item> <item name="android:textColor">?android:textColorSecondary</item>
<item name="android:textSize">14dp</item> <item name="android:textSize">14sp</item>
</style> </style>
<style name="m3_title_large"> <style name="m3_title_large">
<item name="android:fontFamily">sans-serif-medium</item> <item name="android:fontFamily">sans-serif-medium</item>
<item name="android:textSize">22dp</item> <item name="android:textSize">22sp</item>
<item name="android:textColor">?android:textColorPrimary</item> <item name="android:textColor">?android:textColorPrimary</item>
</style> </style>
@ -465,12 +465,12 @@
</style> </style>
<style name="m3_headline_small"> <style name="m3_headline_small">
<item name="android:textSize">24dp</item> <item name="android:textSize">24sp</item>
<item name="android:textColor">?android:textColorPrimary</item> <item name="android:textColor">?android:textColorPrimary</item>
</style> </style>
<style name="m3_headline_medium"> <style name="m3_headline_medium">
<item name="android:textSize">28dp</item> <item name="android:textSize">28sp</item>
<item name="android:textColor">?android:textColorPrimary</item> <item name="android:textColor">?android:textColorPrimary</item>
<item name="android:lineSpacingExtra">3dp</item> <item name="android:lineSpacingExtra">3dp</item>
</style> </style>