@@ -885,7 +885,8 @@ && shouldSetCollectionInfo(semanticsNode)) {
885
885
// Scopes routes are not focusable, only need to set the content
886
886
// for non-scopes-routes semantics nodes.
887
887
if (semanticsNode .hasFlag (Flag .IS_TEXT_FIELD )) {
888
- result .setText (semanticsNode .getValueLabelHint ());
888
+ result .setText (semanticsNode .getValue ());
889
+ result .setHintText (semanticsNode .getTextFieldHint ());
889
890
} else if (!semanticsNode .hasFlag (Flag .SCOPES_ROUTE )) {
890
891
CharSequence content = semanticsNode .getValueLabelHint ();
891
892
if (Build .VERSION .SDK_INT < Build .VERSION_CODES .P ) {
@@ -2773,18 +2774,47 @@ private float max(float a, float b, float c, float d) {
2773
2774
return Math .max (a , Math .max (b , Math .max (c , d )));
2774
2775
}
2775
2776
2776
- private CharSequence getValueLabelHint () {
2777
- CharSequence [] array ;
2777
+ private CharSequence getValue () {
2778
+ if (Build .VERSION .SDK_INT < Build .VERSION_CODES .LOLLIPOP ) {
2779
+ return value ;
2780
+ } else {
2781
+ return createSpannableString (value , valueAttributes );
2782
+ }
2783
+ }
2784
+
2785
+ private CharSequence getLabel () {
2786
+ if (Build .VERSION .SDK_INT < Build .VERSION_CODES .LOLLIPOP ) {
2787
+ return label ;
2788
+ } else {
2789
+ return createSpannableString (label , labelAttributes );
2790
+ }
2791
+ }
2792
+
2793
+ private CharSequence getHint () {
2778
2794
if (Build .VERSION .SDK_INT < Build .VERSION_CODES .LOLLIPOP ) {
2779
- array = new CharSequence [] { value , label , hint } ;
2795
+ return hint ;
2780
2796
} else {
2781
- array =
2782
- new CharSequence [] {
2783
- createSpannableString (value , valueAttributes ),
2784
- createSpannableString (label , labelAttributes ),
2785
- createSpannableString (hint , hintAttributes ),
2786
- };
2797
+ return createSpannableString (hint , hintAttributes );
2787
2798
}
2799
+ }
2800
+
2801
+ private CharSequence getValueLabelHint () {
2802
+ CharSequence [] array = new CharSequence [] {getValue (), getLabel (), getHint ()};
2803
+ CharSequence result = null ;
2804
+ for (CharSequence word : array ) {
2805
+ if (word != null && word .length () > 0 ) {
2806
+ if (result == null || result .length () == 0 ) {
2807
+ result = word ;
2808
+ } else {
2809
+ result = TextUtils .concat (result , ", " , word );
2810
+ }
2811
+ }
2812
+ }
2813
+ return result ;
2814
+ }
2815
+
2816
+ private CharSequence getTextFieldHint () {
2817
+ CharSequence [] array = new CharSequence [] {getLabel (), getHint ()};
2788
2818
CharSequence result = null ;
2789
2819
for (CharSequence word : array ) {
2790
2820
if (word != null && word .length () > 0 ) {
0 commit comments