New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Switches] MD2 Switches still in use #2527
Comments
+1, it is a shame that a company as big as Google, with their large design team, couldn't finalize a switch design in months despite approving the M3 design language. Edit: and don't forget that MDC 1.5 is stable now, with no switch redesign. When I posted an issue about this MDC 1.5 was in alpha so it was excusable as an alpha bug that will get fixed, whereas now it's less excusable. |
Agreed, if google can use it in their own apps we should be able to too. At this point it's like they've forgotten it or just wanna keep it closed or something. I thought material was aimed at bringing consistency over the platform unlike the holo era but all we have rn is platform and google apps having those switches while devs get overlooked. Funny thing is even google can't pick a side they're using 3 total switches. The one from Settings in some apps, MD2 in some and then a variation of the settings one with different tinted switches in others, kinda funny. |
And switches aren't even the only thing they can't agree on. Now Playing history is literally MD2 with Monet. |
Hi- Thanks for the feedback. We are working on an updated MDC Switch that will align the patterns you might have seen in Android 12, and make it available to all apps, including third party developed apps. Stay tuned for a timeline of delivery. |
An eternity ago we were given the same answer, it's been almost a whole year since the first android developer preview and if I dig into source history I can see commits refering to material next and other terms for MD3 from even longer so what I assume is it's been a long time since work has been on, why is something like switches not finalised especially when A12 API and MD3 components themselves are either finalised or in production? |
...which is almost exactly what another team member replied to me 2 months ago:
It is amazing how Google, a company with a large, world class design team, is still giving the same excuses when A12 has been out for months. Compare this to, for example, Apple, which usually release updated design SDKs on day one. Even Microsoft, which used to (at least with the methods I have tried) make making the top bar match the ones in system apps hard (and that's ignoring the multiple design languages in their system apps), updated their SDK to have all components from Windows 11 system apps. |
As a workaround for now, I've found that the following resources (borrowed from Doodle) emulate the A12 switches pretty well. It's not identical, but nothing is ever identical on android, so whatever.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#000000" />
<corners android:radius="56dp" />
<size
android:width="64dp"
android:height="28dp" />
</shape>
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="?attr/colorOnSurface" android:alpha="0.38" android:state_enabled="false" />
<item android:color="?attr/colorPrimary" android:state_checked="true" />
<item android:color="?attr/colorOnSurfaceVariant" />
</selector>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:bottom="4dp"
android:left="4dp"
android:right="4dp"
android:top="4dp">
<shape android:shape="oval">
<solid android:color="#000000" />
<size
android:width="20dp"
android:height="20dp" />
</shape>
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="?attr/colorOnSurface" android:alpha="0.12" android:state_enabled="false" />
<item android:color="?attr/colorOnPrimary" android:state_checked="true" />
<item android:color="?attr/colorSurfaceVariant" />
</selector> The end result should be this: Note: This hack won't work on API 21 or 22, as color selectors are not supported well on that version. |
Hey @OxygenCobalt , if you need I can get you the exact switch drawables as well (the ones used in AOSP) since I used them a few time ago as I got some aosp source experience so I could dig em out. They match AOSP 1:1 since they're from there literally 😅 Thank you for this though, thanks for doing Google's job like an absolute chad |
I'll be good, honestly. I feel like these switches complement my app better anyway as they rely on the M3 color roles instead of [what is probably] the raw color values in the case of AOSP.
Don't thank me, thank the dev of Doodle creating them in the first place. All I did was reshare what they made. |
not raw values they actually use dynamic colors, (https://github.com/aosp-mirror/platform_frameworks_base/blob/b4bcc8592581b412a9b67493ca2570f9e93389c0/packages/SettingsLib/SettingsTheme/res/values-v31/colors.xml#L29 thumb for example) you can use this for API 31 for a more consistent experience that frankly android lacks |
Thank you @OxygenCobalt and Doodle's devs for essentially doing Google's job. This will come in useful for my future apps. |
Update: Seems like b2a3fbe and this new Material Design Doc imply that we are finally getting the new switch design. Yay! |
Finally, after months of asking, we might soon get the new switch design. Though the design on the M3 website is different from the one used in Android, hopefully Google will start using the M3 website one everywhere. |
Looks like we have updated switches but they are vastly different from what is in AOSP, @andrelabonte and @drchen can you please tell us why? |
Why doesn't it work yet? |
...and I don't remember seeing that design in any Google app or Android 13's settings app. |
It's not released to a stable version yet. : ) (It will be, soon.) I think first-party apps will update the new design after we release a stable version. |
That's nice to know. |
Will it be stable in 1.7.0 @drchen? |
Yes. : ) |
Is your feature request related to a problem? Please describe.
It's been months since A12 came out, Google apps already use new switches (and inconsistently to remember that) but MD lib doesn't
Describe the solution you'd like
People have already made issues for this, the team just said the switches are not finalised but it has been months, you guys approved a whole new design language but couldn't approve switches? Not to forget the system is using those too. Give us the current design switches and if you change your mind later update them please I'm sick and tired if my apps looking inconsistent with the System.
The text was updated successfully, but these errors were encountered: