File tree Expand file tree Collapse file tree 4 files changed +15
-2
lines changed
javatests/com/google/android/material/datepicker
java/com/google/android/material/datepicker Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 35
35
import androidx .annotation .RestrictTo .Scope ;
36
36
import androidx .core .util .Pair ;
37
37
import androidx .core .util .Preconditions ;
38
+ import com .google .android .material .color .MaterialColors ;
38
39
import com .google .android .material .internal .ManufacturerUtils ;
39
40
import com .google .android .material .resources .MaterialAttributes ;
40
41
import com .google .android .material .textfield .TextInputLayout ;
@@ -213,6 +214,12 @@ public View onCreateTextInputView(
213
214
final TextInputLayout endTextInput = root .findViewById (R .id .mtrl_picker_text_input_range_end );
214
215
EditText startEditText = startTextInput .getEditText ();
215
216
EditText endEditText = endTextInput .getEditText ();
217
+ Integer hintTextColor =
218
+ MaterialColors .getColorOrNull (root .getContext (), R .attr .colorOnSurfaceVariant );
219
+ if (hintTextColor != null ) {
220
+ startEditText .setHintTextColor (hintTextColor );
221
+ endEditText .setHintTextColor (hintTextColor );
222
+ }
216
223
if (ManufacturerUtils .isDateInputKeyboardMissingSeparatorCharacters ()) {
217
224
// Using the URI variation places the '/' and '.' in more prominent positions
218
225
startEditText .setInputType (InputType .TYPE_CLASS_TEXT | InputType .TYPE_TEXT_VARIATION_URI );
Original file line number Diff line number Diff line change 33
33
import androidx .annotation .RestrictTo ;
34
34
import androidx .annotation .RestrictTo .Scope ;
35
35
import androidx .core .util .Pair ;
36
+ import com .google .android .material .color .MaterialColors ;
36
37
import com .google .android .material .internal .ManufacturerUtils ;
37
38
import com .google .android .material .resources .MaterialAttributes ;
38
39
import com .google .android .material .textfield .TextInputLayout ;
@@ -113,6 +114,11 @@ public View onCreateTextInputView(
113
114
114
115
TextInputLayout dateTextInput = root .findViewById (R .id .mtrl_picker_text_input_date );
115
116
EditText dateEditText = dateTextInput .getEditText ();
117
+ Integer hintTextColor =
118
+ MaterialColors .getColorOrNull (root .getContext (), R .attr .colorOnSurfaceVariant );
119
+ if (hintTextColor != null ) {
120
+ dateEditText .setHintTextColor (hintTextColor );
121
+ }
116
122
if (ManufacturerUtils .isDateInputKeyboardMissingSeparatorCharacters ()) {
117
123
// Using the URI variation places the '/' and '.' in more prominent positions
118
124
dateEditText .setInputType (InputType .TYPE_CLASS_TEXT | InputType .TYPE_TEXT_VARIATION_URI );
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public class RangeDateSelectorTest {
58
58
59
59
@ Before
60
60
public void setupMonthAdapters () {
61
- ApplicationProvider .getApplicationContext ().setTheme (R .style .Theme_MaterialComponents_Light );
61
+ ApplicationProvider .getApplicationContext ().setTheme (R .style .Theme_Material3_Light );
62
62
activity = Robolectric .buildActivity (AppCompatActivity .class ).setup ().get ();
63
63
context = activity .getApplicationContext ();
64
64
res = context .getResources ();
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ public class SingleDateSelectorTest {
56
56
57
57
@ Before
58
58
public void setupMonthAdapters () {
59
- ApplicationProvider .getApplicationContext ().setTheme (R .style .Theme_MaterialComponents_Light );
59
+ ApplicationProvider .getApplicationContext ().setTheme (R .style .Theme_Material3_Light );
60
60
activity = Robolectric .buildActivity (AppCompatActivity .class ).setup ().get ();
61
61
context = activity .getApplicationContext ();
62
62
res = context .getResources ();
You can’t perform that action at this time.
0 commit comments