Home | History | Annotate | Download | only in statusbar
      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 
     17 package com.android.systemui.statusbar;
     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 {
     30     StatusBarService mService;
     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) {
     53              //Slog.d(StatusBarService.TAG, "height changed old=" + mPrevHeight
     54              //     + " new=" + height);
     55              mPrevHeight = height;
     56              mService.updateExpandedViewPos(StatusBarService.EXPANDED_LEAVE_ALONE);
     57          }
     58      }
     59 }
     60