I have an existing <include layout
and need to change two parameters of this layout programmatically to set it in a TableLayout
one time have to perform:
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
and another time
android:layout_height="wrap_content"
this is the layout
<include
android:id="@+id/search_results_cv"
layout="@layout/addresses_card_view"
android:layout_width="0dp"// or wrap
android:layout_margin="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/my_location_cv"
app:layout_constraintBottom_toBottomOf="parent"//one time want t call another time not
/>
I do not need a ViewStub
as here, because do not need to change the layout indicated in include, but the parameters inside include!
EDIT:
and this is the new include layout:
<include
android:id="@+id/search_results_cv"
layout="@layout/addresses_card_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/my_location_cv"
/>