Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28300] Android: Add material "chip" style to Ti.UI.Switch

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2021-03-05T15:57:06.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.0.0
ComponentsAndroid
Labelsandroid, material-design, material-theme, style, switch
ReporterJoshua Quick
AssigneeJoshua Quick
Created2020-12-19T04:28:18.000+0000
Updated2021-03-05T15:57:06.000+0000

Description

*Summary:* Google supports a material "Chip" widget which is checkable. Our Ti.UI.Switch view should offer this as a style. https://material.io/components/chips *To-Do:* Update our [style](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Switch-property-style) property to support the following Android-only constant. * Ti.UI.SWITCH_STYLE_CHIP This can be implemented via the Java [Chip](https://developer.android.com/reference/com/google/android/material/chip/Chip) class. *Test Code:* Each switch style can be tested with the attached [^SwitchStyleTest.js], which will display what's shown below. !Switch-Android-Light.png|thumbnail! !Switch-Android-Dark.png|thumbnail! *Note:* The app must use a "Theme.MaterialComponents" based theme or else an exception will occur. So, app's using a custom theme based from "Theme.AppCompat" or similar will crash. This is normal and the exception will state that the theme will need to change.

Attachments

FileDateSize
Switch-Android-Dark.png2021-02-23T02:50:55.000+0000417430
Switch-Android-Light.png2021-02-23T02:50:55.000+0000419866
SwitchStyleTest.js2021-02-23T02:50:22.000+00001171

Comments

  1. Joshua Quick 2020-12-19

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12353
  2. Samir Mohammed 2021-03-04

    FR Passed, waiting on Jenkins build and backport
  3. Christopher Williams 2021-03-05

    merged to master and 10_0_X for 10.0.0 release target.

JSON Source