Commit d83435a3 authored by Mugdha Lakhani's avatar Mugdha Lakhani Committed by Commit Bot

[WebLayer Shell] Clicking on UrlBarView shows EditText.

With this change:
https://chromium-review.googlesource.com/c/chromium/src/+/2274888
WebLayerShellActivity exercised the newly added setTextClickListener()
method on UrlBarOptions. This set the clicklistener passed in to the
UrlBarView's TextView only, which is working as intended.

However, the test team would like to retain the ability to click
anywhere on the UrlBarView other than the security button and be able to
show the editable text view.

This change adds that back. I have removed the setTextClickListener()
call since two click listeners doing the same thing on the non editable
text view is rendundant.

Before this change:
https://drive.google.com/file/d/16ttRlvh-AqObs4_pA9TiDSRUKVf6bcO-/view?usp=sharing
After this change:
https://drive.google.com/file/d/1y1vFCd4eObMs8C84862V7zQ53siMMKqJ/view?usp=sharing

Bug: 1114238
Change-Id: I98eb4314436dbf7d6509a77e4890d0f348b2eebb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362817Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Mugdha Lakhani <nator@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799583}
parent 2b08317c
...@@ -382,11 +382,6 @@ public class WebLayerShellActivity extends FragmentActivity { ...@@ -382,11 +382,6 @@ public class WebLayerShellActivity extends FragmentActivity {
.setTextSizeSP(DEFAULT_TEXT_SIZE) .setTextSizeSP(DEFAULT_TEXT_SIZE)
.setTextColor(android.R.color.black) .setTextColor(android.R.color.black)
.setIconColor(android.R.color.black) .setIconColor(android.R.color.black)
.setTextClickListener(v -> {
mEditUrlView.setText("");
mUrlViewContainer.setDisplayedChild(EDITABLE_URL_TEXT_VIEW);
mEditUrlView.requestFocus();
})
.setTextLongClickListener(v -> { .setTextLongClickListener(v -> {
ClipboardManager clipboard = ClipboardManager clipboard =
(ClipboardManager) v.getContext().getSystemService( (ClipboardManager) v.getContext().getSystemService(
...@@ -396,6 +391,11 @@ public class WebLayerShellActivity extends FragmentActivity { ...@@ -396,6 +391,11 @@ public class WebLayerShellActivity extends FragmentActivity {
return true; return true;
}) })
.build()); .build());
nonEditUrlView.setOnClickListener(v -> {
mEditUrlView.setText("");
mUrlViewContainer.setDisplayedChild(EDITABLE_URL_TEXT_VIEW);
mEditUrlView.requestFocus();
});
RelativeLayout nonEditUrlViewContainer = RelativeLayout nonEditUrlViewContainer =
mTopContentsContainer.findViewById(R.id.noneditable_url_view_container); mTopContentsContainer.findViewById(R.id.noneditable_url_view_container);
nonEditUrlViewContainer.addView(nonEditUrlView, nonEditUrlViewContainer.addView(nonEditUrlView,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment