diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/BaseAccountListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/BaseAccountListFragment.java index c70e83129..6a7fb48b6 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/BaseAccountListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/BaseAccountListFragment.java @@ -295,7 +295,6 @@ public abstract class BaseAccountListFragment extends BaseRecyclerFragment largestWidth) largestWidth = width; + } + for (String str : otherStrings) { + float width = paint.measureText(str); + if (width > largestWidth) largestWidth = width; + } + float textWidth = paint.measureText(openInBrowserText); + float missingWidth = Math.max(0, largestWidth - textWidth); + float singleSpaceWidth = paint.measureText(" "); + int howManySpaces = (int) Math.ceil(missingWidth / singleSpaceWidth); + String enlargedText = openInBrowserText + " ".repeat(howManySpaces); + menu.findItem(R.id.open_in_browser).setTitle(enlargedText); + } else { + menu.findItem(R.id.open_in_browser).setTitle(openInBrowserText); + } } } } diff --git a/mastodon/src/main/res/menu/post.xml b/mastodon/src/main/res/menu/post.xml index 9fe389962..ad1e2209c 100644 --- a/mastodon/src/main/res/menu/post.xml +++ b/mastodon/src/main/res/menu/post.xml @@ -8,11 +8,11 @@ + + - - diff --git a/mastodon/src/main/res/menu/profile.xml b/mastodon/src/main/res/menu/profile.xml index e3cc847d1..3a0e39c43 100644 --- a/mastodon/src/main/res/menu/profile.xml +++ b/mastodon/src/main/res/menu/profile.xml @@ -1,15 +1,15 @@ - + + - + - \ No newline at end of file