Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Unified Diff: ui/android/java/src/org/chromium/ui/DropdownAdapter.java

Issue 2664083007: Always adds margin at the end of the label to handle case where label (Closed)
Patch Set: Sets label's layout params to sublabel only when label and sublabel are not on the same line. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
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: ui/android/java/src/org/chromium/ui/DropdownAdapter.java
diff --git a/ui/android/java/src/org/chromium/ui/DropdownAdapter.java b/ui/android/java/src/org/chromium/ui/DropdownAdapter.java
index 28483d08125239592a9e418a43fd8b6b7b9728cc..c6ce8dca4d87eb38f052510d57fbb8993e58abc1 100644
--- a/ui/android/java/src/org/chromium/ui/DropdownAdapter.java
+++ b/ui/android/java/src/org/chromium/ui/DropdownAdapter.java
@@ -190,7 +190,11 @@ public class DropdownAdapter extends ArrayAdapter<DropdownItem> {
if (TextUtils.isEmpty(sublabel)) {
sublabelView.setVisibility(View.GONE);
} else {
- sublabelView.setLayoutParams(layoutParams);
+ // Use the layout params in |dropdown_item.xml| for the sublabel if it is on the same
+ // line as the label.
+ if (!item.isLabelAndSublabelOnSameLine()) {
+ sublabelView.setLayoutParams(layoutParams);
Ted C 2017/02/02 23:19:22 by conditionally overwriting the layout params, if
csashi 2017/02/03 00:03:37 Done.
+ }
sublabelView.setText(sublabel);
sublabelView.setTextSize(TypedValue.COMPLEX_UNIT_PX,
mContext.getResources().getDimension(item.getSublabelFontSizeResId()));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698