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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java

Issue 2632493003: [Android History] Styling changes (Closed)
Patch Set: 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
Index: chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java
index 2eb056a180a8b87f7545016f5e3968e9b01bb12b..66d801f41a64ad3f21c6fafb9d8702012fa12bcd 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java
@@ -122,6 +122,19 @@ public class HistoryItemView extends SelectableItemView<HistoryItem> implements
updateRemoveButtonVisibility();
}
+ /**
+ * @param enabled Whether the remove button should be enabled.
+ */
+ public void setRemoveButtonEnabled(boolean enabled) {
+ // If the remove button is not enabled, its draw color will be the same as the background
+ // making it invisible, and it will not respond to touch events.
+ // Calling #setClickable(false) ensures that the parent view will receive the touch event
+ // instead. This is preferred to removing the item so that the rest of text in the
+ // HistoryItemView doesn't expand to fill the space the remove icon occupies.
+ mRemoveButton.setEnabled(enabled);
+ mRemoveButton.setClickable(enabled);
gone 2017/01/13 18:27:47 Would setting the button's visibility to INVISIBLE
Theresa 2017/01/13 19:40:28 Yes, done.
+ }
+
@Override
protected void onClick() {
if (getItem() != null) getItem().open();

Powered by Google App Engine
This is Rietveld 408576698