• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020 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.systemui.car.hvac;
18 
19 /**
20  * Interface for Views that display temperature HVAC properties.
21  */
22 public interface TemperatureView {
23 
24     /**
25      * Sets the {@link HvacController} to handle changes to HVAC properties. The View is only
26      * responsible for the UI to display temperature. It should not contain logic that makes direct
27      * changes to HVAC properties and instead use this {@link HvacController}.
28      */
setHvacController(HvacController controller)29     void setHvacController(HvacController controller);
30 
31     /**
32      * Formats the float for display
33      *
34      * @param temp - The current temp in Celsius or NaN
35      */
setTemp(float temp)36     void setTemp(float temp);
37 
38     /**
39      * Renders the displayed temperature in Fahrenheit
40      *
41      * @param displayFahrenheit - True if temperature should be displayed in Fahrenheit
42      */
setDisplayInFahrenheit(boolean displayFahrenheit)43     void setDisplayInFahrenheit(boolean displayFahrenheit);
44 
45     /**
46      * @return hvac AreaId - Example: VehicleAreaSeat.SEAT_ROW_1_LEFT (1)
47      */
getAreaId()48     int getAreaId();
49 
50     /**
51      * Performs any action needed when locale is changed.
52      */
onLocaleListChanged()53     default void onLocaleListChanged() {}
54 }
55