Joe Onorato | 503007d | 2010-04-16 09:20:55 -0700 | [diff] [blame] | 1 | /* |
| 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 Onorato | 79de0c5 | 2010-05-26 17:03:26 -0400 | [diff] [blame] | 17 | package com.android.systemui.statusbar; |
Joe Onorato | 503007d | 2010-04-16 09:20:55 -0700 | [diff] [blame] | 18 | |
| 19 | import android.content.Context; |
| 20 | import android.util.AttributeSet; |
| 21 | import android.view.Display; |
| 22 | import android.view.KeyEvent; |
| 23 | import android.view.MotionEvent; |
| 24 | import android.view.WindowManager; |
| 25 | import android.widget.LinearLayout; |
| 26 | import android.util.Slog; |
| 27 | |
| 28 | |
| 29 | public class ExpandedView extends LinearLayout { |
Joe Onorato | 808182d | 2010-07-09 18:52:06 -0400 | [diff] [blame] | 30 | PhoneStatusBarService mService; |
Joe Onorato | 503007d | 2010-04-16 09:20:55 -0700 | [diff] [blame] | 31 | 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 Onorato | 1c95ecb | 2010-06-28 17:19:12 -0400 | [diff] [blame] | 53 | //Slog.d(StatusBarService.TAG, "height changed old=" + mPrevHeight |
Joe Onorato | 503007d | 2010-04-16 09:20:55 -0700 | [diff] [blame] | 54 | // + " new=" + height); |
| 55 | mPrevHeight = height; |
Joe Onorato | 808182d | 2010-07-09 18:52:06 -0400 | [diff] [blame] | 56 | mService.updateExpandedViewPos(PhoneStatusBarService.EXPANDED_LEAVE_ALONE); |
Joe Onorato | 503007d | 2010-04-16 09:20:55 -0700 | [diff] [blame] | 57 | } |
| 58 | } |
| 59 | } |