1717package com .android .systemui .statusbar .phone ;
1818
1919import android .content .Context ;
20+ import android .content .res .Resources ;
21+ import android .graphics .Canvas ;
22+ import android .graphics .drawable .Drawable ;
2023import android .util .AttributeSet ;
24+ import com .android .systemui .R ;
2125
2226public class NotificationPanelView extends PanelView {
27+
28+ Drawable mHandleBar ;
29+ float mHandleBarHeight ;
30+
2331 public NotificationPanelView (Context context , AttributeSet attrs ) {
2432 super (context , attrs );
33+
34+ Resources resources = context .getResources ();
35+ mHandleBar = resources .getDrawable (R .drawable .status_bar_close );
36+ mHandleBarHeight = resources .getDimension (R .dimen .close_handle_height );
2537 }
2638
2739 @ Override
@@ -31,4 +43,20 @@ public void fling(float vel, boolean always) {
3143 "notifications,v=" + vel );
3244 super .fling (vel , always );
3345 }
46+
47+ @ Override
48+ protected void onLayout (boolean changed , int left , int top , int right , int bottom ) {
49+ super .onLayout (changed , left , top , right , bottom );
50+ if (changed ) {
51+ mHandleBar .setBounds (0 , 0 , getWidth (), (int ) mHandleBarHeight );
52+ }
53+ }
54+
55+ @ Override
56+ public void draw (Canvas canvas ) {
57+ super .draw (canvas );
58+ canvas .translate (0 , getHeight () - mHandleBarHeight );
59+ mHandleBar .draw (canvas );
60+ canvas .translate (0 , -getHeight () + mHandleBarHeight );
61+ }
3462}
0 commit comments