1/* 2 * Copyright (C) 2014 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.statusbar; 18 19import android.content.Context; 20import android.util.AttributeSet; 21import android.widget.TextView; 22 23import com.android.systemui.R; 24import com.android.systemui.ViewInvertHelper; 25import com.android.systemui.statusbar.phone.NotificationPanelView; 26 27/** 28 * Container view for overflowing notification icons on Keyguard. 29 */ 30public class NotificationOverflowContainer extends ActivatableNotificationView { 31 32 private NotificationOverflowIconsView mIconsView; 33 private ViewInvertHelper mViewInvertHelper; 34 private boolean mDark; 35 36 public NotificationOverflowContainer(Context context, AttributeSet attrs) { 37 super(context, attrs); 38 } 39 40 @Override 41 protected void onFinishInflate() { 42 super.onFinishInflate(); 43 mIconsView = (NotificationOverflowIconsView) findViewById(R.id.overflow_icons_view); 44 mIconsView.setMoreText((TextView) findViewById(R.id.more_text)); 45 mIconsView.setOverflowIndicator(findViewById(R.id.more_icon_overflow)); 46 mViewInvertHelper = new ViewInvertHelper(findViewById(R.id.content), 47 NotificationPanelView.DOZE_ANIMATION_DURATION); 48 } 49 50 @Override 51 public void setDark(boolean dark, boolean fade, long delay) { 52 super.setDark(dark, fade, delay); 53 if (mDark == dark) return; 54 mDark = dark; 55 if (fade) { 56 mViewInvertHelper.fade(dark, delay); 57 } else { 58 mViewInvertHelper.update(dark); 59 } 60 } 61 62 public NotificationOverflowIconsView getIconsView() { 63 return mIconsView; 64 } 65} 66