@@ -885,7 +885,8 @@ && shouldSetCollectionInfo(semanticsNode)) {
885885 // Scopes routes are not focusable, only need to set the content
886886 // for non-scopes-routes semantics nodes.
887887 if (semanticsNode .hasFlag (Flag .IS_TEXT_FIELD )) {
888- result .setText (semanticsNode .getValueLabelHint ());
888+ result .setText (semanticsNode .getValue ());
889+ result .setHintText (semanticsNode .getTextFieldHint ());
889890 } else if (!semanticsNode .hasFlag (Flag .SCOPES_ROUTE )) {
890891 CharSequence content = semanticsNode .getValueLabelHint ();
891892 if (Build .VERSION .SDK_INT < Build .VERSION_CODES .P ) {
@@ -2773,18 +2774,47 @@ private float max(float a, float b, float c, float d) {
27732774 return Math .max (a , Math .max (b , Math .max (c , d )));
27742775 }
27752776
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 () {
27782794 if (Build .VERSION .SDK_INT < Build .VERSION_CODES .LOLLIPOP ) {
2779- array = new CharSequence [] { value , label , hint } ;
2795+ return hint ;
27802796 } else {
2781- array =
2782- new CharSequence [] {
2783- createSpannableString (value , valueAttributes ),
2784- createSpannableString (label , labelAttributes ),
2785- createSpannableString (hint , hintAttributes ),
2786- };
2797+ return createSpannableString (hint , hintAttributes );
27872798 }
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 ()};
27882818 CharSequence result = null ;
27892819 for (CharSequence word : array ) {
27902820 if (word != null && word .length () > 0 ) {
0 commit comments