Commit 081097e1 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

weblayer: minor changes to the shell

When the non-editable view is clicked, clear the text in the non-editable
view and focus it. Clearing the text is useful as it's entirely possible
the url is out of date at this point. Focusing makes it so you can type
right away.

BUG=none
TEST=none

Change-Id: I73631ff68f8377c0ebc7ba897f0624f6698efb3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2186368Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766536}
parent c328f5f7
...@@ -123,7 +123,6 @@ public class WebLayerShellActivity extends FragmentActivity { ...@@ -123,7 +123,6 @@ public class WebLayerShellActivity extends FragmentActivity {
private ImageButton mMenuButton; private ImageButton mMenuButton;
private ViewSwitcher mUrlViewContainer; private ViewSwitcher mUrlViewContainer;
private EditText mEditUrlView; private EditText mEditUrlView;
// private View mNonEditUrlView;
private ProgressBar mLoadProgressBar; private ProgressBar mLoadProgressBar;
private View mMainView; private View mMainView;
private int mMainViewId; private int mMainViewId;
...@@ -266,8 +265,11 @@ public class WebLayerShellActivity extends FragmentActivity { ...@@ -266,8 +265,11 @@ public class WebLayerShellActivity extends FragmentActivity {
.setTextColor(android.R.color.black) .setTextColor(android.R.color.black)
.setIconColor(android.R.color.black) .setIconColor(android.R.color.black)
.build()); .build());
nonEditUrlView.setOnClickListener( nonEditUrlView.setOnClickListener(v -> {
v -> { mUrlViewContainer.setDisplayedChild(EDITABLE_URL_TEXT_VIEW); }); mEditUrlView.setText("");
mUrlViewContainer.setDisplayedChild(EDITABLE_URL_TEXT_VIEW);
mEditUrlView.requestFocus();
});
mUrlViewContainer.removeViewAt(NONEDITABLE_URL_TEXT_VIEW); mUrlViewContainer.removeViewAt(NONEDITABLE_URL_TEXT_VIEW);
mUrlViewContainer.addView(nonEditUrlView, NONEDITABLE_URL_TEXT_VIEW); mUrlViewContainer.addView(nonEditUrlView, NONEDITABLE_URL_TEXT_VIEW);
mUrlViewContainer.setDisplayedChild(NONEDITABLE_URL_TEXT_VIEW); mUrlViewContainer.setDisplayedChild(NONEDITABLE_URL_TEXT_VIEW);
......
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