Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17443] Android: Include native Switch UI element

GitHub Issuen/a
TypeNew Feature
PriorityNone
StatusClosed
ResolutionDuplicate
Resolution Date2019-03-29T00:19:00.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labels2019-cl, supportTeam
ReporterMarco Cota
AssigneeAshraf Abu
Created2014-07-31T23:12:32.000+0000
Updated2019-03-29T00:21:08.000+0000

Description

Request

Currently when we create a Switch with the Titanium SDK in Android we are able to create a Toggle button, since Android 4.0 a new component has been include in the Android SDK called Switch which allow the user to create a toggle button in the form of a slider. Customer would like to have the Switch available in order to be used in the UI.

Info

https://developer.android.com/guide/topics/ui/controls/togglebutton.html https://developer.android.com/reference/android/widget/Switch.html

Comments

  1. Ingo Muschenetz 2014-08-01

    Do you have a suggestion on what we should call it? Or is it a parameter passed to the create command?
  2. Travis Crist 2014-08-01

    Ingo, I'm not sure if this is directed at me, but since I requested the feature I'll chime in. I think passing in a parameter would make the most sense. Maybe for android there could be a switchType parameter and it could be set to 'toggle' or 'switch'. I don't think a new command makes sense since its already called createSwitch and we want the switch. If you made a createToggle command and modified createSwitch there could be backwards compatibility issues so I think having a new parameter passed in makes the most sense. If the parameter is not set then it would default to the 'toggle' state to preserve backwards compatibility. I hope that helps, Travis
  3. Ashraf Abu 2014-12-19

  4. Joshua Quick 2019-03-29

    The "slider" style switch button was implemented in 2014 by [TIMOB-14178]. Can be seen in our docs here... https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Switch Closing as duplicate.

JSON Source