Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: mobile/android/base/java/org/mozilla/gecko/menu/GeckoMenu.java

Issue 29505613: Issue 5470 - Clipped text 'Block ads on this site' in dropdown menu (Closed)
Patch Set: Created Aug. 4, 2017, 10:08 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mobile/android/base/java/org/mozilla/gecko/menu/GeckoMenu.java
===================================================================
--- a/mobile/android/base/java/org/mozilla/gecko/menu/GeckoMenu.java
+++ b/mobile/android/base/java/org/mozilla/gecko/menu/GeckoMenu.java
@@ -835,17 +835,28 @@ public class GeckoMenu extends ListView
listView.performItemClick(actionView, pos + listView.getHeaderViewsCount(), id);
}
});
}
// Initialize the view.
view.setShowIcon(mShowIcons);
view.initialize(item);
- return (View) view;
+
+ // Dropdown menu items can be up to 2 lines long
+ // See https://issues.adblockplus.org/ticket/5470
+ if (view instanceof android.widget.TextView)
+ {
+ final android.widget.TextView textView = (android.widget.TextView) view;
+ textView.setSingleLine(false);
+ textView.setMaxLines(2);
+ textView.setEllipsize(android.text.TextUtils.TruncateAt.END);
+ }
+
+ return (View) view;
}
@Override
public int getItemViewType(int position) {
return getItem(position).getGeckoActionProvider() == null ? VIEW_TYPE_DEFAULT : VIEW_TYPE_ACTION_MODE;
}
@Override
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld