mirror of
https://github.com/mastodon/mastodon-android.git
synced 2024-12-25 16:24:06 +01:00
Fix alert text size
This commit is contained in:
parent
72f546ed15
commit
3e256d41d2
@ -50,6 +50,11 @@ public class M3AlertDialogBuilder extends AlertDialog.Builder{
|
||||
helpButton.setSelected(helpText.getVisibility()==View.VISIBLE);
|
||||
});
|
||||
setCustomTitle(titleLayout);
|
||||
}else if(!TextUtils.isEmpty(title)){
|
||||
View titleLayout=getContext().getSystemService(LayoutInflater.class).inflate(R.layout.alert_title, null);
|
||||
TextView title=titleLayout.findViewById(R.id.title);
|
||||
title.setText(this.title);
|
||||
setCustomTitle(titleLayout);
|
||||
}
|
||||
|
||||
alert=super.create();
|
||||
|
16
mastodon/src/main/res/layout/alert_title.xml
Normal file
16
mastodon/src/main/res/layout/alert_title.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="24dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:windowTitleStyle"
|
||||
tools:text="Title"/>
|
||||
|
||||
</LinearLayout>
|
@ -215,8 +215,6 @@
|
||||
|
||||
<style name="Theme.Mastodon.Dialog.Alert" parent="android:Theme.Material.Light.Dialog.Alert">
|
||||
<item name="android:windowTitleStyle">@style/alert_title</item>
|
||||
<!-- it's unfortunate that https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/com/android/internal/widget/DialogTitle.java exists -->
|
||||
<item name="android:textAppearanceMedium">@style/alert_title</item>
|
||||
<item name="android:dialogPreferredPadding">24dp</item>
|
||||
<item name="android:windowBackground">@drawable/bg_alert</item>
|
||||
<item name="android:buttonBarButtonStyle">@style/Widget.Mastodon.ButtonBarButton</item>
|
||||
@ -231,7 +229,6 @@
|
||||
|
||||
<style name="Theme.Mastodon.Dialog.Alert.Dark" parent="android:Theme.Material.Dialog.Alert">
|
||||
<item name="android:windowTitleStyle">@style/alert_title</item>
|
||||
<item name="android:textAppearanceMedium">@style/alert_title</item>
|
||||
<item name="android:dialogPreferredPadding">24dp</item>
|
||||
<item name="android:windowBackground">@drawable/bg_alert</item>
|
||||
<item name="android:buttonBarButtonStyle">@style/Widget.Mastodon.ButtonBarButton</item>
|
||||
|
Loading…
Reference in New Issue
Block a user