I have linear layout like below
<LinearLayout
android:id="@+id/pilihwaktu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="125dp">
<com.testing.CustomLinearLayout
android:id="@+id/oneway"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/field_background"
android:padding="5dp"
android:layout_weight=".50">
....
</com.testing.CustomLinearLayout>
<com.testing.CustomLinearLayout
android:id="@+id/roundtrip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/field_background"
android:padding="5dp"
android:layout_weight=".50">
....
</com.testing.CustomLinearLayout>
</LinearLayout>
and it will show view like this
+---------------+---------------+
| | |
| oneway | roundtrip |
| | |
+---------------+---------------+
I want to make the roundtrip is gone as the default and when the Checkbox is checked, I want to animate roundtrip so it will restore things to the above state (and oneway section will animate as it follows so it looks smooth). And when the checkbox is not checked roundtrip will animate to hide or gone
I've tried to follow this link but it wasn't animated and it looks like ObjectAnimator is simple way to do it...
What is the correct way to do this?