Home | History | Annotate | Download | only in car
      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.systemui.statusbar.car;
     18 
     19 import android.view.View;
     20 import android.view.ViewStub;
     21 
     22 import com.android.systemui.R;
     23 import com.android.systemui.statusbar.phone.PhoneStatusBar;
     24 import com.android.systemui.statusbar.policy.UserSwitcherController;
     25 
     26 /**
     27  * Manages the fullscreen user switcher.
     28  */
     29 public class FullscreenUserSwitcher {
     30 
     31     private View mContainer;
     32     private UserGridView mUserGridView;
     33     private UserSwitcherController mUserSwitcherController;
     34 
     35     public FullscreenUserSwitcher(PhoneStatusBar statusBar,
     36             UserSwitcherController userSwitcherController,
     37             ViewStub containerStub) {
     38         mUserSwitcherController = userSwitcherController;
     39         mContainer = containerStub.inflate();
     40         mUserGridView = (UserGridView) mContainer.findViewById(R.id.user_grid);
     41         mUserGridView.init(statusBar, mUserSwitcherController);
     42     }
     43 
     44     public void onUserSwitched(int newUserId) {
     45         mUserGridView.onUserSwitched(newUserId);
     46     }
     47 
     48     public void show() {
     49         mContainer.setVisibility(View.VISIBLE);
     50     }
     51 
     52     public void hide() {
     53         mContainer.setVisibility(View.GONE);
     54     }
     55 }
     56 
     57