diff options
author | Dianne Hackborn <hackbod@google.com> | 2009-09-21 17:40:06 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-09-21 17:40:06 -0700 |
commit | 3ffe6b12c78397abb8ab1a3064583d5e8b6ce51c (patch) | |
tree | 1499d97bec99f817ec16515af06d745bb8eb1ae3 /core/java | |
parent | 0bee99f074b848a4fbe5138f4a6a200d6284f78b (diff) | |
parent | 7f3fb7dec2afdffa37e3067ca8a5b9d01809a9ce (diff) | |
download | frameworks_base-3ffe6b12c78397abb8ab1a3064583d5e8b6ce51c.zip frameworks_base-3ffe6b12c78397abb8ab1a3064583d5e8b6ce51c.tar.gz frameworks_base-3ffe6b12c78397abb8ab1a3064583d5e8b6ce51c.tar.bz2 |
am 7f3fb7de: Merge change 26130 into eclair
Merge commit '7f3fb7dec2afdffa37e3067ca8a5b9d01809a9ce' into eclair-plus-aosp
* commit '7f3fb7dec2afdffa37e3067ca8a5b9d01809a9ce':
Turn animations on by default.
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/app/Activity.java | 4 | ||||
-rw-r--r-- | core/java/android/content/Intent.java | 12 | ||||
-rw-r--r-- | core/java/android/text/format/Formatter.java | 35 | ||||
-rw-r--r-- | core/java/android/view/WindowManagerPolicy.java | 4 |
4 files changed, 46 insertions, 9 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index a86fe90..4561899 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -790,8 +790,8 @@ public class Activity extends ContextThemeWrapper * @see #onPostCreate */ protected void onCreate(Bundle savedInstanceState) { - mVisibleFromClient = mWindow.getWindowStyle().getBoolean( - com.android.internal.R.styleable.Window_windowNoDisplay, true); + mVisibleFromClient = !mWindow.getWindowStyle().getBoolean( + com.android.internal.R.styleable.Window_windowNoDisplay, false); mCalled = true; } diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 7366b8b..f6ca50d 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -2318,6 +2318,18 @@ public class Intent implements Parcelable { */ public static final int FLAG_ACTIVITY_REORDER_TO_FRONT = 0X00020000; /** + * If set in an Intent passed to {@link Context#startActivity Context.startActivity()}, + * this flag will prevent the system from applying an activity transition + * animation to go to the next activity state. This doesn't mean an + * animation will never run -- if another activity change happens that doesn't + * specify this flag before the activity started here is displayed, then + * that transition will be used. This this flag can be put to good use + * when you are going to do a series of activity operations but the + * animation seen by the user shouldn't be driven by the first activity + * change but rather a later one. + */ + public static final int FLAG_ACTIVITY_NO_ANIMATION = 0X00010000; + /** * If set, when sending a broadcast only registered receivers will be * called -- no BroadcastReceiver components will be launched. */ diff --git a/core/java/android/text/format/Formatter.java b/core/java/android/text/format/Formatter.java index 367b26c..baaa3ce 100644 --- a/core/java/android/text/format/Formatter.java +++ b/core/java/android/text/format/Formatter.java @@ -32,6 +32,18 @@ public final class Formatter { * @return formated string with the number */ public static String formatFileSize(Context context, long number) { + return formatFileSize(context, number, false); + } + + /** + * Like {@link #formatFileSize}, but trying to generate shorter numbers + * (showing fewer digits of precisin). + */ + public static String formatShortFileSize(Context context, long number) { + return formatFileSize(context, number, true); + } + + private static String formatFileSize(Context context, long number, boolean shorter) { if (context == null) { return ""; } @@ -58,13 +70,24 @@ public final class Formatter { suffix = com.android.internal.R.string.petabyteShort; result = result / 1024; } - if (result < 100) { - String value = String.format("%.2f", result); - return context.getResources(). - getString(com.android.internal.R.string.fileSizeSuffix, - value, context.getString(suffix)); + String value; + if (result < 1) { + value = String.format("%.2f", result); + } else if (result < 10) { + if (shorter) { + value = String.format("%.1f", result); + } else { + value = String.format("%.2f", result); + } + } else if (result < 100) { + if (shorter) { + value = String.format("%.0f", result); + } else { + value = String.format("%.2f", result); + } + } else { + value = String.format("%.0f", result); } - String value = String.format("%.0f", result); return context.getResources(). getString(com.android.internal.R.string.fileSizeSuffix, value, context.getString(suffix)); diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index 45ff27e..cc5aeb1 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -314,7 +314,9 @@ public interface WindowManagerPolicy { public boolean showLw(boolean doAnimation); } - /** No transition happening. */ + /** Not set up for a transition. */ + public final int TRANSIT_UNSET = 0; + /** No animation for transition. */ public final int TRANSIT_NONE = 0; /** Window has been added to the screen. */ public final int TRANSIT_ENTER = 1; |