Skip to content

Commit 6b86eff

Browse files
gabrielluongpchevrel@mozilla.com
authored andcommitted
Bug 1992035 - Update default top sites for JP region a=pascalc
- Bundle the favicon image URL to be loaded for the JP listed default top sites. Original Revision: https://phabricator.services.mozilla.com/D267523 Differential Revision: https://phabricator.services.mozilla.com/D272667
1 parent c28b4e3 commit 6b86eff

File tree

2 files changed

+77
-3
lines changed

2 files changed

+77
-3
lines changed

mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/topsites/TopSites.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,15 +435,24 @@ private fun TopSiteFaviconCard(
435435
shape = RoundedCornerShape(4.dp),
436436
) {
437437
if (topSite is TopSite.Provided) {
438-
TopSiteFavicon(topSite.url, topSite.imageUrl)
438+
TopSiteFavicon(url = topSite.url, imageUrl = topSite.imageUrl)
439439
} else {
440-
TopSiteFavicon(topSite.url)
440+
TopSiteFavicon(url = topSite.url, imageUrl = getImageUrl(url = topSite.url))
441441
}
442442
}
443443
}
444444
}
445445
}
446446

447+
private fun getImageUrl(url: String): String? {
448+
return when (url) {
449+
"https://tenki.jp/" -> "https://tenki.jp/favicon.ico"
450+
"https://m.yahoo.co.jp/" -> "https://s.yimg.jp/c/icon/s/bsc/2.0/favicon.ico"
451+
"https://ameblo.jp/" -> "https://stat100.ameba.jp/common_style/img/favicon.ico"
452+
else -> null
453+
}
454+
}
455+
447456
@Composable
448457
private fun TopSiteFavicon(url: String, imageUrl: String? = null) {
449458
Favicon(url = url, size = TOP_SITES_FAVICON_SIZE.dp, imageUrl = imageUrl)

mobile/android/fenix/app/src/main/res/raw/initial_shortcuts.json

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,79 @@
2727
"schema": 1,
2828
"exclude_locales": [],
2929
"exclude_regions": [
30-
"CN"
30+
"CN",
31+
"JP"
3132
],
3233
"include_locales": [],
3334
"include_regions": [],
3435
"exclude_experiments": [],
3536
"include_experiments": [],
3637
"id": "",
3738
"last_modified": 1
39+
},
40+
{
41+
"url": "https://tenki.jp/",
42+
"order": 1,
43+
"title": "tenki.jp",
44+
"schema": 1,
45+
"exclude_locales": [],
46+
"exclude_regions": [],
47+
"include_locales": [],
48+
"include_regions": [
49+
"JP"
50+
],
51+
"exclude_experiments": [],
52+
"include_experiments": [],
53+
"id": "",
54+
"last_modified": 1
55+
},
56+
{
57+
"url": "https://m.yahoo.co.jp/",
58+
"order": 2,
59+
"title": "Yahoo! JAPAN",
60+
"schema": 1,
61+
"exclude_locales": [],
62+
"exclude_regions": [],
63+
"include_locales": [],
64+
"include_regions": [
65+
"JP"
66+
],
67+
"exclude_experiments": [],
68+
"include_experiments": [],
69+
"id": "",
70+
"last_modified": 1
71+
},
72+
{
73+
"url": "https://ameblo.jp/",
74+
"order": 3,
75+
"title": "Amebaブログ",
76+
"schema": 1,
77+
"exclude_locales": [],
78+
"exclude_regions": [],
79+
"include_locales": [],
80+
"include_regions": [
81+
"JP"
82+
],
83+
"exclude_experiments": [],
84+
"include_experiments": [],
85+
"id": "",
86+
"last_modified": 1
87+
},
88+
{
89+
"url": "https://ja.wikipedia.org/wiki/%E3%83%A1%E3%82%A4%E3%83%B3%E3%83%9A%E3%83%BC%E3%82%B8",
90+
"order": 4,
91+
"title": "ウィキペディア",
92+
"schema": 1,
93+
"exclude_locales": [],
94+
"exclude_regions": [],
95+
"include_locales": [],
96+
"include_regions": [
97+
"JP"
98+
],
99+
"exclude_experiments": [],
100+
"include_experiments": [],
101+
"id": "",
102+
"last_modified": 1
38103
}
39104
]
40105
}

0 commit comments

Comments
 (0)