Skip to content

Commit

Permalink
[WebLayer Shell] Make URL TextView clickable again.
Browse files Browse the repository at this point in the history
I had removed the clicklistener on the TextView for the demo app
here:
https://chromium-review.googlesource.com/c/chromium/src/+/2362817

since I was setting it on the parent view. Turns out, to make the child
TextView clicks go up to the parent, I'll need to mark it non-clickable in the
layout xml, which we don't want to do for production.

Adding the click listener explicitly on the TextView fixes this.

Change-Id: I7feaf35a436abb4ca4313f94b12e448c74f58562
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2366900
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Mugdha Lakhani <nator@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800109}
  • Loading branch information
Mugdha Lakhani authored and Commit Bot committed Aug 20, 2020
1 parent b116dee commit 19d25cf
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@ public void onTabRemoved(Tab tab) {
.setTextSizeSP(DEFAULT_TEXT_SIZE)
.setTextColor(android.R.color.black)
.setIconColor(android.R.color.black)
.setTextClickListener(v -> {
mEditUrlView.setText("");
mUrlViewContainer.setDisplayedChild(EDITABLE_URL_TEXT_VIEW);
mEditUrlView.requestFocus();
})
.setTextLongClickListener(v -> {
ClipboardManager clipboard =
(ClipboardManager) v.getContext().getSystemService(
Expand Down

0 comments on commit 19d25cf

Please sign in to comment.