• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 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 package com.android.internal.widget.remotecompose.core.operations.layout.modifiers;
17 
18 /** Known shapes, used for modifiers (clip/background/border) */
19 public class ShapeType {
20     public static final int RECTANGLE = 0;
21     public static final int CIRCLE = 1;
22     public static final int ROUNDED_RECTANGLE = 2;
23 
24     /**
25      * Returns a string representation of the value. Used during serialization.
26      *
27      * @param value
28      * @return
29      */
getString(int value)30     public static String getString(int value) {
31         switch (value) {
32             case ShapeType.RECTANGLE:
33                 return "RECTANGLE";
34             case ShapeType.CIRCLE:
35                 return "CIRCLE";
36             case ShapeType.ROUNDED_RECTANGLE:
37                 return "ROUNDED_RECTANGLE";
38             default:
39                 return "INVALID_SHAPE_TYPE[" + value + "]";
40         }
41     }
42 }
43