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

Issue 2431243003: bluetooth: Show connected icon for connected devices. (Closed)

Created:
4 years, 2 months ago by ortuno
Modified:
3 years, 9 months ago
Reviewers:
Ian Wen
CC:
agrieve+watch_chromium.org, chromium-reviews, jbudorick+watch_chromium.org, mikecase+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

bluetooth: Show connected icon for connected devices. Modifies ItemChooserDialog to support icons and shows an icon when a bluetooth device is connected. BUG=543466

Patch Set 1 #

Patch Set 2 : Rebase #

Total comments: 7

Messages

Total messages: 4 (1 generated)
ortuno
Hi Ian. Rather than going straight for the signal indicator I thought it would be ...
4 years, 2 months ago (2016-10-20 04:15:07 UTC) #2
Ian Wen
On 2016/10/20 04:15:07, ortuno wrote: > Hi Ian. Rather than going straight for the signal ...
4 years, 1 month ago (2016-10-26 21:53:18 UTC) #3
Ian Wen
4 years, 1 month ago (2016-10-26 21:53:32 UTC) #4
https://codereview.chromium.org/2431243003/diff/20001/chrome/android/java/res...
File chrome/android/java/res/drawable/ic_bluetooth_connected_grey.xml (right):

https://codereview.chromium.org/2431243003/diff/20001/chrome/android/java/res...
chrome/android/java/res/drawable/ic_bluetooth_connected_grey.xml:13:
android:fillColor="#757575"/>
Since you are using color list to tint this drawable, I would remove "grey" in
the filename because the default color doesn't matter.

https://codereview.chromium.org/2431243003/diff/20001/chrome/android/java/res...
File chrome/android/java/res/layout/item_chooser_dialog_row.xml (right):

https://codereview.chromium.org/2431243003/diff/20001/chrome/android/java/res...
chrome/android/java/res/layout/item_chooser_dialog_row.xml:11: <!--
contentDescription is added at runtime. -->
Please fix the indentation. Child element should intent by 4 letters.

https://codereview.chromium.org/2431243003/diff/20001/chrome/android/java/src...
File
chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java
(right):

https://codereview.chromium.org/2431243003/diff/20001/chrome/android/java/src...
chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java:365:
// if (isGATTConnected) {
1. Please remove dead comments and merge #366-367 with #363-364.
2. Shall we check if there is already an item in the dialog. If so we don't need
to create new drawable anymore?

https://codereview.chromium.org/2431243003/diff/20001/chrome/android/java/src...
File chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java
(right):

https://codereview.chromium.org/2431243003/diff/20001/chrome/android/java/src...
chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java:212:
String key, String description, Drawable icon, String iconDescription) {
Nit: add @nullable before icon and iconDescription.

https://codereview.chromium.org/2431243003/diff/20001/chrome/android/java/src...
chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java:228:
if (icon != null && (oldItem.mIcon == null
I feel like this equality check is not necessary. If the user of the dialog
wants to remove icons to some rows, I think you should let them do it.

https://codereview.chromium.org/2431243003/diff/20001/chrome/android/java/src...
chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java:353:
if (mItemsWithIcons.isEmpty()) {
It seems this HashSet is only used here and it's used as if a boolean. Shall we
toggle the visibility of the image view based on whether mIcon of the item is
null?

How about something like this:

Drawable drawable = getItem(position).mIcon;
if (drawable != null) {
    row.mImageView.setImageDrawable(drawable);
}
row.mImageView.setVisibility(drawable == null ? View.GONE : View.VISIBLE);

https://codereview.chromium.org/2431243003/diff/20001/chrome/android/java/src...
chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java:544:
public void addOrUpdateItem(
Javadoc plz. :)

Powered by Google App Engine
This is Rietveld 408576698