I'm moving a view from top to bottom of my activity , the problem is ,it works fine and move my view from bottom to up but when the transition completed , it hides the view
this is my layout :
<androidx.constraintlayout.motion.widget.MotionLayout
android:id="@+id/fist_motionlayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutDescription="@xml/fistactivity_motions"
app:showPaths="true">
<include
android:id="@+id/appbar"
layout="@layout/appbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.cardview.widget.CardView
android:id="@+id/marque"
android:layout_width="match_parent"
android:layout_height="45dp"
app:cardBackgroundColor="#395471"
app:cardCornerRadius="7dp"
app:cardElevation="1dp"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
app:layout_constraintTop_toBottomOf="@+id/appbar"
tools:visibility="visible">
</androidx.cardview.widget.CardView>
<FrameLayout
android:id="@+id/fm_firstact_content"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/marque" >
</FrameLayout>
</androidx.constraintlayout.motion.widget.MotionLayout>
this is my xml code:
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:motion="http://schemas.android.com/tools">
<ConstraintSet android:id="@+id/start_set">
<Constraint
android:id="@+id/fm_firstact_content"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="parent"></Constraint>
</ConstraintSet>
<ConstraintSet android:id="@+id/end_set">
<Constraint
android:id="@+id/fm_firstact_content"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/marque"></Constraint>
</ConstraintSet>
<Transition
android:id="@+id/trans_firstact_fm_content"
app:constraintSetEnd="@id/end_set"
app:constraintSetStart="@id/start_set"
app:duration="2000"></Transition>
</MotionScene>
and in the activity , I just start it:
MotionLayout ml=vf.findViewById(R.id.fist_motionlayout);
ml.transitionToEnd();
when I run the app, it moves the view from bottom to top and suddenly it get invisible , and strange thing is when I run the activity again from another activity , it works fine and it doesn't get invisible but if I close the app and run it again , it gets hide . every time app runs for the first time , view gets hide after the transition completed
this is my gradle :
implementation 'androidx.appcompat:appcompat:1.2.0-alpha01'
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
implementation 'androidx.cardview:cardview:1.0.0-alpha01'
implementation 'com.google.android.material:material:1.2.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
how to solve it ?