Debian Codegraph @

sdk-common/src/main/java/com/android/ide/common/resources/configuration/ScreenRoundQualifier.java

raw
1 /*
2 * Copyright (C) 2015 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 com.android.ide.common.resources.configuration;
18
19 import com.android.annotations.Nullable;
20 import com.android.resources.ResourceEnum;
21 import com.android.resources.ScreenRound;
22
23 public class ScreenRoundQualifier extends EnumBasedResourceQualifier {
24
25 public static final String NAME = "Screen Roundness";
26
27 @Nullable
28 private ScreenRound mValue = null;
29
30 public ScreenRoundQualifier() {
31 }
32
33 public ScreenRoundQualifier(@Nullable ScreenRound value) {
34 mValue = value;
35 }
36
37 public ScreenRound getValue() {
38 return mValue;
39 }
40
41 @Override
42 ResourceEnum getEnumValue() {
43 return mValue;
44 }
45
46 @Override
47 public String getName() {
48 return NAME;
49 }
50
51 @Override
52 public String getShortName() {
53 return "Roundness";
54 }
55
56 @Override
57 public int since() {
58 return 23;
59 }
60
61 @Override
62 public boolean checkAndSet(String value, FolderConfiguration config) {
63 ScreenRound roundness = ScreenRound.getEnum(value);
64 if (roundness != null) {
65 ScreenRoundQualifier qualifier = new ScreenRoundQualifier(roundness);
66 config.setScreenRoundQualifier(qualifier);
67 return true;
68 }
69
70 return false;
71 }
72 }