code: private void obtainHintColor(@NonNull final TypedArray typedArray) {
          ColorStateList colors =
                  typedArray.getColorStateList(R.styleable.Spinner_android_textColorHint);
  
          if (colors == null) {
              TypedArray styledAttributes = getContext().getTheme()
                      .obtainStyledAttributes(new int[]{android.R.attr.textColorSecondary});
              colors = ColorStateList.valueOf(styledAttributes.getColor(0, 0));
          }
  
          setHintTextColor(colors);
      }
docs: Obtains the color of the hint, which should be shown, when no item is selected, from a
  specific typed array.
  
  @param typedArray
  The typed array, the hint should be obtained from, as an instance of the class {@link
  TypedArray}. The typed array may not be null