File tree Expand file tree Collapse file tree 2 files changed +77
-3
lines changed
mobile/android/fenix/app/src/main
java/org/mozilla/fenix/home/topsites Expand file tree Collapse file tree 2 files changed +77
-3
lines changed Original file line number Diff line number Diff 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
448457private fun TopSiteFavicon (url : String , imageUrl : String? = null) {
449458 Favicon (url = url, size = TOP_SITES_FAVICON_SIZE .dp, imageUrl = imageUrl)
Original file line number Diff line number Diff line change 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}
You can’t perform that action at this time.
0 commit comments