Размер текста hint
такой же, как текст, который нужно ввести в TextInputLayout
. Чтобы получить textSize
в Java, выполните следующие действия:
XML:
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="157dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="0dp"
android:layout_marginTop="158dp">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:id="@+id/TextInputEditText"
android:layout_height="wrap_content"
android:hint="hint" />
</android.support.design.widget.TextInputLayout>
MainActivity.java:
final TextInputEditText textInputEditText = findViewById(R.id.TextInputEditText);
textInputEditText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
float size = textInputEditText.getTextSize();
Log.i("TEXT_SIZE", String.valueOf(size));
}
});
Если вы хотите изменить textSize вы можете использовать textInputEditText.setTextSize();