• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2012 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.phone;
18 
19 import android.content.Context;
20 import android.content.res.Configuration;
21 import android.util.AttributeSet;
22 import android.view.MotionEvent;
23 import android.widget.FrameLayout;
24 
25 public abstract class PanelView extends FrameLayout {
26     public static final boolean DEBUG = PanelBar.DEBUG;
27     public static final String TAG = PanelView.class.getSimpleName();
28     private PanelViewController.TouchHandler mTouchHandler;
29 
30     protected StatusBar mStatusBar;
31     protected HeadsUpManagerPhone mHeadsUpManager;
32 
33     protected KeyguardBottomAreaView mKeyguardBottomArea;
34     private OnConfigurationChangedListener mOnConfigurationChangedListener;
35 
PanelView(Context context)36     public PanelView(Context context) {
37         super(context);
38     }
39 
PanelView(Context context, AttributeSet attrs)40     public PanelView(Context context, AttributeSet attrs) {
41         super(context, attrs);
42     }
43 
PanelView(Context context, AttributeSet attrs, int defStyleAttr)44     public PanelView(Context context, AttributeSet attrs, int defStyleAttr) {
45         super(context, attrs, defStyleAttr);
46     }
47 
PanelView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)48     public PanelView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
49         super(context, attrs, defStyleAttr, defStyleRes);
50     }
51 
setOnTouchListener(PanelViewController.TouchHandler touchHandler)52     public void setOnTouchListener(PanelViewController.TouchHandler touchHandler) {
53         super.setOnTouchListener(touchHandler);
54         mTouchHandler = touchHandler;
55     }
56 
setOnConfigurationChangedListener(OnConfigurationChangedListener listener)57     public void setOnConfigurationChangedListener(OnConfigurationChangedListener listener) {
58         mOnConfigurationChangedListener = listener;
59     }
60 
61     @Override
onInterceptTouchEvent(MotionEvent event)62     public boolean onInterceptTouchEvent(MotionEvent event) {
63         return mTouchHandler.onInterceptTouchEvent(event);
64     }
65 
66     @Override
dispatchConfigurationChanged(Configuration newConfig)67     public void dispatchConfigurationChanged(Configuration newConfig) {
68         super.dispatchConfigurationChanged(newConfig);
69         mOnConfigurationChangedListener.onConfigurationChanged(newConfig);
70     }
71 
72     interface OnConfigurationChangedListener {
onConfigurationChanged(Configuration newConfig)73         void onConfigurationChanged(Configuration newConfig);
74     }
75 }
76