The beginnings of the new status bar.

There is a lot of rough stuff still, but most of the functionality is here again.

Change-Id: I4b1241e61270f1434e798481afa83634233ee670
This commit is contained in:
Joe Onorato
2010-11-10 18:00:52 -08:00
parent 645336a742
commit fd52b18d9b
90 changed files with 1270 additions and 1093 deletions

View File

@@ -34,6 +34,7 @@ import android.util.AttributeSet;
import android.util.Log;
import android.view.RemotableViewMethod;
import android.view.View;
import android.view.ViewDebug;
import android.widget.RemoteViews.RemoteView;
@@ -84,7 +85,8 @@ public class ImageView extends View {
private boolean mCropToPadding;
private boolean mBaselineAligned = false;
private int mBaseline = -1;
private boolean mBaselineAlignBottom = false;
private static final ScaleType[] sScaleTypeArray = {
ScaleType.MATRIX,
@@ -118,9 +120,12 @@ public class ImageView extends View {
setImageDrawable(d);
}
mBaselineAligned = a.getBoolean(
mBaselineAlignBottom = a.getBoolean(
com.android.internal.R.styleable.ImageView_baselineAlignBottom, false);
mBaseline = a.getDimensionPixelSize(
com.android.internal.R.styleable.ImageView_baseline, -1);
setAdjustViewBounds(
a.getBoolean(com.android.internal.R.styleable.ImageView_adjustViewBounds,
false));
@@ -180,7 +185,7 @@ public class ImageView extends View {
super.invalidateDrawable(dr);
}
}
@Override
protected boolean onSetAlpha(int alpha) {
if (getBackground() == null) {
@@ -878,9 +883,63 @@ public class ImageView extends View {
}
}
/**
* <p>Return the offset of the widget's text baseline from the widget's top
* boundary. </p>
*
* @return the offset of the baseline within the widget's bounds or -1
* if baseline alignment is not supported.
*/
@Override
@ViewDebug.ExportedProperty(category = "layout")
public int getBaseline() {
return mBaselineAligned ? getMeasuredHeight() : -1;
if (mBaselineAlignBottom) {
return getMeasuredHeight();
} else {
return mBaseline;
}
}
/**
* <p>Set the offset of the widget's text baseline from the widget's top
* boundary. This value is overridden by the {@link #setBaselineAlignBottom}
* property.</p>
*
* @param baseline The baseline to use, or -1 if none is to be provided.
*
* @see #setBaseline
* @attr ref android.R.styleable#ImageView_baseline
*/
public void setBaseline(int baseline) {
if (mBaseline != baseline) {
mBaseline = baseline;
requestLayout();
}
}
/**
* Set whether to set the baseline of this view to the bottom of the view.
* Setting this value overrides any calls to setBaseline.
*
* @param aligned If true, the image view will be baseline aligned with
* based on its bottom edge.
*
* @attr ref android.R.styleable#ImageView_baselineAlignBottom
*/
public void setBaselineAlignBottom(boolean aligned) {
if (mBaselineAlignBottom != aligned) {
mBaselineAlignBottom = aligned;
requestLayout();
}
}
/**
* Return whether this view's baseline will be considered the bottom of the view.
*
* @see #setBaselineAlignBottom(boolean)
*/
public boolean getBaselineAlignBottom() {
return mBaselineAlignBottom;
}
/**

View File

@@ -2055,6 +2055,9 @@
<attr name="baselineAlignBottom" format="boolean" />
<!-- If true, the image will be cropped to fit within its padding. -->
<attr name="cropToPadding" format="boolean" />
<!-- The offset of the baseline within this view. See {see android.view.View#getBaseline}
for details -->
<attr name="baseline" format="dimension" />
</declare-styleable>
<declare-styleable name="ToggleButton">
<!-- The text for the button when it is checked. -->

View File

@@ -1376,6 +1376,7 @@
<public type="attr" name="progressBarPadding" />
<public type="attr" name="animationResolution" />
<public type="attr" name="state_accelerated" />
<public type="attr" name="baseline" />
<public type="anim" name="animator_fade_in" />
<public type="anim" name="animator_fade_out" />

View File

@@ -155,12 +155,6 @@
<item name="windowExitAnimation">@anim/shrink_fade_out_from_bottom</item>
</style>
<!-- {@hide} -->
<style name="Animation.SlidingCard">
<item name="windowEnterAnimation">@anim/slide_in_up</item>
<item name="windowExitAnimation">@anim/slide_out_down</item>
</style>
<!-- Window animations that are applied to input method overlay windows. -->
<style name="Animation.InputMethod">
<item name="windowEnterAnimation">@anim/input_method_enter</item>