History log of /frameworks/base/core/java/android/widget/Switch.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
01a09630060eccc471ba3d8d83b34a602871d5c1 08-Dec-2014 Alan Viverette <alanv@google.com> Fix regression, don't NPE if Switch doesn't have a thumb set

BUG: 18670202
Change-Id: Iecb3498032c121c007ec87740ddebadb8e71c7a3
/frameworks/base/core/java/android/widget/Switch.java
d4e7790fee10e21b41a1c387c2734722bda56a0b 28-Oct-2014 Alan Viverette <alanv@google.com> Play CLICK sound effect when compound buttons are clicked

Also plays the sound effect when the switch changes state as a result
of dragging, since that's effectively the same as the click action.

BUG: 16308311
Change-Id: Ic187ece2a8190082617f5ac7aaf05c3511fa80b5
/frameworks/base/core/java/android/widget/Switch.java
b067405bf453289a6b6bfd34b06700f08be58c24 27-Sep-2014 Alan Viverette <alanv@google.com> Add callback to track and thumb drawables, propagate state in ASLD

BUG: 17665424
Change-Id: I22da4530f3e2869d856102e804f020461a46fe49
/frameworks/base/core/java/android/widget/Switch.java
467d629ca714cd74658043c1ddfec36c60d898c1 13-Aug-2014 Alan Viverette <alanv@google.com> Use correct checked value when animating Switch

BUG: 16984959
Change-Id: I1b4ffea568619663e26c097a28b86579d090c0ce
/frameworks/base/core/java/android/widget/Switch.java
0c0dde7171c7ea35bbc6d64a41f94b428cb4d1f6 30-Jul-2014 Alan Viverette <alanv@google.com> Update switch assets, fix SearchView asset 9-patch areas

BUG: 16606037
BUG: 16467249
Change-Id: I9a5888e37317d1f8a6481f9733f784bbd37268f3
/frameworks/base/core/java/android/widget/Switch.java
9b38f6c2cd1d97bb0d1a21e2f9545e02fae851e0 30-Jul-2014 Alan Viverette <alanv@google.com> Revert "Update switch assets, fix SearchView asset 9-patch areas"

Missing updated current.txt

This reverts commit dbf6b0d68a3d502430d061cd14f03f344b50f019.

Change-Id: I70846883f56be661fa89f9eaf20f5d103f2833c6
/frameworks/base/core/java/android/widget/Switch.java
8bb399069da4e46b231333cff6880a0cf35b9417 30-Jul-2014 Alan Viverette <alanv@google.com> Update switch assets, fix SearchView asset 9-patch areas

BUG: 16606037
BUG: 16467249
Change-Id: Iabdf1634f4d8f87031ab3e5579140cdd428173de
/frameworks/base/core/java/android/widget/Switch.java
dec17299fef93f673d8e8cab0ec0f734bf6b8539 12-Jul-2014 Alan Viverette <alanv@google.com> Fix switch text position when thumb is null

Change-Id: I05a107423fabf5a538258cf0562e0916c8be18b6
/frameworks/base/core/java/android/widget/Switch.java
4d065a04ce42c07569cf20651c949c4da97aa4a9 12-Jul-2014 Alan Viverette <alanv@google.com> Remove old listener when rebinding SwitchPreference

Also fixes switch animation during scrolling, unnecessary call to
requestLayout() on drawable invalidate, and potential NPE.

BUG: 16225972
BUG: 4312303
Change-Id: I015d1f03206dd2c812592b0abfa4214a3de73d3f
/frameworks/base/core/java/android/widget/Switch.java
e599488968f41cf7ad7f6b0fbdc3ce37213e38da 20-Jun-2014 John Spurlock <jspurlock@google.com> If we're not showing switch text, don't include in measure.

Naive fix for switch crashes when !showText.

