Implement the login/signup transition using CatchScrollLayout
masterTo implement the Material Design login/signup transition, use CatchScrollLayout to monitor external sliding events. The layout's height should typically be set to match_parent to cover the monitored area.
Inside the CatchScrollLayout, you must include a SignUpContainer. You can then use the IScrollCallBack to respond to scroll progress, which allows you to drive animations (like updating the SignUpContainer's animation proportion) based on the user's swipe gesture.
<yellow5a5.materialdesignlogin.View.CatchScrollLayout
android:id="@+id/catch_sroll_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:clickable="true">
<yellow5a5.materialdesignlogin.View.SignUpContainer
android:id="@+id/sign_up_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</yellow5a5.materialdesignlogin.View.CatchScrollLayout>mCatchScrollLayout.setIScrollCallBack(new CatchScrollLayout.IScrollCallBack() {
@Override
public void onScrollProcess(int process, boolean isLeft) {
// Adjust process based on direction if necessary
if (!isLeft){
process = 100 - process;
}
// Drive the container animation
mSignUpContainer.setAnimProportion(process);
}
});