OSDN Git Service

Do not save TextView text when freezesText is false
authorSiyamed Sinir <siyamed@google.com>
Sat, 6 Feb 2016 00:08:59 +0000 (16:08 -0800)
committerSiyamed Sinir <siyamed@google.com>
Mon, 8 Feb 2016 22:23:25 +0000 (22:23 +0000)
commit027711904ba478bc89a66a749d4d00db067223ec
tree6bc29c014196cb8d189407039a84e406dae5543a
parentc08268e647f89f8ddfd9c6fb1f6ac4f99b13b9cf
Do not save TextView text when freezesText is false

Currently TextView state is saved whenever selection is set even if
freezesText is false. This causes inconsistencies with the described
behavior for the attribute. This CL updates the behavior as:
- Always save the text for EditText
- Always save the selection if there are any.
- Do not save the text for TextView if freezesText is false.
- During onRestoreInstanceState if selection is out of the text
  boundaries, do not restore the selection.

Bug: 22076905
Change-Id: I5e05d343e752a7d106c8881993e4d95ae21a38ce
(cherry picked from commit 8535836673c801effce097c54f55814ef88448e7)
core/java/android/widget/EditText.java
core/java/android/widget/TextView.java
core/res/res/values/attrs.xml