Bug:15770311
Change-Id: I68839b61b907d62159e2c12349005683e9ac6436
/frameworks/base/core/java/android/widget/Switch.java
2a37cf8d763750853e2b4e036bc7cb4486c78e1d 20-Jun-2014 Alan Viverette <alanv@google.com> Don't show text in Material-styled switch

BUG: 15754341
Change-Id: Iae43b31c6e445207a0c95b48d0f0befac0f5cc78
/frameworks/base/core/java/android/widget/Switch.java
8de1494557cf1d00c1c3fce439138a28de7fbd61 19-Jun-2014 Alan Viverette <alanv@google.com> Fix switch & slider anim, make View drawable hotspot API public

BUG: 15287810
Change-Id: Ic7a9549dc1ba8afd07e9a196371ed349a54aaf2f
/frameworks/base/core/java/android/widget/Switch.java
cebc6bab51d9c77db8f346c1390169eabac4f27d 14-Jun-2014 Alan Viverette <alanv@google.com> Support hotspots in View drawables

BUG: 15285217
Change-Id: Iad44454fe16ac27ed20b9c17ae2df69649339eed
/frameworks/base/core/java/android/widget/Switch.java
2356c5e69b0911e6334ebf6374217898371be5ac 23-May-2014 Alan Viverette <alanv@google.com> Update switch, checkbox, radio button, button, and toggle button

Add optical inset support to BitmapDrawable with gravity. Fix optical
inset support in DrawableContainer. Fix visibility change support in
AnimatedStateListDrawable. Adds a whole bunch of missing drawable
support to CheckedTextView.

BUG: 15127013
BUG: 15126976
BUG: 15125529
BUG: 15025806
BUG: 14597955
BUG: 14594498
BUG: 15152746
Change-Id: Id2d99e10838d25b6f927ca1e49996c8da8e78ab1
/frameworks/base/core/java/android/widget/Switch.java
c80ad99a33ee49d0bac994c1749ff24d243c3862 20-May-2014 Alan Viverette <alanv@google.com> TouchFeedbackDrawable is now RippleDrawable

Change-Id: I59f5f04b73089215c6320560556ac21beb03db06
/frameworks/base/core/java/android/widget/Switch.java
ad2f8e334f3ef22d3e412b0660a2e1f996f94116 16-May-2014 Alan Viverette <alanv@google.com> Update ripple behavior, use render thread animation

Change-Id: Ib6bc1e08b05d29606f452961963d58b8fc866746
/frameworks/base/core/java/android/widget/Switch.java
661e63658da39cccfe49a129e4860455716ff3c9 12-May-2014 Alan Viverette <alanv@google.com> Support for hollow switch and seek bar thumbs

Also cleans up AbsSeekBar.

Change-Id: I996ea90c732c1da6a801aad3079f6bb3692d5c67
/frameworks/base/core/java/android/widget/Switch.java
aec98fee141c268660e23d0ea675a2f709b00335 23-Apr-2014 Alan Viverette <alanv@google.com> Add null bg check to switch

BUG: 14271950
Change-Id: I6f4833c916ddc8d939f5bfa6ab7b1ed1993e862e
/frameworks/base/core/java/android/widget/Switch.java
61956606818918194a38e045a8e35e7108480e5e 23-Apr-2014 Alan Viverette <alanv@google.com> Add ripple to switches, radio buttons, check boxes, seek bars

BUG: 14231772
Change-Id: Ie40eac9f68815294460175965a999dd75f4144b5
/frameworks/base/core/java/android/widget/Switch.java
5876ff4a0ac938297bfd114da6b5d8c9dcb4cef6 04-Mar-2014 Alan Viverette <alanv@google.com> Quantum for seek bars, spinners, switches

Fixes a bug in Switch that ignores the switch intrinsic height. Reverts
list selectors since they're not implemented in AbsListView yet. Also
adds Quantum for some miscellaneous widgets and icons.

Change-Id: I918bb0165b84e108cdf17a29eadc8424ac35f9ee
/frameworks/base/core/java/android/widget/Switch.java
8eea3ea5591e59f55cbb4f6b2b7e9363a285ced3 04-Feb-2014 Alan Viverette <alanv@google.com> Add APIs for obtaining themed Drawable from Theme, Context

