refactor: use getContentDescription instead of duplicate code
This commit is contained in:
parent
871c17cbe2
commit
a782160dd3
|
@ -130,7 +130,7 @@ public class AudioStatusDisplayItem extends StatusDisplayItem{
|
||||||
playPauseBtn.setImageResource(playing ? R.drawable.ic_fluent_pause_circle_24_filled : R.drawable.ic_fluent_play_circle_24_filled);
|
playPauseBtn.setImageResource(playing ? R.drawable.ic_fluent_pause_circle_24_filled : R.drawable.ic_fluent_play_circle_24_filled);
|
||||||
playPauseBtn.setContentDescription(MastodonApp.context.getResources().getString(playing ? R.string.pause : R.string.play));
|
playPauseBtn.setContentDescription(MastodonApp.context.getResources().getString(playing ? R.string.pause : R.string.play));
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
playPauseBtn.setTooltipText(MastodonApp.context.getResources().getString(playing ? R.string.pause : R.string.play));
|
playPauseBtn.setTooltipText(playPauseBtn.getContentDescription());
|
||||||
}
|
}
|
||||||
if(!playing){
|
if(!playing){
|
||||||
lastRemainingSeconds=-1;
|
lastRemainingSeconds=-1;
|
||||||
|
|
|
@ -102,10 +102,10 @@ public class ExtendedFooterStatusDisplayItem extends StatusDisplayItem{
|
||||||
case DIRECT -> R.drawable.ic_fluent_mention_24_regular;
|
case DIRECT -> R.drawable.ic_fluent_mention_24_regular;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
visibility.setTooltipText(UiUtils.getVisibilityText(s));
|
|
||||||
}
|
|
||||||
visibility.setContentDescription(UiUtils.getVisibilityText(s));
|
visibility.setContentDescription(UiUtils.getVisibilityText(s));
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
visibility.setTooltipText(visibility.getContentDescription());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue