blob: 867677a46a588788c7bcc8bc7ebd80884ce89b77 [file] [log] [blame]
Dave Mankoffc4fe6c42019-11-18 17:03:29 -05001/*
2 * Copyright (C) 2019 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
17package com.android.systemui.qs;
18
19import com.android.systemui.R;
20
21import javax.inject.Inject;
22
23public class QuickStatusBarHeaderController {
24 private final QuickStatusBarHeader mView;
25 private final QSCarrierGroupController mQSCarrierGroupController;
26
27 private QuickStatusBarHeaderController(QuickStatusBarHeader view,
28 QSCarrierGroupController.Builder qsCarrierGroupControllerBuilder) {
29 mView = view;
30 mQSCarrierGroupController = qsCarrierGroupControllerBuilder
31 .setQSCarrierGroup(mView.findViewById(R.id.carrier_group))
32 .build();
33 }
34
35 public void setListening(boolean listening) {
36 mQSCarrierGroupController.setListening(listening);
37 // TODO: move mView.setListening logic into here.
38 mView.setListening(listening);
39 }
40
41
42 public static class Builder {
43 private final QSCarrierGroupController.Builder mQSCarrierGroupControllerBuilder;
44 private QuickStatusBarHeader mView;
45
46 @Inject
47 public Builder(QSCarrierGroupController.Builder qsCarrierGroupControllerBuilder) {
48 mQSCarrierGroupControllerBuilder = qsCarrierGroupControllerBuilder;
49 }
50
51 public Builder setQuickStatusBarHeader(QuickStatusBarHeader view) {
52 mView = view;
53 return this;
54 }
55
56 public QuickStatusBarHeaderController build() {
57 return new QuickStatusBarHeaderController(mView, mQSCarrierGroupControllerBuilder);
58 }
59 }
60}