BUG: 12611005
Change-Id: Ic0057be4e4c2d0c61ce02a019b3f7d0625e3a016
/frameworks/base/core/java/android/widget/Switch.java
86453ff147f28b0c16bea73da5b261feed50efb7 26-Sep-2013 Alan Viverette <alanv@google.com> Ensure toggle calls setChecked() since apps may have relied on this

BUG: 10899797
Change-Id: I604959cdd4074280df2c4d151763536ac59d4b22
/frameworks/base/core/java/android/widget/Switch.java
cc2688d18af3f434fc6ac63289a69f6c1a9f8d9f 18-Sep-2013 Alan Viverette <alanv@google.com> Animate state change for Switch

Change-Id: Ie8fdbb323b95ee1bd573a0ab452857a277de34bf
/frameworks/base/core/java/android/widget/Switch.java
617feb99a06e7ffb3894e86a286bf30e085f321a 10-Sep-2013 Alan Viverette <alanv@google.com> Add View constructor that supplies a default style resource

Also updates the constructor of every class that extends View.

BUG: 10676369
Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3
/frameworks/base/core/java/android/widget/Switch.java
b8c50e8e44bb757d18fc7f069332c186099aca77 14-Sep-2012 Svetoslav Ganov <svetoslavganov@google.com> Text layout in switch may be null when accessibility events are fired.

1. The layout containing the text of a Switch is initialized on measure
and if an accessibility event is fired before that then a NPE happens.

bug:7169419

Change-Id: Iee3c01ca9157d14d228c4ff33c0810507e0e25a7
/frameworks/base/core/java/android/widget/Switch.java
be06e3292b295324b3b47d13f9a40787b666309f 12-Sep-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #7148393 Switch can crash when hierarchyviewer is connected

Change-Id: I1713138a60358cc76f6cf373082a94199e85c717
/frameworks/base/core/java/android/widget/Switch.java
acbbd1142db522b15d06d6a1e076463e5c55c8b3 20-Aug-2012 Jean-Baptiste Queru <jbq@google.com> resolved conflicts for merge of 4ea6a8eb to jb-mr1-dev

Change-Id: I51b1732011f31ea07087ef0898b47de8977074de
4ea6a8eb9fdf83f5327e6c8b65a3d5dac8075f8f 20-Aug-2012 Jean-Baptiste Queru <jbq@google.com> am f515c6f4: Merge "Switch widget: Fix ON/OFF option update error"

* commit 'f515c6f4fe4457de1d5c49f78f9dcf6e4379e335':
Switch widget: Fix ON/OFF option update error
75bea2e8d35044233ba892bedf102ed08406d653 26-Jul-2012 Scott Main <smain@google.com> am 7c00f816: am 2f5b61a7: Merge "docs: fix a bunch of links from javadocs to api guides and add some attributes to Spinner and Switch" into jb-dev

* commit '7c00f81606de1880c3f28e54cea064c3b90da3e7':
docs: fix a bunch of links from javadocs to api guides and add some attributes to Spinner and Switch
4c359b76f9a030f92a302ba74a528faa170bad4e 25-Jul-2012 Scott Main <smain@google.com> docs: fix a bunch of links from javadocs to api guides
and add some attributes to Spinner and Switch

Change-Id: If015ad000c1a36e19904c132e98ebff1ceaf718b
/frameworks/base/core/java/android/widget/Switch.java
ca13b1562cedafb17a4f116fb521ed5388423755 11-Jul-2012 Yu Haonong <yuhaonong@gmail.com> Switch widget: Fix ON/OFF option update error

When calling setChecked() from a listener which is invoked by
the Switch toggle, setChecked() will be called recursively,
causing the value of mThumbPosition overridden by the outer
setChecked(). This make the nested setChecked() unable to update
the "Thumb" position correctly.

