am 5f9e92f4: Merge "Fix animation of notification handle bar when panel changes height" into jb-mr1-dev
* commit '5f9e92f46fe06689a3018929590ef5f79688f0bc': Fix animation of notification handle bar when panel changes height
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
android:background="@drawable/notification_panel_bg"
|
||||
android:paddingTop="@dimen/notification_panel_padding_top"
|
||||
android:layout_marginLeft="@dimen/notification_panel_margin_left"
|
||||
android:animateLayoutChanges="true"
|
||||
>
|
||||
|
||||
<TextView
|
||||
@@ -80,18 +79,10 @@
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/handle"
|
||||
<View android:id="@+id/handle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/close_handle_height"
|
||||
android:layout_gravity="bottom"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/close_handle_height"
|
||||
android:layout_gravity="bottom"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/status_bar_close"
|
||||
/>
|
||||
</LinearLayout>
|
||||
/>
|
||||
|
||||
</com.android.systemui.statusbar.phone.NotificationPanelView><!-- end of sliding panel -->
|
||||
|
||||
@@ -17,11 +17,23 @@
|
||||
package com.android.systemui.statusbar.phone;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import com.android.systemui.R;
|
||||
|
||||
public class NotificationPanelView extends PanelView {
|
||||
|
||||
Drawable mHandleBar;
|
||||
float mHandleBarHeight;
|
||||
|
||||
public NotificationPanelView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
Resources resources = context.getResources();
|
||||
mHandleBar = resources.getDrawable(R.drawable.status_bar_close);
|
||||
mHandleBarHeight = resources.getDimension(R.dimen.close_handle_height);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -31,4 +43,20 @@ public class NotificationPanelView extends PanelView {
|
||||
"notifications,v=" + vel);
|
||||
super.fling(vel, always);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
if (changed) {
|
||||
mHandleBar.setBounds(0, 0, getWidth(), (int) mHandleBarHeight);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
super.draw(canvas);
|
||||
canvas.translate(0, getHeight() - mHandleBarHeight);
|
||||
mHandleBar.draw(canvas);
|
||||
canvas.translate(0, -getHeight() + mHandleBarHeight);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user