am bf16485a: Merge "Dismiss all layout updates." into lmp-dev

* commit 'bf16485a3626782b50d8c71c69a5771851fe930c':
  Dismiss all layout updates.
This commit is contained in:
Jorim Jaggi
2014-08-05 13:06:58 +00:00
committed by Android Git Automerger
5 changed files with 33 additions and 62 deletions

View File

@@ -14,12 +14,17 @@
~ limitations under the License
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="48.0"
android:viewportHeight="48.0">
android:width="24dp"
android:height="24dp"
android:viewportWidth="48.0"
android:viewportHeight="48.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M10.0,26.0l28.0,0.0l0.0,-4.0L10.0,22.0L10.0,26.0zM6.0,34.0l28.0,0.0l0.0,-4.0L6.0,30.0L6.0,34.0zM14.0,14.0l0.0,4.0l28.0,0.0l0.0,-4.0L14.0,14.0z"/>
android:fillColor="#ffffff"
android:pathData="M8.0,19.994l32.0,0.0l0.0,8.0l-32.0,0.0z"/>
<path
android:fillColor="#ffffff"
android:pathData="M0.0,32.0l32.0,0.0l0.0,7.979l-32.0,0.0z"/>
<path
android:fillColor="#ffffff"
android:pathData="M16.0,8.0l32.0,0.0l0.0,8.0l-32.0,0.0z"/>
</vector>

View File

@@ -21,20 +21,11 @@
android:layout_height="wrap_content"
android:visibility="gone"
>
<Button
<ImageButton
android:id="@+id/dismiss_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="0dp"
android:textColor="#ffffffff"
android:text="@string/clear_all_notifications_text"
android:textSize="18sp"
android:textAllCaps="true"
android:paddingTop="@dimen/clear_all_padding_top"
android:paddingEnd="8dp"
android:layout_gravity="end|center_vertical"
android:drawableEnd="@drawable/ic_clear_all"
android:drawablePadding="4dp"
android:fontFamily="sans-serif-light"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="end"
android:src="@drawable/ic_dismiss_all"
android:background="@drawable/ripple_drawable" />
</com.android.systemui.statusbar.DismissView>

View File

@@ -381,7 +381,7 @@
<dimen name="battery_level_padding_end">4dp</dimen>
<!-- The top padding of the clear all button -->
<dimen name="clear_all_padding_top">4dp</dimen>
<dimen name="clear_all_padding_top">12dp</dimen>
<!-- Largest size an avatar might need to be drawn in the user picker, status bar, or
quick settings header -->

View File

@@ -19,23 +19,18 @@ package com.android.systemui.statusbar;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.view.animation.PathInterpolator;
import android.widget.Button;
import android.widget.TextView;
import com.android.systemui.R;
import com.android.systemui.statusbar.phone.PhoneStatusBar;
public class DismissView extends ExpandableView {
private Button mClearAllText;
private View mClearAllIcon;
private boolean mIsVisible;
private boolean mAnimating;
private boolean mWillBeGone;
private final Interpolator mAppearInterpolator = new PathInterpolator(0f, 0.2f, 1f, 1f);
private final Interpolator mDisappearInterpolator = new PathInterpolator(0f, 0f, 0.8f, 1f);
public DismissView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@@ -43,7 +38,7 @@ public class DismissView extends ExpandableView {
@Override
protected void onFinishInflate() {
super.onFinishInflate();
mClearAllText = (Button) findViewById(R.id.dismiss_text);
mClearAllIcon = findViewById(R.id.dismiss_text);
setInvisible();
}
@@ -83,12 +78,12 @@ public class DismissView extends ExpandableView {
float endValue = nowVisible ? 1.0f : 0.0f;
Interpolator interpolator;
if (nowVisible) {
interpolator = mAppearInterpolator;
interpolator = PhoneStatusBar.ALPHA_IN;
} else {
interpolator = mDisappearInterpolator;
interpolator = PhoneStatusBar.ALPHA_OUT;
}
mAnimating = true;
mClearAllText.animate()
mClearAllIcon.animate()
.alpha(endValue)
.setInterpolator(interpolator)
.setDuration(260)
@@ -111,7 +106,7 @@ public class DismissView extends ExpandableView {
}
public void setInvisible() {
mClearAllText.setAlpha(0.0f);
mClearAllIcon.setAlpha(0.0f);
mIsVisible = false;
}
@@ -134,7 +129,7 @@ public class DismissView extends ExpandableView {
}
public void setOnButtonClickListener(OnClickListener onClickListener) {
mClearAllText.setOnClickListener(onClickListener);
mClearAllIcon.setOnClickListener(onClickListener);
}
@Override
@@ -143,7 +138,7 @@ public class DismissView extends ExpandableView {
}
public void cancelAnimation() {
mClearAllText.animate().cancel();
mClearAllIcon.animate().cancel();
}
public boolean willBeGone() {

View File

@@ -501,31 +501,11 @@ public abstract class PanelView extends FrameLayout {
@Override
public void onAnimationEnd(Animator animation) {
if (clearAllExpandHack && !mCancelled) {
mHeightAnimator = createHeightAnimator(getMaxPanelHeight());
mHeightAnimator.setInterpolator(mLinearOutSlowInInterpolator);
mHeightAnimator.setDuration(350);
mHeightAnimator.addListener(new AnimatorListenerAdapter() {
private boolean mCancelled;
@Override
public void onAnimationCancel(Animator animation) {
mCancelled = true;
}
@Override
public void onAnimationEnd(Animator animation) {
mHeightAnimator = null;
if (!mCancelled) {
notifyExpandingFinished();
}
}
});
mHeightAnimator.start();
} else {
mHeightAnimator = null;
if (!mCancelled) {
notifyExpandingFinished();
}
setExpandedHeightInternal(getMaxPanelHeight());
}
mHeightAnimator = null;
if (!mCancelled) {
notifyExpandingFinished();
}
}
});