Set mThumbPosition to sync up with the exact checked state of
the Switch to avoid update error.

Issue 34748

Change-Id: Id4aa389114dcc590430b11626c80d29c9c6016a0
Signed-off-by: Yu Haonong <yuhaonong@gmail.com>
/frameworks/base/core/java/android/widget/Switch.java
49ccb116e9f2f3cf1233738c931f3e620287afc4 12-Jun-2012 Victoria Lease <violets@google.com> am 1b15102f: am 72b8fc7e: Merge "Revert "Fix fake bold for fallback fonts in frameworks."" into jb-dev

* commit '1b15102fc040f59c72c6453dee15b791f54c9f06':
Revert "Fix fake bold for fallback fonts in frameworks."
aa0980afab57a6aebb06e70f60e92511708fa5af 11-Jun-2012 Victoria Lease <violets@google.com> Revert "Fix fake bold for fallback fonts in frameworks."

This reverts commit b26fa0ce68d3311b2fdffb930b27d897e481dd5a
/frameworks/base/core/java/android/widget/Switch.java
c3672a4e19d3a0063c6d467453e9d7e03b2c1d2f 09-Jun-2012 Victoria Lease <violets@google.com> am 2203fab2: am 2e6f9be5: Merge "Fix fake bold for fallback fonts in frameworks." into jb-dev

* commit '2203fab24966c80af5c37f0a58263218dbbcd610':
Fix fake bold for fallback fonts in frameworks.
b26fa0ce68d3311b2fdffb930b27d897e481dd5a 08-Jun-2012 Victoria Lease <violets@google.com> Fix fake bold for fallback fonts in frameworks.

This change is analogous to Ic0e9f1bbd8cae9fdd3a6d1d015bb9224c8be545c
in WebView, and depends upon the same Skia change that that CL makes
use of.

This flips the "fake bold" flag on for bold fonts in
TextView.setTypeface(), with the expectation that Skia will ignore
the flag if the final typeface used to render the glyphs is already
bold. It also does the same for StyleSpans, TextAppearanceSpans,
TypefaceSpans, and the Switch widget.

With this, fake bold should work uniformly across all scripts - if
fake bold works for a primary typeface, it should also work for all
fallback typefaces.

Bug: 6629786
Change-Id: Id3b8639ab0df83052ffd82809cb12adaacc1d46b
/frameworks/base/core/java/android/widget/Switch.java
8dbf3b006dd806213f18ce32d8222856a80cbf01 06-Jun-2012 Fabrice Di Meglio <fdimeglio@google.com> Remove dead code in Switch

Change-Id: I91b47866be6f370feef67b1aa4df3aa0d09cc6fb
/frameworks/base/core/java/android/widget/Switch.java
28efba38c07c78f4a349d599b7ad3d7b517c5e97 02-Jun-2012 Fabrice Di Meglio <fdimeglio@google.com> Make Switch widget aware of layout direction

- see bug #5429822 UI should be mirrored for RTL locales (Arabic, Hebrew, farsi)

Change-Id: I40e77e54ccee2e596ebc4649871debfd35ed95fa
/frameworks/base/core/java/android/widget/Switch.java
4c3308de7d51b16b1450c21787b442d84ace3984 19-Apr-2012 Daniel Sandler <dsandler@android.com> Fix text transformations in Switches.

In particular, we now honor android:textAllCaps in the
TextAppearance specified for the switch widget itself.
(Now you no longer need to create a separate capitalized
version of your strings to get them to look like the
platform switches.)

Change-Id: Ia48222a6dddd0d0f9115e554dffb621f4d6a2b94
/frameworks/base/core/java/android/widget/Switch.java
78bcc15b6c5959cc3eb9bbe2459af93451b74a22 13-Apr-2012 Svetoslav Ganov <svetoslavganov@google.com> Switch does not append its state text to accessibility node infos.

1. Switch was not populating the state on/off test in accessibility
node infos. It apparently has two texts, the state one and the
one it inherits from TextView.

