Add tooltips to some icon buttons

closes #423
This commit is contained in:
Grishka 2022-11-26 20:21:48 +03:00
parent 5a681d3557
commit 06cb335a0a
2 changed files with 9 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import android.app.ProgressDialog;
import android.graphics.Outline; import android.graphics.Outline;
import android.graphics.drawable.Animatable; import android.graphics.drawable.Animatable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.text.SpannableStringBuilder; import android.text.SpannableStringBuilder;
import android.text.TextUtils; import android.text.TextUtils;
@ -209,6 +210,9 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
if(item.hasVisibilityToggle){ if(item.hasVisibilityToggle){
visibility.setImageResource(item.status.spoilerRevealed ? R.drawable.ic_visibility_off : R.drawable.ic_visibility); visibility.setImageResource(item.status.spoilerRevealed ? R.drawable.ic_visibility_off : R.drawable.ic_visibility);
visibility.setContentDescription(item.parentFragment.getString(item.status.spoilerRevealed ? R.string.hide_content : R.string.reveal_content)); visibility.setContentDescription(item.parentFragment.getString(item.status.spoilerRevealed ? R.string.hide_content : R.string.reveal_content));
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.O){
visibility.setTooltipText(visibility.getContentDescription());
}
} }
itemView.setPadding(itemView.getPaddingLeft(), itemView.getPaddingTop(), itemView.getPaddingRight(), item.needBottomPadding ? V.dp(16) : 0); itemView.setPadding(itemView.getPaddingLeft(), itemView.getPaddingTop(), itemView.getPaddingRight(), item.needBottomPadding ? V.dp(16) : 0);
if(TextUtils.isEmpty(item.extraText)){ if(TextUtils.isEmpty(item.extraText)){

View File

@ -179,6 +179,7 @@
android:tint="@color/compose_button" android:tint="@color/compose_button"
android:tintMode="src_in" android:tintMode="src_in"
android:contentDescription="@string/add_media" android:contentDescription="@string/add_media"
android:tooltipText="@string/add_media"
android:src="@drawable/ic_fluent_image_24_regular"/> android:src="@drawable/ic_fluent_image_24_regular"/>
<ImageButton <ImageButton
@ -191,6 +192,7 @@
android:tint="@color/compose_button" android:tint="@color/compose_button"
android:tintMode="src_in" android:tintMode="src_in"
android:contentDescription="@string/add_poll" android:contentDescription="@string/add_poll"
android:tooltipText="@string/add_poll"
android:src="@drawable/ic_fluent_poll_24_selector"/> android:src="@drawable/ic_fluent_poll_24_selector"/>
<ImageButton <ImageButton
@ -203,6 +205,7 @@
android:tint="@color/compose_button" android:tint="@color/compose_button"
android:tintMode="src_in" android:tintMode="src_in"
android:contentDescription="@string/emoji" android:contentDescription="@string/emoji"
android:tooltipText="@string/emoji"
android:src="@drawable/ic_fluent_emoji_24_selector"/> android:src="@drawable/ic_fluent_emoji_24_selector"/>
<ImageButton <ImageButton
@ -215,6 +218,7 @@
android:tint="@color/compose_button" android:tint="@color/compose_button"
android:tintMode="src_in" android:tintMode="src_in"
android:contentDescription="@string/content_warning" android:contentDescription="@string/content_warning"
android:tooltipText="@string/content_warning"
android:src="@drawable/ic_fluent_chat_warning_24_selector"/> android:src="@drawable/ic_fluent_chat_warning_24_selector"/>
<ImageButton <ImageButton
@ -227,6 +231,7 @@
android:tint="@color/compose_button" android:tint="@color/compose_button"
android:tintMode="src_in" android:tintMode="src_in"
android:contentDescription="@string/post_visibility" android:contentDescription="@string/post_visibility"
android:tooltipText="@string/post_visibility"
android:src="@drawable/ic_fluent_earth_24_regular"/> android:src="@drawable/ic_fluent_earth_24_regular"/>
<Space <Space