George Lin | 8d3ba60 | 2023-01-16 06:58:07 +0000 | [diff] [blame^] | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <!-- |
| 3 | Copyright (C) 2023 The Android Open Source Project |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | --> |
| 17 | <MotionScene |
| 18 | xmlns:android="http://schemas.android.com/apk/res/android" |
| 19 | xmlns:motion="http://schemas.android.com/apk/res-auto"> |
| 20 | |
| 21 | <Transition |
| 22 | motion:constraintSetStart="@id/start" |
| 23 | motion:constraintSetEnd="@+id/next" |
| 24 | motion:duration="1000" |
| 25 | android:id="@+id/forward"> |
| 26 | <OnSwipe |
| 27 | motion:dragDirection="dragLeft" |
| 28 | motion:touchAnchorSide="left" /> |
| 29 | </Transition> |
| 30 | |
| 31 | <Transition |
| 32 | motion:constraintSetStart="@+id/start" |
| 33 | motion:constraintSetEnd="@+id/previous" |
| 34 | android:id="@+id/backward"> |
| 35 | <OnSwipe |
| 36 | motion:dragDirection="dragRight" |
| 37 | motion:touchAnchorSide="right" /> |
| 38 | </Transition> |
| 39 | |
| 40 | <ConstraintSet android:id="@+id/previous"> |
| 41 | <Constraint |
| 42 | android:id="@+id/item_view_0" |
| 43 | android:layout_width="100dp" |
| 44 | android:layout_height="100dp" |
| 45 | motion:layout_constraintEnd_toStartOf="@id/guideline_start" |
| 46 | motion:layout_constraintTop_toTopOf="parent" |
| 47 | motion:layout_constraintBottom_toBottomOf="parent" |
| 48 | android:layout_marginEnd="16dp" /> |
| 49 | <Constraint |
| 50 | android:id="@+id/item_view_1" |
| 51 | android:layout_width="0dp" |
| 52 | android:layout_height="0dp" |
| 53 | motion:layout_constraintDimensionRatio="1:1" |
| 54 | motion:layout_constraintHorizontal_bias="0.5" |
| 55 | motion:layout_constraintStart_toStartOf="@id/guideline_start" |
| 56 | motion:layout_constraintEnd_toEndOf="@id/guideline_end" |
| 57 | motion:layout_constraintTop_toTopOf="parent" |
| 58 | motion:layout_constraintBottom_toBottomOf="parent" |
| 59 | android:layout_marginStart="16dp" |
| 60 | android:layout_marginEnd="16dp" /> |
| 61 | <Constraint |
| 62 | android:id="@+id/item_view_2" |
| 63 | android:layout_width="100dp" |
| 64 | android:layout_height="100dp" |
| 65 | motion:layout_constraintStart_toStartOf="@id/guideline_end" |
| 66 | motion:layout_constraintTop_toTopOf="parent" |
| 67 | motion:layout_constraintBottom_toBottomOf="parent" |
| 68 | android:layout_marginStart="16dp" /> |
| 69 | </ConstraintSet> |
| 70 | |
| 71 | <ConstraintSet android:id="@+id/start"> |
| 72 | <Constraint |
| 73 | android:id="@+id/item_view_1" |
| 74 | android:layout_width="100dp" |
| 75 | android:layout_height="100dp" |
| 76 | motion:layout_constraintEnd_toStartOf="@id/guideline_start" |
| 77 | motion:layout_constraintTop_toTopOf="parent" |
| 78 | motion:layout_constraintBottom_toBottomOf="parent" |
| 79 | android:layout_marginEnd="16dp" /> |
| 80 | <Constraint |
| 81 | android:id="@+id/item_view_2" |
| 82 | android:layout_width="0dp" |
| 83 | android:layout_height="0dp" |
| 84 | motion:layout_constraintDimensionRatio="1:1" |
| 85 | motion:layout_constraintHorizontal_bias="0.5" |
| 86 | motion:layout_constraintStart_toStartOf="@id/guideline_start" |
| 87 | motion:layout_constraintEnd_toEndOf="@id/guideline_end" |
| 88 | motion:layout_constraintTop_toTopOf="parent" |
| 89 | motion:layout_constraintBottom_toBottomOf="parent" |
| 90 | android:layout_marginStart="16dp" |
| 91 | android:layout_marginEnd="16dp" /> |
| 92 | <Constraint |
| 93 | android:id="@+id/item_view_3" |
| 94 | android:layout_width="100dp" |
| 95 | android:layout_height="100dp" |
| 96 | motion:layout_constraintStart_toStartOf="@id/guideline_end" |
| 97 | motion:layout_constraintTop_toTopOf="parent" |
| 98 | motion:layout_constraintBottom_toBottomOf="parent" |
| 99 | android:layout_marginStart="16dp" /> |
| 100 | </ConstraintSet> |
| 101 | |
| 102 | <ConstraintSet android:id="@+id/next"> |
| 103 | <Constraint |
| 104 | android:id="@+id/item_view_2" |
| 105 | android:layout_width="100dp" |
| 106 | android:layout_height="100dp" |
| 107 | motion:layout_constraintEnd_toStartOf="@id/guideline_start" |
| 108 | motion:layout_constraintTop_toTopOf="parent" |
| 109 | motion:layout_constraintBottom_toBottomOf="parent" |
| 110 | android:layout_marginEnd="16dp" /> |
| 111 | <Constraint |
| 112 | android:id="@+id/item_view_3" |
| 113 | android:layout_width="0dp" |
| 114 | android:layout_height="0dp" |
| 115 | motion:layout_constraintDimensionRatio="1:1" |
| 116 | motion:layout_constraintHorizontal_bias="0.5" |
| 117 | motion:layout_constraintStart_toStartOf="@id/guideline_start" |
| 118 | motion:layout_constraintEnd_toEndOf="@id/guideline_end" |
| 119 | motion:layout_constraintTop_toTopOf="parent" |
| 120 | motion:layout_constraintBottom_toBottomOf="parent" |
| 121 | android:layout_marginStart="16dp" |
| 122 | android:layout_marginEnd="16dp" /> |
| 123 | <Constraint |
| 124 | android:id="@+id/item_view_4" |
| 125 | android:layout_width="100dp" |
| 126 | android:layout_height="100dp" |
| 127 | motion:layout_constraintStart_toStartOf="@id/guideline_end" |
| 128 | motion:layout_constraintTop_toTopOf="parent" |
| 129 | motion:layout_constraintBottom_toBottomOf="parent" |
| 130 | android:layout_marginStart="16dp" /> |
| 131 | </ConstraintSet> |
| 132 | |
| 133 | </MotionScene> |