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 distributed under the
11  * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
12  * KIND, either express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 package com.android.systemui.unfold.config
16 
17 import android.content.res.Resources
18 import javax.inject.Inject
19 import javax.inject.Singleton
20 
21 @Singleton
22 class ResourceUnfoldTransitionConfig @Inject constructor() : UnfoldTransitionConfig {
23 
<lambda>null24     override val isEnabled: Boolean by lazy {
25         val id = Resources.getSystem()
26             .getIdentifier("config_unfoldTransitionEnabled", "bool", "android")
27         Resources.getSystem().getBoolean(id)
28     }
29 
<lambda>null30     override val isHingeAngleEnabled: Boolean by lazy {
31         val id = Resources.getSystem()
32             .getIdentifier("config_unfoldTransitionHingeAngle", "bool", "android")
33         Resources.getSystem().getBoolean(id)
34     }
35 
<lambda>null36     override val isHapticsEnabled: Boolean by lazy {
37         val id = Resources.getSystem()
38             .getIdentifier("config_unfoldTransitionHapticsEnabled", "bool", "android")
39         Resources.getSystem().getBoolean(id)
40     }
41 
<lambda>null42     override val halfFoldedTimeoutMillis: Int by lazy {
43         val id = Resources.getSystem()
44             .getIdentifier("config_unfoldTransitionHalfFoldedTimeout", "integer", "android")
45         Resources.getSystem().getInteger(id)
46     }
47 }
48