zixpo / candybar

Dashboard for Android Icon Packs. Supported by the community.
Apache License 2.0
299 stars 54 forks source link

Add Samsung OneUI #122

Closed moertel closed 1 year ago

moertel commented 1 year ago

This PR adds functionality to detect Samsung OneUI launcher and gives instructions to apply third-party icon packs.

Samsung's OneUI launcher version is tightly coupled to the Android OS version. Starting OneUI 3.1.1, icon theming is supported on Android 11, foldable devices only[1] Starting OneUI 4.0, icon theming is supported on all Android 12 devices[2]

Sadly it's impossible to detect the OneUI version programmatically[3].

Technically it's incorrect to report all Android 11 devices as incompatible but the only other option is to try and list out all device models individually. This commit adds the display of a "please update to Android 12" message to anyone running Android 11 or lower, and displays step-by-step theming instructions to everyone else.

[1] https://www.androidpolice.com/how-to-use-custom-icon-packs-on-samsung-one-ui-4/ [2] https://en.wikipedia.org/wiki/One_UI#One_UI_4_2 [3] https://github.com/zixpo/candybar/pull/122#issuecomment-1510379686

Behaviour & UI

Displayed on Android 11 or lower Displayed on Android 12 and up
"OK" opens software update "OK" opens "Theme Park" in Galaxy Store

Verified

The behaviour described above has been tested on the devices and Android versions below:

Device Model Android One UI Behaviour
S10 Duos SM-G973F 9 1.1 Launcher detected, sees ⚠️ "please update" dialog
S10 Duos SM-G973F 10 2.5 Launcher detected, sees ⚠️ "please update" dialog
S10 Duos SM-G973F 11 3.1 Launcher detected, sees ⚠️ "please update" dialog
S10 Duos SM-G973F 12 4.0 Launcher detected, sees 📗 step-by-step instructions
S23 Ultra SM-S918B 13 5.1 Launcher detected, sees 📗 step-by-step instructions
Donnnno commented 1 year ago

Wow! This is huge!!! Thank you for this :))

moertel commented 1 year ago

Demo video:

https://user-images.githubusercontent.com/1823966/232307563-ad589980-90ce-4803-a2b6-fb2ab2913b88.mp4

moertel commented 1 year ago

https://www.androidpolice.com/how-to-use-custom-icon-packs-on-samsung-one-ui-4/

How to apply custom icon packs. Before we begin, we should clarify that while we refer to this as a One UI 4 feature, it was introduced in One UI 3.1.1. That version was exclusive to foldable phones, though, so icon packs have only really made it to the majority of Samsung phones with One UI 4.

Looks like some One UI version detection is necessary. I'll gradually update my old Samsung through One UI 1, 2, 3, 4 and 5 and see where the "Icon" option starts appearing in Theme Park, just to cross-check what that article says.

Edit: Samsung is torturing me. There's no way to determine the One UI version. While there's a property ro.oneui.version, it sadly only returns things like kalama or exynos9820. 🙃 Dumped everything else from System.getProperties() but no indication of the One UI version number anywhere.

Edit 2: So OneUI 4.0 was introduced in a bundle with Android 12. That means on an Android 11 device we would be sure that the Theme Park workaround is not working, and could display a corresponding message.

moertel commented 1 year ago

@sarsamurmu this is now ready for review. I falsely tell users of foldable Samsung devices on Android 11 that their OneUI version is incompatible but as there is no way to detect the OneUI version programmatically, and as non-foldable devices on Android 11 are definitely not compatible, this was the best I could do.

Screenshots and demo video included in the comments. I'm releasing this to my own users this week and will report back if I spot issues.

moertel commented 1 year ago

FYI, I wanted to report back that this has now been published in my own icon packs for little over a week and it's working great. No complaints, and quite a few comments from happy Samsung users.