1 /*
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package androidx.constraintlayout.core.dsl;
18 
19 import java.util.ArrayList;
20 
21 /**
22  * Provides the API for creating a KeyFrames Object for use in the Core
23  * ConstraintLayout & MotionLayout system
24  * KeyFrames is a container for KeyAttribute,KeyCycle,KeyPosition etc.
25  */
26 
27 public class KeyFrames {
28     ArrayList<Keys> mKeys = new ArrayList<>();
29 
add(@uppressWarnings"HiddenTypeParameter") Keys keyFrame)30     public void add(@SuppressWarnings("HiddenTypeParameter") Keys keyFrame) {
31         mKeys.add(keyFrame);
32     }
33 
34     @Override
toString()35     public String toString() {
36         StringBuilder ret = new StringBuilder();
37         if (!mKeys.isEmpty()) {
38             ret.append("keyFrames:{\n");
39             for (Keys key : mKeys) {
40                 ret.append(key.toString());
41             }
42             ret.append("},\n");
43         }
44         return ret.toString();
45     }
46 }
47