bug:6213278

Change-Id: I9c6b1798a8b3230cfb6755cc5b088c320d991642
/frameworks/base/core/java/android/widget/Switch.java
977c9a5d3cb9ecd9190c37da25d1e7476a1dd0bb 09-Mar-2012 Svetoslav Ganov <svetoslavganov@google.com> Merge "Removing checked state description text for accessibility from some widgets."
55249c8601e04928d4e8afb17233596a3ed4e0ce 09-Mar-2012 Svetoslav Ganov <svetoslavganov@google.com> Removing checked state description text for accessibility from some widgets.

1. The framework was appending some text to convey the state of a
a CheckedTextView or a RadioButton or a ToggleButton or a Switch
but the checked property already conveys that information. It is
responsibility of the screen reader developer to append the state
text based on the checked property. This change is requested by a
few screen reader developers.

bug:5951683

Change-Id: Ieba6797770201155c48e37147ae375dfcb5238aa
/frameworks/base/core/java/android/widget/Switch.java
dca510e026e3e75759bac84c3860dc84b83a608f 09-Mar-2012 Adam Powell <adamp@google.com> Fix docs

Change-Id: Idea902ec3b6e540972650a070e8d224603a55c94
/frameworks/base/core/java/android/widget/Switch.java
d9c7be6cc7d18f11731e6d7a1037cc294fde3a4b 09-Mar-2012 Adam Powell <adamp@google.com> Public API for android.widget.Spinner properties

Bug 6104467

Add properties that can be set/retrieved programmatically to match the
XML attributes available.

Also add resource ID versions of Drawable setters for Switch.

Change-Id: I198cfd9701189ab200c3190f61d18c459b7e4591
/frameworks/base/core/java/android/widget/Switch.java
6c86e1ba41b56ccb3668dbb044fa348cd4b47d55 09-Mar-2012 Adam Powell <adamp@google.com> Public API for android.widget.Switch properties

Bug 6104562

Add properties that can be set/retrieved programmatically to match the
XML attributes available.

Change-Id: Ief28e5cad9ec3e6c2d12dd11ff9fa24f22eecec3
/frameworks/base/core/java/android/widget/Switch.java
8a78fd4d9572dff95432fcc4ba0e87563415b728 17-Jan-2012 Svetoslav Ganov <svetoslavganov@google.com> AccessibilityEvent/AccessibilityNodeInfo class name property should be set to only framework classes.

AccessibilityEvent and AccessibilityNodeInfo have a property className which is set to the source
Java class. This is problematic since leads to leaking private classes which would allow an
accessibility service to load classes from other packages. This is strongly undesirable since
not trusted code can be loaded, and hence executed, in the accessibility service. To address
that the class name is set to the most concrete framework class extended by the info/event
source.

bug:5878943

Change-Id: I7b3114ece8772ea2773f5151e21b8a6f2006882a
/frameworks/base/core/java/android/widget/Switch.java
e724ee4b04d121556e9764f72f9b921a0e16392a 31-Aug-2011 Gilles Debunne <debunne@google.com> Fix for NPE in Switch

Happens when the checked state is set in XML in the CompoundButton
constructor. The drawable are not yet loaded at that point.

This still work since the Switch constructor calls setChecked, which
will invalidate.

Change-Id: I76459307e77596ce0f2759e9449eb42287c6bad7
/frameworks/base/core/java/android/widget/Switch.java
150176d83023e3c486dba10edebb72af36b4099a 26-Aug-2011 Chet Haase <chet@google.com> Made the Switch class public.

Tweaked the API of Switch slightly and made the class public (it was
hidden before).

Change-Id: I4a099e8afd18a11a5850252025ae3bbbb866830d
/frameworks/base/core/java/android/widget/Switch.java
01d11edc1ea2c495ba4bd6bbea8ba7bb7f597678 10-Aug-2011 Adam Powell <adamp@google.com> Flingable switches

