Hides text on ButtonDropTargets if any of them are ellipsized.

This can happen on small devices or on devices where Font/Display size
is enlarged and when Developer Options is turned on when all three
options {Uninstall, Delete, App Info} are shown at once.

Bug: 64391860
Change-Id: If355d28087d53148114eb586efb3c26f158b3713
This commit is contained in:
Jon Miranda
2017-08-21 15:31:51 -07:00
parent 9b745a82bf
commit bfaa4a4edc
3 changed files with 85 additions and 2 deletions

View File

@@ -65,9 +65,11 @@ public class DeleteDropTarget extends ButtonDropTarget {
* Set the drop target's text to either "Remove" or "Cancel" depending on the drag source.
*/
public void setTextBasedOnDragSource(DragSource dragSource) {
if (!TextUtils.isEmpty(getText())) {
setText(dragSource.supportsDeleteDropTarget() ? R.string.remove_drop_target_label
if (!TextUtils.isEmpty(mText)) {
mText = getResources().getString(dragSource.supportsDeleteDropTarget()
? R.string.remove_drop_target_label
: android.R.string.cancel);
requestLayout();
}
}