blob: a2d4b95d3422a6394a826264bc7c9a2dcc8087f0 [file] [log] [blame]
Joe Onorato503007d2010-04-16 09:20:55 -07001/*
2 * Copyright (C) 2008 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
Joe Onorato79de0c52010-05-26 17:03:26 -040017package com.android.systemui.statusbar;
Joe Onorato503007d2010-04-16 09:20:55 -070018
19import android.content.Context;
20import android.util.AttributeSet;
21import android.view.Display;
22import android.view.KeyEvent;
23import android.view.MotionEvent;
24import android.view.WindowManager;
25import android.widget.LinearLayout;
26import android.util.Slog;
27
28
29public class ExpandedView extends LinearLayout {
Joe Onorato808182d2010-07-09 18:52:06 -040030 PhoneStatusBarService mService;
Joe Onorato503007d2010-04-16 09:20:55 -070031 int mPrevHeight = -1;
32
33 public ExpandedView(Context context, AttributeSet attrs) {
34 super(context, attrs);
35 }
36
37 @Override
38 protected void onFinishInflate() {
39 super.onFinishInflate();
40 }
41
42 /** We want to shrink down to 0, and ignore the background. */
43 @Override
44 public int getSuggestedMinimumHeight() {
45 return 0;
46 }
47
48 @Override
49 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
50 super.onLayout(changed, left, top, right, bottom);
51 int height = bottom - top;
52 if (height != mPrevHeight) {
Joe Onorato1c95ecb2010-06-28 17:19:12 -040053 //Slog.d(StatusBarService.TAG, "height changed old=" + mPrevHeight
Joe Onorato503007d2010-04-16 09:20:55 -070054 // + " new=" + height);
55 mPrevHeight = height;
Joe Onorato808182d2010-07-09 18:52:06 -040056 mService.updateExpandedViewPos(PhoneStatusBarService.EXPANDED_LEAVE_ALONE);
Joe Onorato503007d2010-04-16 09:20:55 -070057 }
58 }
59}