<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2023 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     https://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
-->
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:motion="http://schemas.android.com/apk/res-auto">

    <Transition
        motion:constraintSetStart ="@id/base_state"
        motion:constraintSetEnd="@id/dial"
        motion:duration="3000">
        <OnSwipe
            motion:dragDirection="dragUp"
            motion:touchAnchorId="@id/dial_pad"
            motion:touchAnchorSide="top" />
    </Transition>

    <Transition
        motion:constraintSetStart="@id/base_state"
        motion:constraintSetEnd="@id/half_people"
        motion:duration="3000">
        <OnSwipe
            motion:dragDirection="dragRight"
            motion:touchAnchorId="@id/people_pad"
            motion:touchAnchorSide="right" />
    </Transition>

    <Transition
        motion:constraintSetStart="@id/half_people"
        motion:constraintSetEnd="@id/people"
        motion:duration="3000">
        <OnSwipe
            motion:dragDirection="dragRight"
            motion:touchAnchorId="@id/people_pad"
            motion:touchAnchorSide="right" />
    </Transition>

    <ConstraintSet android:id="@+id/base_state">
        <Constraint android:id="@id/dial_pad">
            <Layout
                android:layout_width="0dp"
                android:layout_height="300dp"
                motion:layout_constraintEnd_toEndOf="parent"
                motion:layout_constraintStart_toStartOf="parent"
                motion:layout_constraintTop_toBottomOf="parent" />
        </Constraint>

        <Constraint android:id="@id/people_pad">
            <Layout
                android:layout_width="300dp"
                android:layout_height="500dp"
                android:layout_marginStart="-12dp"
                motion:layout_constraintBottom_toBottomOf="parent"
                motion:layout_constraintEnd_toStartOf="parent"
                motion:layout_constraintTop_toTopOf="parent" />
        </Constraint>

        <Constraint android:id="@id/arrow_right">
            <Layout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                motion:layout_constraintTop_toTopOf="parent"
                motion:layout_constraintBottom_toBottomOf="parent"
                motion:layout_constraintStart_toStartOf="parent"
                />
        </Constraint>

        <Constraint android:id="@id/arrow_up">
            <Layout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                motion:layout_constraintBottom_toBottomOf="parent"
                motion:layout_constraintStart_toStartOf="parent"
                motion:layout_constraintEnd_toEndOf="parent"
                />
        </Constraint>
    </ConstraintSet>

    <ConstraintSet android:id="@+id/dial">

        <Constraint android:id="@id/dial_pad">
            <Layout
                android:layout_width="0dp"
                android:layout_height="500dp"
                motion:layout_constraintBottom_toBottomOf="parent"
                motion:layout_constraintEnd_toEndOf="parent"
                motion:layout_constraintStart_toStartOf="parent" />
        </Constraint>

        <Constraint android:id="@+id/people_pad">
            <Layout
                android:layout_width="300dp"
                android:layout_height="500dp"
                android:layout_marginStart="4dp"
                motion:layout_constraintBottom_toBottomOf="parent"
                motion:layout_constraintEnd_toStartOf="parent"
                motion:layout_constraintTop_toTopOf="parent" />
        </Constraint>

        <Constraint android:id="@id/arrow_right">
            <Layout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                motion:layout_constraintTop_toTopOf="parent"
                motion:layout_constraintBottom_toBottomOf="parent"
                motion:layout_constraintEnd_toStartOf="parent"
                />
        </Constraint>

        <Constraint android:id="@id/arrow_up">
            <Layout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                motion:layout_constraintTop_toBottomOf="parent"
                motion:layout_constraintStart_toStartOf="parent"
                motion:layout_constraintEnd_toEndOf="parent"
                />
        </Constraint>
    </ConstraintSet>

    <ConstraintSet android:id="@+id/people">

        <Constraint android:id="@id/dial_pad">
            <Layout
                android:layout_width="0dp"
                android:layout_height="500dp"
                motion:layout_constraintEnd_toEndOf="parent"
                motion:layout_constraintStart_toStartOf="parent"
                motion:layout_constraintTop_toBottomOf="parent" />
        </Constraint>

        <Constraint android:id="@id/people_pad">
            <Layout
                android:layout_width="360dp"
                android:layout_height="600dp"
                motion:layout_constraintBottom_toBottomOf="parent"
                motion:layout_constraintStart_toStartOf="parent"
                motion:layout_constraintTop_toTopOf="parent" />
        </Constraint>

        <Constraint android:id="@id/arrow_right">
            <Layout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                motion:layout_constraintTop_toTopOf="parent"
                motion:layout_constraintBottom_toBottomOf="parent"
                motion:layout_constraintEnd_toStartOf="parent"
                />
        </Constraint>

        <Constraint android:id="@id/arrow_up">
            <Layout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                motion:layout_constraintTop_toBottomOf="parent"
                motion:layout_constraintStart_toStartOf="parent"
                motion:layout_constraintEnd_toEndOf="parent"
                />
        </Constraint>
    </ConstraintSet>

    <ConstraintSet android:id="@+id/half_people">

        <Constraint android:id="@id/dial_pad">
            <Layout
                android:layout_width="0dp"
                android:layout_height="500dp"
                motion:layout_constraintEnd_toEndOf="parent"
                motion:layout_constraintStart_toStartOf="parent"
                motion:layout_constraintTop_toBottomOf="parent" />
        </Constraint>

        <Constraint android:id="@id/people_pad">
            <Layout
                android:layout_width="360dp"
                android:layout_height="600dp"
                motion:layout_constraintBottom_toBottomOf="parent"
                motion:layout_constraintStart_toStartOf="parent"
                motion:layout_constraintEnd_toStartOf="parent"
                motion:layout_constraintTop_toTopOf="parent" />
        </Constraint>

        <Constraint android:id="@id/arrow_right">
            <Layout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                motion:layout_constraintTop_toTopOf="parent"
                motion:layout_constraintBottom_toBottomOf="parent"
                motion:layout_constraintEnd_toStartOf="parent"
                />
        </Constraint>

        <Constraint android:id="@id/arrow_up">
            <Layout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                motion:layout_constraintTop_toBottomOf="parent"
                motion:layout_constraintStart_toStartOf="parent"
                motion:layout_constraintEnd_toEndOf="parent"
                />
        </Constraint>
    </ConstraintSet>
</MotionScene>
