-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PwdMessageDialog] Introduce editable dropdown to input username for
update password dialog There are 2 parts in this CL: 1. It splits PasswordEditDialogView int 2 separate classes: one is used as the old view (when the feature flag is off), and the other as the new one. They share common parent class, which is also used in the binder. 2. AutoCompleteTextView is introduced in the new view, it allows both to type in the username and to edit it. It still needs to be styled appropriately to look more like spinner. This is work in progress. P. S. Username selection for the new PasswordEditDialogWithDetailsView is not implemented in this CL, because it requires changing the int parameter selectedUsernameId to String (because the goal is to allow typing in new usernames). The dropdown button will also be added in a separate CL. Bug: 1315916 Change-Id: I5f295b3d5798d7c48b0d783b239cea34b4b58dc7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3613277 Reviewed-by: Ioana Pandele <ioanap@chromium.org> Commit-Queue: Anna Tsvirchkova <atsvirchkova@google.com> Cr-Commit-Position: refs/heads/main@{#1001446}
- Loading branch information
Anna Tsvirchkova
authored and
Chromium LUCI CQ
committed
May 10, 2022
1 parent
7a34967
commit 0eb5648
Showing
13 changed files
with
608 additions
and
408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...droid/java/src/org/chromium/chrome/browser/password_edit_dialog/NoFilterArrayAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2022 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package org.chromium.chrome.browser.password_edit_dialog; | ||
|
||
import android.content.Context; | ||
import android.widget.ArrayAdapter; | ||
import android.widget.Filter; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* This is subclass of ArrayAdapter, which discards any filtering. | ||
* Can be used in {@link android.widget.AutoCompleteTextView} to show all string items, | ||
* no matter if those items have any overlapping with user-typed string. | ||
* @param <T> type of list-based item | ||
*/ | ||
class NoFilterArrayAdapter<T> extends ArrayAdapter<T> { | ||
private List<T> mItems; | ||
private NoFilter mFilter; | ||
|
||
public NoFilterArrayAdapter(@NonNull Context context, int resource, List<T> objects) { | ||
super(context, resource, objects); | ||
mItems = objects; | ||
mFilter = new NoFilter(); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public Filter getFilter() { | ||
return mFilter; | ||
} | ||
|
||
class NoFilter extends Filter { | ||
@Override | ||
protected FilterResults performFiltering(CharSequence arg0) { | ||
FilterResults result = new FilterResults(); | ||
result.values = mItems; | ||
result.count = mItems.size(); | ||
return result; | ||
} | ||
|
||
@Override | ||
protected void publishResults(CharSequence arg0, FilterResults arg1) { | ||
notifyDataSetChanged(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.