Skip to content

Commit 204b086

Browse files
committed
Update icons for device types in brave sync
Add license headerss
1 parent 5388ecf commit 204b086

File tree

11 files changed

+77
-6
lines changed

11 files changed

+77
-6
lines changed

android/brave_java_resources.gni

+3-5
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ brave_java_resources = [
6666
"java/res/drawable-hdpi/search_engine_google.png",
6767
"java/res/drawable-hdpi/search_engine_qwant.png",
6868
"java/res/drawable-hdpi/search_engine_startpage.png",
69-
"java/res/drawable-hdpi/settings_desktop_mode.png",
7069
"java/res/drawable-hdpi/share_activity_background.png",
7170
"java/res/drawable-hdpi/share_icon.png",
7271
"java/res/drawable-hdpi/shortcut_incognito.png",
@@ -125,7 +124,6 @@ brave_java_resources = [
125124
"java/res/drawable-mdpi/search_engine_google.png",
126125
"java/res/drawable-mdpi/search_engine_qwant.png",
127126
"java/res/drawable-mdpi/search_engine_startpage.png",
128-
"java/res/drawable-mdpi/settings_desktop_mode.png",
129127
"java/res/drawable-mdpi/share_activity_background.png",
130128
"java/res/drawable-mdpi/share_icon.png",
131129
"java/res/drawable-mdpi/shortcut_incognito.png",
@@ -205,7 +203,6 @@ brave_java_resources = [
205203
"java/res/drawable-xhdpi/search_engine_google.png",
206204
"java/res/drawable-xhdpi/search_engine_qwant.png",
207205
"java/res/drawable-xhdpi/search_engine_startpage.png",
208-
"java/res/drawable-xhdpi/settings_desktop_mode.png",
209206
"java/res/drawable-xhdpi/share_activity_background.png",
210207
"java/res/drawable-xhdpi/share_icon.png",
211208
"java/res/drawable-xhdpi/shortcut_incognito.png",
@@ -263,7 +260,6 @@ brave_java_resources = [
263260
"java/res/drawable-xxhdpi/search_engine_google.png",
264261
"java/res/drawable-xxhdpi/search_engine_qwant.png",
265262
"java/res/drawable-xxhdpi/search_engine_startpage.png",
266-
"java/res/drawable-xxhdpi/settings_desktop_mode.png",
267263
"java/res/drawable-xxhdpi/share_activity_background.png",
268264
"java/res/drawable-xxhdpi/share_icon.png",
269265
"java/res/drawable-xxhdpi/shortcut_incognito.png",
@@ -315,7 +311,6 @@ brave_java_resources = [
315311
"java/res/drawable-xxxhdpi/plus.png",
316312
"java/res/drawable-xxxhdpi/search_engine_brave.png",
317313
"java/res/drawable-xxxhdpi/search_engine_startpage.png",
318-
"java/res/drawable-xxxhdpi/settings_desktop_mode.png",
319314
"java/res/drawable-xxxhdpi/share_activity_background.png",
320315
"java/res/drawable-xxxhdpi/share_icon.png",
321316
"java/res/drawable-xxxhdpi/shortcut_incognito.png",
@@ -538,6 +533,7 @@ brave_java_resources = [
538533
"java/res/drawable/ic_menu.xml",
539534
"java/res/drawable/ic_menu_close.xml",
540535
"java/res/drawable/ic_metamask.xml",
536+
"java/res/drawable/ic_monitor.xml",
541537
"java/res/drawable/ic_neon_color.xml",
542538
"java/res/drawable/ic_new_tab_page.xml",
543539
"java/res/drawable/ic_news.xml",
@@ -593,12 +589,14 @@ brave_java_resources = [
593589
"java/res/drawable/ic_shield_done_filled.xml",
594590
"java/res/drawable/ic_shield_done_outlined.xml",
595591
"java/res/drawable/ic_site_settings.xml",
592+
"java/res/drawable/ic_smartphone.xml",
596593
"java/res/drawable/ic_sol_asset_icon.xml",
597594
"java/res/drawable/ic_sol_color.xml",
598595
"java/res/drawable/ic_solana_eligible_ui_icon.xml",
599596
"java/res/drawable/ic_stats_notification_background.xml",
600597
"java/res/drawable/ic_suggestions.xml",
601598
"java/res/drawable/ic_sync.xml",
599+
"java/res/drawable/ic_tablet.xml",
602600
"java/res/drawable/ic_thank_you.xml",
603601
"java/res/drawable/ic_timer.xml",
604602
"java/res/drawable/ic_tipping_error.xml",

android/java/org/chromium/chrome/browser/settings/BraveSyncScreensPreference.java

+32
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,24 @@ public class BraveSyncScreensPreference extends BravePreferenceFragment
149149
private AlertDialog mFinalWarningDialog;
150150
private TabLayout mTabLayout;
151151

152+
// Below enum is matching the values of GetDeviceTypeString() in brave_device_info.cc
153+
public enum DeviceType {
154+
UNKNOWN("unknown"),
155+
DESKTOP("desktop_or_laptop"),
156+
PHONE("phone"),
157+
TABLET("tablet");
158+
159+
final String mType;
160+
161+
DeviceType(final String type) {
162+
mType = type;
163+
}
164+
165+
public String getValue() {
166+
return mType;
167+
}
168+
}
169+
152170
BraveSyncWorker getBraveSyncWorker() {
153171
return BraveSyncWorker.get();
154172
}
@@ -282,6 +300,20 @@ public void run() {
282300
if (null != listItemView
283301
&& null != separator
284302
&& null != insertPoint) {
303+
ImageView imageView =
304+
(ImageView)
305+
listItemView.findViewById(
306+
R.id.brave_sync_device_image);
307+
int deviceTypeRes = R.drawable.ic_monitor;
308+
if (DeviceType.PHONE.getValue().equals(device.mType)) {
309+
deviceTypeRes = R.drawable.ic_smartphone;
310+
} else if (DeviceType.TABLET
311+
.getValue()
312+
.equals(device.mType)) {
313+
deviceTypeRes = R.drawable.ic_tablet;
314+
}
315+
imageView.setImageResource(deviceTypeRes);
316+
285317
TextView textView =
286318
(TextView)
287319
listItemView.findViewById(
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!-- Copyright (c) 2024 The Brave Authors. All rights reserved.
2+
This Source Code Form is subject to the terms of the Mozilla Public
3+
License, v. 2.0. If a copy of the MPL was not distributed with this file,
4+
You can obtain one at https://mozilla.org/MPL/2.0/. -->
5+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
6+
android:width="24dp"
7+
android:height="24dp"
8+
android:viewportWidth="24"
9+
android:viewportHeight="24">
10+
<path
11+
android:fillColor="#FF62757E"
12+
android:fillType="evenOdd"
13+
android:pathData="M20.33 17.33h-7.5V19h2.53a0.83 0.83 0 1 1 0 1.67H8.7a0.83 0.83 0 1 1 0-1.67h2.47v-1.67h-7.5A1.67 1.67 0 0 1 2 15.67v-10A1.67 1.67 0 0 1 3.67 4h16.66C21.25 4 22 4.75 22 5.67v10c0 0.92-0.75 1.66-1.67 1.66ZM3.67 5.67v10h16.66v-10H3.67Z"/>
14+
</vector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!-- Copyright (c) 2024 The Brave Authors. All rights reserved.
2+
This Source Code Form is subject to the terms of the Mozilla Public
3+
License, v. 2.0. If a copy of the MPL was not distributed with this file,
4+
You can obtain one at https://mozilla.org/MPL/2.0/. -->
5+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
6+
android:width="24dp"
7+
android:height="24dp"
8+
android:viewportWidth="24"
9+
android:viewportHeight="24">
10+
<path
11+
android:fillColor="#FF62757E"
12+
android:fillType="evenOdd"
13+
android:pathData="M8.25 2.3c-0.8 0-1.45 0.65-1.45 1.45v16.5c0 0.8 0.65 1.45 1.45 1.45h7.5c0.8 0 1.45-0.65 1.45-1.45V3.75c0-0.8-0.65-1.45-1.45-1.45H14.3V3a0.8 0.8 0 0 1-0.8 0.8h-3A0.8 0.8 0 0 1 9.7 3V2.3H8.25Zm7.5-1.6h-7.5A3.05 3.05 0 0 0 5.2 3.75v16.5a3.05 3.05 0 0 0 3.05 3.05h7.5a3.05 3.05 0 0 0 3.05-3.05V3.75a3.05 3.05 0 0 0-3.05-3.05ZM10.5 19.45a0.8 0.8 0 1 0 0 1.6h3a0.8 0.8 0 0 0 0-1.6h-3Z"/>
14+
</vector>
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!-- Copyright (c) 2024 The Brave Authors. All rights reserved.
2+
This Source Code Form is subject to the terms of the Mozilla Public
3+
License, v. 2.0. If a copy of the MPL was not distributed with this file,
4+
You can obtain one at https://mozilla.org/MPL/2.0/. -->
5+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
6+
android:width="24dp"
7+
android:height="24dp"
8+
android:viewportWidth="24"
9+
android:viewportHeight="24">
10+
<path
11+
android:fillColor="#FF62757E"
12+
android:fillType="evenOdd"
13+
android:pathData="M3.7 4.5a3.05 3.05 0 0 1 3.05-3.05h10.5A3.05 3.05 0 0 1 20.3 4.5v15a3.05 3.05 0 0 1-3.05 3.05H6.75A3.05 3.05 0 0 1 3.7 19.5v-15Zm3.05-1.45C5.95 3.05 5.3 3.7 5.3 4.5v15c0 0.8 0.65 1.45 1.45 1.45h10.5c0.8 0 1.45-0.65 1.45-1.45v-15c0-0.8-0.65-1.45-1.45-1.45H6.75ZM9.7 19.5a0.8 0.8 0 0 1 0.8-0.8h3a0.8 0.8 0 1 1 0 1.6h-3a0.8 0.8 0 0 1-0.8-0.8Z"/>
14+
</vector>

android/java/res/layout/brave_sync_device.xml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<ImageView android:id="@+id/brave_sync_device_image"
1818
android:layout_width="wrap_content"
1919
android:layout_height="wrap_content"
20-
android:src="@drawable/settings_desktop_mode"
2120
android:layout_centerVertical="true"
2221
android:contentDescription="@string/brave_sync_btn_mobile" />
2322

0 commit comments

Comments
 (0)