Change-Id: I640656358cf28569242d900d41493a69845f7305
/frameworks/base/core/java/android/widget/Switch.java
ec1d60369f751c2d9b60237077ceb9c03e4c0aed 08-Aug-2011 Adam Powell <adamp@google.com> Fix bug 5112702 - switches should have "ON" on the right

Make Switches obey the Grand Unified Theory of Button Ordering.
This also matches their behavior with volume/brightness sliders.

Change-Id: I4e72801e81b10002542a05f61c99a57991f130ff
/frameworks/base/core/java/android/widget/Switch.java
7650259a597dd24137420d32acc35efc44db381e 29-Jul-2011 Svetoslav Ganov <svetoslavganov@google.com> Improving accessibility feedback for two state widgets.

1. Added population of sensible text for the state of the
two state controls such as CheckBox, Switch, etc. This
is important since if they are in a layout manager which
fires an accessibility event there should be a description
of the widget.

bug:5092552

Change-Id: Ie3ca955653563496b84db379ae23a23fe88089a8
/frameworks/base/core/java/android/widget/Switch.java
63bce03cc69be4a45230aa8bbd89dbde60681067 24-Jul-2011 Svetoslav Ganov <svetoslavganov@google.com> Switch state text not added to accessibility events.

1. Adding the text to the events now.

bug:5071053

Change-Id: If36afb1f5327720fc002b8c49e5d7b00c5f189f7
/frameworks/base/core/java/android/widget/Switch.java
c2ab0d665c9d1c332fbd726abf582a27cf7a6701 13-Jun-2011 Gilles Debunne <debunne@google.com> Switch is not affected by touch when disabled

Also unchanged at the end of a drag/fling if the switch has been
disabled in the mean time.

Change-Id: Ie471a7fcf57fa633ee8eeefdfaa2939883ccfef0
/frameworks/base/core/java/android/widget/Switch.java
be0a4535053bbfdebd215e244b154ac810fd8edc 30-Nov-2010 Adam Powell <adamp@google.com> Add SwitchPreference

Change-Id: I073e9bfba8c4e1a625c27f976f71ea56a81ba20f
/frameworks/base/core/java/android/widget/Switch.java
c3eabb9b6ce7f556313c8e3870d76c5b443f1c51 08-Jan-2011 Joe Onorato <joeo@google.com> The switch widget didn't work properly until after onMeasure had run.

Change-Id: I3259193ca60392ffc133f2ff6479feb8e4ad536e
/frameworks/base/core/java/android/widget/Switch.java
96e6b8bfc82e04d06923c372657768b4866e4fb9 14-Dec-2010 Gilles Debunne <debunne@google.com> Remove line height attribute from TextView.

This attribute was introduced in HC and is only partially supported. It should
actually also be used by the layout to be meaningful.

Bug 3223987

Change-Id: Idb47be319a236326f7624fd865466356c19bc342
/frameworks/base/core/java/android/widget/Switch.java
189ee18d6c6483ad63cc864267328259e2e00b95 03-Dec-2010 Dianne Hackborn <hackbod@google.com> Implement smarter sizing of WRAP_CONTENT windows.

This extends the view hierarchy's measure pass to allow view to
propagate up to their parent additional information besides just
their measured size. They can now report that their measured width
and/or height should be larger than the size their parent is
limiting them to (even though by definition they need to contrain
their reported measurements to the limits imposed by the parent).

ViewRoot uses this information to determine if it should remeasure
the window with a larger size limit to try to make it fit.

Change-Id: I90af3b7a8ec45d0a5c003fb009857025209d83eb
/frameworks/base/core/java/android/widget/Switch.java
12190b36a9da88f8db7dbd9ce16d127d76a904b7 29-Nov-2010 Adam Powell <adamp@google.com> Add the Switch widget

Switch is hidden currently; it will be used in SystemUI and preferences.

Change-Id: I2cd8458783f938f00f5ee5e7a67fb5a90404797d
/frameworks/base/core/java/android/widget/Switch.java