feat(StatusDisplay): add toolTip/ContentDescription to visibilty icon
This commit is contained in:
parent
369902ffe5
commit
6c1424055f
|
@ -2,6 +2,7 @@ package org.joinmastodon.android.ui.displayitems;
|
|||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextUtils;
|
||||
|
@ -100,6 +101,11 @@ public class ExtendedFooterStatusDisplayItem extends StatusDisplayItem{
|
|||
case PRIVATE -> R.drawable.ic_fluent_people_checkmark_20_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));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1004,4 +1004,13 @@ public class UiUtils{
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getVisibilityText(Status status) {
|
||||
return MastodonApp.context.getString(switch (status.visibility) {
|
||||
case PUBLIC -> R.string.visibility_public;
|
||||
case UNLISTED -> R.string.sk_visibility_unlisted;
|
||||
case PRIVATE -> R.string.visibility_followers_only;
|
||||
case DIRECT -> R.string.visibility_private;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue