add mutuals follow button state

closes sk22#890
This commit is contained in:
sk 2023-10-22 23:09:35 +02:00
parent 3e28eb2ccf
commit 02983c76b9
5 changed files with 34 additions and 2 deletions

View File

@ -779,8 +779,8 @@ public class UiUtils {
button.setText(relationship.followedBy ? R.string.follow_back : R.string.button_follow);
styleRes=R.style.Widget_Mastodon_M3_Button_Filled;
}else{
button.setText(R.string.button_following);
styleRes=R.style.Widget_Mastodon_M3_Button_Tonal;
button.setText(relationship.followedBy ? R.string.sk_button_mutuals : R.string.button_following);
styleRes=relationship.followedBy ? R.style.Widget_Mastodon_M3_Button_Tonal_Outlined : R.style.Widget_Mastodon_M3_Button_Tonal;
}
TypedArray ta=button.getContext().obtainStyledAttributes(styleRes, new int[]{android.R.attr.background});

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/m3_primary_overlay">
<item android:gravity="center_vertical" android:height="40dp">
<selector>
<item android:state_enabled="true">
<shape>
<solid android:color="?colorM3SecondaryContainer"/>
<stroke android:color="?colorM3OnSecondaryContainer" android:width="1dp"/>
<corners android:radius="20dp"/>
</shape>
</item>
<item>
<shape>
<solid android:color="?colorM3DisabledBackground"/>
<corners android:radius="20dp"/>
</shape>
</item>
</selector>
</item>
<item android:id="@android:id/mask" android:gravity="center_vertical" android:height="40dp">
<shape>
<solid android:color="#000"/>
<corners android:radius="20dp"/>
</shape>
</item>
</ripple>

View File

@ -415,4 +415,5 @@
<string name="sk_settings_default_visibility">Standard-Sichtbarkeit für Posts</string>
<string name="sk_settings_lock_account">Neue Follower_innen manuell genehmigen</string>
<string name="sk_timeline_cache_cleared">Start-Timeline geleert</string>
<string name="sk_button_mutuals">Befreundet</string>
</resources>

View File

@ -416,4 +416,5 @@
<string name="sk_timeline_cache_cleared">Cleared home timeline cache</string>
<string name="sk_settings_lock_account">Manually approve new followers</string>
<string name="sk_settings_default_visibility">Default posting visibility</string>
<string name="sk_button_mutuals">Mutuals</string>
</resources>

View File

@ -224,6 +224,9 @@
<style name="Widget.Mastodon.M3.Button.Tonal.Icon">
<item name="android:paddingStart">16dp</item>
</style>
<style name="Widget.Mastodon.M3.Button.Tonal.Outlined">
<item name="android:background">@drawable/bg_button_m3_tonal_outlined</item>
</style>
<style name="Widget.Mastodon.M3.Button.Tonal.Error">
<item name="android:background">@drawable/bg_button_m3_tonal_error</item>