I have many edit texts inside differents TextInputLayouts, How can i get the TextInputLayout where is the edit text i am working with?
Example :
@BindView(R.id.eT)
EditText eT;
@BindView(R.id.eT2)
EditText eT2;
@BindView(R.id.text_input_layout)
TextInputLayout textInputLayout;
@BindView(R.id.text_input_layout2)
TextInputLayout textInputLayout2;
i want something like eT.getTextInputLayout and get textInputLayout
extract of xml :
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="horizontal">
<Spinner
android:id="@+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="center" />
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
app:hintTextAppearance="@style/TextAppearence.App.TextInputLayout"
app:errorTextAppearance="@style/error_appearance"
app:hintAnimationEnabled="true"
app:errorEnabled="true">
<EditText
android:id="@+id/eT"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="horizontal"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="0dp">
<TextView
android:id="@+id/tV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:labelFor="@+id/spinne2"
android:text="@string/tarjeta" />
<Spinner
android:id="@+id/spinner2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="center" />
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_layout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
app:hintTextAppearance="@style/TextAppearence.App.TextInputLayout"
app:errorTextAppearance="@style/error_appearance"
app:hintAnimationEnabled="true"
app:errorEnabled="true">
<EditText
android:id="@+id/eT2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:ems="10"
android:inputType="number" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
I want to get the for example the text_input_layout, through edit text eT for handling errors in the TIL (i do this in other module, so i don't want to pass edit text and TIL to this module).