The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.view; |
| 18 | |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 19 | import android.app.Presentation; |
| 20 | import android.content.Context; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 21 | import android.content.pm.ActivityInfo; |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame^] | 22 | import android.graphics.Insets; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 23 | import android.graphics.PixelFormat; |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame^] | 24 | import android.graphics.Rect; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | import android.os.IBinder; |
| 26 | import android.os.Parcel; |
| 27 | import android.os.Parcelable; |
| 28 | import android.text.TextUtils; |
| 29 | import android.util.Log; |
| 30 | |
| 31 | |
| 32 | /** |
| 33 | * The interface that apps use to talk to the window manager. |
| 34 | * <p> |
| 35 | * Use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code> to get one of these. |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 36 | * </p><p> |
| 37 | * Each window manager instance is bound to a particular {@link Display}. |
| 38 | * To obtain a {@link WindowManager} for a different display, use |
| 39 | * {@link Context#createDisplayContext} to obtain a {@link Context} for that |
| 40 | * display, then use <code>Context.getSystemService(Context.WINDOW_SERVICE)</code> |
| 41 | * to get the WindowManager. |
| 42 | * </p><p> |
| 43 | * The simplest way to show a window on another display is to create a |
| 44 | * {@link Presentation}. The presentation will automatically obtain a |
| 45 | * {@link WindowManager} and {@link Context} for that display. |
| 46 | * </p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 47 | * |
| 48 | * @see android.content.Context#getSystemService |
| 49 | * @see android.content.Context#WINDOW_SERVICE |
| 50 | */ |
| 51 | public interface WindowManager extends ViewManager { |
| 52 | /** |
| 53 | * Exception that is thrown when trying to add view whose |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 54 | * {@link LayoutParams} {@link LayoutParams#token} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 55 | * is invalid. |
| 56 | */ |
| 57 | public static class BadTokenException extends RuntimeException { |
| 58 | public BadTokenException() { |
| 59 | } |
| 60 | |
| 61 | public BadTokenException(String name) { |
| 62 | super(name); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | /** |
Craig Mautner | 6018aee | 2012-10-23 14:27:49 -0700 | [diff] [blame] | 67 | * Exception that is thrown when calling {@link #addView} to a secondary display that cannot |
| 68 | * be found. See {@link android.app.Presentation} for more information on secondary displays. |
| 69 | */ |
| 70 | public static class InvalidDisplayException extends RuntimeException { |
| 71 | public InvalidDisplayException() { |
| 72 | } |
| 73 | |
| 74 | public InvalidDisplayException(String name) { |
| 75 | super(name); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | /** |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 80 | * Returns the {@link Display} upon which this {@link WindowManager} instance |
| 81 | * will create new windows. |
| 82 | * <p> |
| 83 | * Despite the name of this method, the display that is returned is not |
| 84 | * necessarily the primary display of the system (see {@link Display#DEFAULT_DISPLAY}). |
| 85 | * The returned display could instead be a secondary display that this |
| 86 | * window manager instance is managing. Think of it as the display that |
| 87 | * this {@link WindowManager} instance uses by default. |
| 88 | * </p><p> |
| 89 | * To create windows on a different display, you need to obtain a |
| 90 | * {@link WindowManager} for that {@link Display}. (See the {@link WindowManager} |
| 91 | * class documentation for more information.) |
| 92 | * </p> |
| 93 | * |
| 94 | * @return The display that this window manager is managing. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 95 | */ |
| 96 | public Display getDefaultDisplay(); |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 97 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 98 | /** |
| 99 | * Special variation of {@link #removeView} that immediately invokes |
| 100 | * the given view hierarchy's {@link View#onDetachedFromWindow() |
| 101 | * View.onDetachedFromWindow()} methods before returning. This is not |
| 102 | * for normal applications; using it correctly requires great care. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 103 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 104 | * @param view The view to be removed. |
| 105 | */ |
| 106 | public void removeViewImmediate(View view); |
Jeff Brown | d32460c | 2012-07-20 16:15:36 -0700 | [diff] [blame] | 107 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 108 | public static class LayoutParams extends ViewGroup.LayoutParams |
| 109 | implements Parcelable { |
| 110 | /** |
| 111 | * X position for this window. With the default gravity it is ignored. |
Fabrice Di Meglio | 9e3b002 | 2011-06-06 16:30:29 -0700 | [diff] [blame] | 112 | * When using {@link Gravity#LEFT} or {@link Gravity#START} or {@link Gravity#RIGHT} or |
| 113 | * {@link Gravity#END} it provides an offset from the given edge. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 114 | */ |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 115 | @ViewDebug.ExportedProperty |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 116 | public int x; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 117 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 118 | /** |
| 119 | * Y position for this window. With the default gravity it is ignored. |
| 120 | * When using {@link Gravity#TOP} or {@link Gravity#BOTTOM} it provides |
| 121 | * an offset from the given edge. |
| 122 | */ |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 123 | @ViewDebug.ExportedProperty |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 124 | public int y; |
| 125 | |
| 126 | /** |
| 127 | * Indicates how much of the extra space will be allocated horizontally |
| 128 | * to the view associated with these LayoutParams. Specify 0 if the view |
| 129 | * should not be stretched. Otherwise the extra pixels will be pro-rated |
| 130 | * among all views whose weight is greater than 0. |
| 131 | */ |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 132 | @ViewDebug.ExportedProperty |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 133 | public float horizontalWeight; |
| 134 | |
| 135 | /** |
| 136 | * Indicates how much of the extra space will be allocated vertically |
| 137 | * to the view associated with these LayoutParams. Specify 0 if the view |
| 138 | * should not be stretched. Otherwise the extra pixels will be pro-rated |
| 139 | * among all views whose weight is greater than 0. |
| 140 | */ |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 141 | @ViewDebug.ExportedProperty |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 142 | public float verticalWeight; |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 143 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 144 | /** |
| 145 | * The general type of window. There are three main classes of |
| 146 | * window types: |
| 147 | * <ul> |
| 148 | * <li> <strong>Application windows</strong> (ranging from |
| 149 | * {@link #FIRST_APPLICATION_WINDOW} to |
| 150 | * {@link #LAST_APPLICATION_WINDOW}) are normal top-level application |
| 151 | * windows. For these types of windows, the {@link #token} must be |
| 152 | * set to the token of the activity they are a part of (this will |
| 153 | * normally be done for you if {@link #token} is null). |
| 154 | * <li> <strong>Sub-windows</strong> (ranging from |
| 155 | * {@link #FIRST_SUB_WINDOW} to |
| 156 | * {@link #LAST_SUB_WINDOW}) are associated with another top-level |
| 157 | * window. For these types of windows, the {@link #token} must be |
| 158 | * the token of the window it is attached to. |
| 159 | * <li> <strong>System windows</strong> (ranging from |
| 160 | * {@link #FIRST_SYSTEM_WINDOW} to |
| 161 | * {@link #LAST_SYSTEM_WINDOW}) are special types of windows for |
| 162 | * use by the system for specific purposes. They should not normally |
| 163 | * be used by applications, and a special permission is required |
| 164 | * to use them. |
| 165 | * </ul> |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 166 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 167 | * @see #TYPE_BASE_APPLICATION |
| 168 | * @see #TYPE_APPLICATION |
| 169 | * @see #TYPE_APPLICATION_STARTING |
| 170 | * @see #TYPE_APPLICATION_PANEL |
| 171 | * @see #TYPE_APPLICATION_MEDIA |
| 172 | * @see #TYPE_APPLICATION_SUB_PANEL |
| 173 | * @see #TYPE_APPLICATION_ATTACHED_DIALOG |
| 174 | * @see #TYPE_STATUS_BAR |
| 175 | * @see #TYPE_SEARCH_BAR |
| 176 | * @see #TYPE_PHONE |
| 177 | * @see #TYPE_SYSTEM_ALERT |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 178 | * @see #TYPE_TOAST |
| 179 | * @see #TYPE_SYSTEM_OVERLAY |
| 180 | * @see #TYPE_PRIORITY_PHONE |
| 181 | * @see #TYPE_STATUS_BAR_PANEL |
| 182 | * @see #TYPE_SYSTEM_DIALOG |
| 183 | * @see #TYPE_KEYGUARD_DIALOG |
| 184 | * @see #TYPE_SYSTEM_ERROR |
| 185 | * @see #TYPE_INPUT_METHOD |
| 186 | * @see #TYPE_INPUT_METHOD_DIALOG |
| 187 | */ |
Joe Onorato | 8f2bd43 | 2010-03-25 11:45:28 -0700 | [diff] [blame] | 188 | @ViewDebug.ExportedProperty(mapping = { |
| 189 | @ViewDebug.IntToString(from = TYPE_BASE_APPLICATION, to = "TYPE_BASE_APPLICATION"), |
| 190 | @ViewDebug.IntToString(from = TYPE_APPLICATION, to = "TYPE_APPLICATION"), |
| 191 | @ViewDebug.IntToString(from = TYPE_APPLICATION_STARTING, to = "TYPE_APPLICATION_STARTING"), |
| 192 | @ViewDebug.IntToString(from = TYPE_APPLICATION_PANEL, to = "TYPE_APPLICATION_PANEL"), |
| 193 | @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA, to = "TYPE_APPLICATION_MEDIA"), |
| 194 | @ViewDebug.IntToString(from = TYPE_APPLICATION_SUB_PANEL, to = "TYPE_APPLICATION_SUB_PANEL"), |
| 195 | @ViewDebug.IntToString(from = TYPE_APPLICATION_ATTACHED_DIALOG, to = "TYPE_APPLICATION_ATTACHED_DIALOG"), |
Scott Anderson | aeb7723 | 2012-05-31 18:55:54 -0700 | [diff] [blame] | 196 | @ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA_OVERLAY, to = "TYPE_APPLICATION_MEDIA_OVERLAY"), |
Joe Onorato | 8f2bd43 | 2010-03-25 11:45:28 -0700 | [diff] [blame] | 197 | @ViewDebug.IntToString(from = TYPE_STATUS_BAR, to = "TYPE_STATUS_BAR"), |
| 198 | @ViewDebug.IntToString(from = TYPE_SEARCH_BAR, to = "TYPE_SEARCH_BAR"), |
| 199 | @ViewDebug.IntToString(from = TYPE_PHONE, to = "TYPE_PHONE"), |
| 200 | @ViewDebug.IntToString(from = TYPE_SYSTEM_ALERT, to = "TYPE_SYSTEM_ALERT"), |
Joe Onorato | 8f2bd43 | 2010-03-25 11:45:28 -0700 | [diff] [blame] | 201 | @ViewDebug.IntToString(from = TYPE_TOAST, to = "TYPE_TOAST"), |
| 202 | @ViewDebug.IntToString(from = TYPE_SYSTEM_OVERLAY, to = "TYPE_SYSTEM_OVERLAY"), |
| 203 | @ViewDebug.IntToString(from = TYPE_PRIORITY_PHONE, to = "TYPE_PRIORITY_PHONE"), |
Joe Onorato | 8f2bd43 | 2010-03-25 11:45:28 -0700 | [diff] [blame] | 204 | @ViewDebug.IntToString(from = TYPE_SYSTEM_DIALOG, to = "TYPE_SYSTEM_DIALOG"), |
| 205 | @ViewDebug.IntToString(from = TYPE_KEYGUARD_DIALOG, to = "TYPE_KEYGUARD_DIALOG"), |
| 206 | @ViewDebug.IntToString(from = TYPE_SYSTEM_ERROR, to = "TYPE_SYSTEM_ERROR"), |
| 207 | @ViewDebug.IntToString(from = TYPE_INPUT_METHOD, to = "TYPE_INPUT_METHOD"), |
Jeff Brown | 3b2b354 | 2010-10-15 00:54:27 -0700 | [diff] [blame] | 208 | @ViewDebug.IntToString(from = TYPE_INPUT_METHOD_DIALOG, to = "TYPE_INPUT_METHOD_DIALOG"), |
Jeff Brown | bfcb60a | 2011-09-08 18:51:14 -0700 | [diff] [blame] | 209 | @ViewDebug.IntToString(from = TYPE_WALLPAPER, to = "TYPE_WALLPAPER"), |
| 210 | @ViewDebug.IntToString(from = TYPE_STATUS_BAR_PANEL, to = "TYPE_STATUS_BAR_PANEL"), |
Dianne Hackborn | 29aae6f | 2011-08-18 18:30:09 -0700 | [diff] [blame] | 211 | @ViewDebug.IntToString(from = TYPE_SECURE_SYSTEM_OVERLAY, to = "TYPE_SECURE_SYSTEM_OVERLAY"), |
Jeff Brown | bfcb60a | 2011-09-08 18:51:14 -0700 | [diff] [blame] | 212 | @ViewDebug.IntToString(from = TYPE_DRAG, to = "TYPE_DRAG"), |
| 213 | @ViewDebug.IntToString(from = TYPE_STATUS_BAR_SUB_PANEL, to = "TYPE_STATUS_BAR_SUB_PANEL"), |
| 214 | @ViewDebug.IntToString(from = TYPE_POINTER, to = "TYPE_POINTER"), |
| 215 | @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR, to = "TYPE_NAVIGATION_BAR"), |
| 216 | @ViewDebug.IntToString(from = TYPE_VOLUME_OVERLAY, to = "TYPE_VOLUME_OVERLAY"), |
Scott Anderson | aeb7723 | 2012-05-31 18:55:54 -0700 | [diff] [blame] | 217 | @ViewDebug.IntToString(from = TYPE_BOOT_PROGRESS, to = "TYPE_BOOT_PROGRESS"), |
| 218 | @ViewDebug.IntToString(from = TYPE_HIDDEN_NAV_CONSUMER, to = "TYPE_HIDDEN_NAV_CONSUMER"), |
| 219 | @ViewDebug.IntToString(from = TYPE_DREAM, to = "TYPE_DREAM"), |
Jeff Brown | bd6e150 | 2012-08-28 03:27:37 -0700 | [diff] [blame] | 220 | @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR_PANEL, to = "TYPE_NAVIGATION_BAR_PANEL"), |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 221 | @ViewDebug.IntToString(from = TYPE_DISPLAY_OVERLAY, to = "TYPE_DISPLAY_OVERLAY"), |
keunyoung | a446bf0 | 2013-06-21 19:07:57 -0700 | [diff] [blame] | 222 | @ViewDebug.IntToString(from = TYPE_MAGNIFICATION_OVERLAY, to = "TYPE_MAGNIFICATION_OVERLAY"), |
Dianne Hackborn | e30e02f | 2014-05-27 18:24:45 -0700 | [diff] [blame] | 223 | @ViewDebug.IntToString(from = TYPE_PRIVATE_PRESENTATION, to = "TYPE_PRIVATE_PRESENTATION"), |
| 224 | @ViewDebug.IntToString(from = TYPE_VOICE_INTERACTION, to = "TYPE_VOICE_INTERACTION"), |
Joe Onorato | 8f2bd43 | 2010-03-25 11:45:28 -0700 | [diff] [blame] | 225 | }) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 226 | public int type; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 227 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 228 | /** |
| 229 | * Start of window types that represent normal application windows. |
| 230 | */ |
| 231 | public static final int FIRST_APPLICATION_WINDOW = 1; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 232 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 233 | /** |
| 234 | * Window type: an application window that serves as the "base" window |
| 235 | * of the overall application; all other application windows will |
| 236 | * appear on top of it. |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 237 | * In multiuser systems shows only on the owning user's window. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 238 | */ |
| 239 | public static final int TYPE_BASE_APPLICATION = 1; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 240 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 241 | /** |
| 242 | * Window type: a normal application window. The {@link #token} must be |
| 243 | * an Activity token identifying who the window belongs to. |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 244 | * In multiuser systems shows only on the owning user's window. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 245 | */ |
| 246 | public static final int TYPE_APPLICATION = 2; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 247 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 248 | /** |
| 249 | * Window type: special application window that is displayed while the |
| 250 | * application is starting. Not for use by applications themselves; |
| 251 | * this is used by the system to display something until the |
| 252 | * application can show its own windows. |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 253 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 254 | */ |
| 255 | public static final int TYPE_APPLICATION_STARTING = 3; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 256 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 257 | /** |
| 258 | * End of types of application windows. |
| 259 | */ |
| 260 | public static final int LAST_APPLICATION_WINDOW = 99; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 261 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 262 | /** |
| 263 | * Start of types of sub-windows. The {@link #token} of these windows |
| 264 | * must be set to the window they are attached to. These types of |
| 265 | * windows are kept next to their attached window in Z-order, and their |
| 266 | * coordinate space is relative to their attached window. |
| 267 | */ |
| 268 | public static final int FIRST_SUB_WINDOW = 1000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 269 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 270 | /** |
| 271 | * Window type: a panel on top of an application window. These windows |
| 272 | * appear on top of their attached window. |
| 273 | */ |
| 274 | public static final int TYPE_APPLICATION_PANEL = FIRST_SUB_WINDOW; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 275 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 276 | /** |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 277 | * Window type: window for showing media (such as video). These windows |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 278 | * are displayed behind their attached window. |
| 279 | */ |
| 280 | public static final int TYPE_APPLICATION_MEDIA = FIRST_SUB_WINDOW+1; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 281 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 282 | /** |
| 283 | * Window type: a sub-panel on top of an application window. These |
| 284 | * windows are displayed on top their attached window and any |
| 285 | * {@link #TYPE_APPLICATION_PANEL} panels. |
| 286 | */ |
| 287 | public static final int TYPE_APPLICATION_SUB_PANEL = FIRST_SUB_WINDOW+2; |
| 288 | |
| 289 | /** Window type: like {@link #TYPE_APPLICATION_PANEL}, but layout |
| 290 | * of the window happens as that of a top-level window, <em>not</em> |
| 291 | * as a child of its container. |
| 292 | */ |
| 293 | public static final int TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW+3; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 294 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 295 | /** |
Dianne Hackborn | c4d5d02 | 2009-05-21 17:32:42 -0700 | [diff] [blame] | 296 | * Window type: window for showing overlays on top of media windows. |
| 297 | * These windows are displayed between TYPE_APPLICATION_MEDIA and the |
| 298 | * application window. They should be translucent to be useful. This |
| 299 | * is a big ugly hack so: |
| 300 | * @hide |
| 301 | */ |
| 302 | public static final int TYPE_APPLICATION_MEDIA_OVERLAY = FIRST_SUB_WINDOW+4; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 303 | |
Dianne Hackborn | c4d5d02 | 2009-05-21 17:32:42 -0700 | [diff] [blame] | 304 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 305 | * End of types of sub-windows. |
| 306 | */ |
| 307 | public static final int LAST_SUB_WINDOW = 1999; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 308 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 309 | /** |
| 310 | * Start of system-specific window types. These are not normally |
| 311 | * created by applications. |
| 312 | */ |
| 313 | public static final int FIRST_SYSTEM_WINDOW = 2000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 314 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 315 | /** |
| 316 | * Window type: the status bar. There can be only one status bar |
| 317 | * window; it is placed at the top of the screen, and all other |
| 318 | * windows are shifted down so they are below it. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 319 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 320 | */ |
| 321 | public static final int TYPE_STATUS_BAR = FIRST_SYSTEM_WINDOW; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 322 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 323 | /** |
| 324 | * Window type: the search bar. There can be only one search bar |
| 325 | * window; it is placed at the top of the screen. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 326 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 327 | */ |
| 328 | public static final int TYPE_SEARCH_BAR = FIRST_SYSTEM_WINDOW+1; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 329 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 330 | /** |
| 331 | * Window type: phone. These are non-application windows providing |
| 332 | * user interaction with the phone (in particular incoming calls). |
| 333 | * These windows are normally placed above all applications, but behind |
| 334 | * the status bar. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 335 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 336 | */ |
| 337 | public static final int TYPE_PHONE = FIRST_SYSTEM_WINDOW+2; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 338 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 339 | /** |
| 340 | * Window type: system window, such as low power alert. These windows |
| 341 | * are always on top of application windows. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 342 | * In multiuser systems shows only on the owning user's window. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 343 | */ |
| 344 | public static final int TYPE_SYSTEM_ALERT = FIRST_SYSTEM_WINDOW+3; |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 345 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 346 | /** |
| 347 | * Window type: keyguard window. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 348 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 349 | */ |
| 350 | public static final int TYPE_KEYGUARD = FIRST_SYSTEM_WINDOW+4; |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 351 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 352 | /** |
| 353 | * Window type: transient notifications. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 354 | * In multiuser systems shows only on the owning user's window. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 355 | */ |
| 356 | public static final int TYPE_TOAST = FIRST_SYSTEM_WINDOW+5; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 357 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 358 | /** |
| 359 | * Window type: system overlay windows, which need to be displayed |
| 360 | * on top of everything else. These windows must not take input |
| 361 | * focus, or they will interfere with the keyguard. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 362 | * In multiuser systems shows only on the owning user's window. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 363 | */ |
| 364 | public static final int TYPE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+6; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 365 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 366 | /** |
| 367 | * Window type: priority phone UI, which needs to be displayed even if |
| 368 | * the keyguard is active. These windows must not take input |
| 369 | * focus, or they will interfere with the keyguard. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 370 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 371 | */ |
| 372 | public static final int TYPE_PRIORITY_PHONE = FIRST_SYSTEM_WINDOW+7; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 373 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 374 | /** |
| 375 | * Window type: panel that slides out from the status bar |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 376 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 377 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 378 | public static final int TYPE_SYSTEM_DIALOG = FIRST_SYSTEM_WINDOW+8; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 379 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 380 | /** |
| 381 | * Window type: dialogs that the keyguard shows |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 382 | * In multiuser systems shows on all users' windows. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 383 | */ |
| 384 | public static final int TYPE_KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW+9; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 385 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 386 | /** |
| 387 | * Window type: internal system error windows, appear on top of |
| 388 | * everything they can. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 389 | * In multiuser systems shows only on the owning user's window. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 390 | */ |
| 391 | public static final int TYPE_SYSTEM_ERROR = FIRST_SYSTEM_WINDOW+10; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 392 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 393 | /** |
| 394 | * Window type: internal input methods windows, which appear above |
| 395 | * the normal UI. Application windows may be resized or panned to keep |
| 396 | * the input focus visible while this window is displayed. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 397 | * In multiuser systems shows only on the owning user's window. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 398 | */ |
| 399 | public static final int TYPE_INPUT_METHOD = FIRST_SYSTEM_WINDOW+11; |
| 400 | |
| 401 | /** |
| 402 | * Window type: internal input methods dialog windows, which appear above |
| 403 | * the current input method window. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 404 | * In multiuser systems shows only on the owning user's window. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 405 | */ |
| 406 | public static final int TYPE_INPUT_METHOD_DIALOG= FIRST_SYSTEM_WINDOW+12; |
| 407 | |
| 408 | /** |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 409 | * Window type: wallpaper window, placed behind any window that wants |
| 410 | * to sit on top of the wallpaper. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 411 | * In multiuser systems shows only on the owning user's window. |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 412 | */ |
| 413 | public static final int TYPE_WALLPAPER = FIRST_SYSTEM_WINDOW+13; |
| 414 | |
| 415 | /** |
Joe Onorato | 29fc2c9 | 2010-11-24 10:26:50 -0800 | [diff] [blame] | 416 | * Window type: panel that slides out from over the status bar |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 417 | * In multiuser systems shows on all users' windows. |
Dianne Hackborn | badc47e | 2009-11-08 17:37:07 -0800 | [diff] [blame] | 418 | */ |
| 419 | public static final int TYPE_STATUS_BAR_PANEL = FIRST_SYSTEM_WINDOW+14; |
Jeff Brown | 3b2b354 | 2010-10-15 00:54:27 -0700 | [diff] [blame] | 420 | |
| 421 | /** |
| 422 | * Window type: secure system overlay windows, which need to be displayed |
| 423 | * on top of everything else. These windows must not take input |
| 424 | * focus, or they will interfere with the keyguard. |
| 425 | * |
| 426 | * This is exactly like {@link #TYPE_SYSTEM_OVERLAY} except that only the |
| 427 | * system itself is allowed to create these overlays. Applications cannot |
| 428 | * obtain permission to create secure system overlays. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 429 | * |
| 430 | * In multiuser systems shows only on the owning user's window. |
Jeff Brown | 3b2b354 | 2010-10-15 00:54:27 -0700 | [diff] [blame] | 431 | * @hide |
| 432 | */ |
| 433 | public static final int TYPE_SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+15; |
| 434 | |
Dianne Hackborn | badc47e | 2009-11-08 17:37:07 -0800 | [diff] [blame] | 435 | /** |
Christopher Tate | a53146c | 2010-09-07 11:57:52 -0700 | [diff] [blame] | 436 | * Window type: the drag-and-drop pseudowindow. There is only one |
| 437 | * drag layer (at most), and it is placed on top of all other windows. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 438 | * In multiuser systems shows only on the owning user's window. |
Christopher Tate | a53146c | 2010-09-07 11:57:52 -0700 | [diff] [blame] | 439 | * @hide |
| 440 | */ |
Jeff Brown | 3b2b354 | 2010-10-15 00:54:27 -0700 | [diff] [blame] | 441 | public static final int TYPE_DRAG = FIRST_SYSTEM_WINDOW+16; |
Christopher Tate | a53146c | 2010-09-07 11:57:52 -0700 | [diff] [blame] | 442 | |
| 443 | /** |
Joe Onorato | 29fc2c9 | 2010-11-24 10:26:50 -0800 | [diff] [blame] | 444 | * Window type: panel that slides out from under the status bar |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 445 | * In multiuser systems shows on all users' windows. |
Joe Onorato | a89e903 | 2010-11-24 11:13:44 -0800 | [diff] [blame] | 446 | * @hide |
Joe Onorato | 29fc2c9 | 2010-11-24 10:26:50 -0800 | [diff] [blame] | 447 | */ |
| 448 | public static final int TYPE_STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW+17; |
| 449 | |
Jeff Brown | 83c0968 | 2010-12-23 17:50:18 -0800 | [diff] [blame] | 450 | /** |
| 451 | * Window type: (mouse) pointer |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 452 | * In multiuser systems shows on all users' windows. |
Jeff Brown | 83c0968 | 2010-12-23 17:50:18 -0800 | [diff] [blame] | 453 | * @hide |
| 454 | */ |
| 455 | public static final int TYPE_POINTER = FIRST_SYSTEM_WINDOW+18; |
Joe Onorato | 29fc2c9 | 2010-11-24 10:26:50 -0800 | [diff] [blame] | 456 | |
| 457 | /** |
Daniel Sandler | 8956dbb | 2011-04-22 07:55:02 -0400 | [diff] [blame] | 458 | * Window type: Navigation bar (when distinct from status bar) |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 459 | * In multiuser systems shows on all users' windows. |
Daniel Sandler | 8956dbb | 2011-04-22 07:55:02 -0400 | [diff] [blame] | 460 | * @hide |
| 461 | */ |
| 462 | public static final int TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19; |
| 463 | |
| 464 | /** |
Dianne Hackborn | e8ecde1 | 2011-08-03 18:55:19 -0700 | [diff] [blame] | 465 | * Window type: The volume level overlay/dialog shown when the user |
| 466 | * changes the system volume. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 467 | * In multiuser systems shows on all users' windows. |
Dianne Hackborn | e8ecde1 | 2011-08-03 18:55:19 -0700 | [diff] [blame] | 468 | * @hide |
| 469 | */ |
| 470 | public static final int TYPE_VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW+20; |
| 471 | |
| 472 | /** |
Dianne Hackborn | 29aae6f | 2011-08-18 18:30:09 -0700 | [diff] [blame] | 473 | * Window type: The boot progress dialog, goes on top of everything |
| 474 | * in the world. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 475 | * In multiuser systems shows on all users' windows. |
Dianne Hackborn | 29aae6f | 2011-08-18 18:30:09 -0700 | [diff] [blame] | 476 | * @hide |
| 477 | */ |
| 478 | public static final int TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21; |
| 479 | |
| 480 | /** |
Dianne Hackborn | df89e65 | 2011-10-06 22:35:11 -0700 | [diff] [blame] | 481 | * Window type: Fake window to consume touch events when the navigation |
| 482 | * bar is hidden. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 483 | * In multiuser systems shows on all users' windows. |
Dianne Hackborn | df89e65 | 2011-10-06 22:35:11 -0700 | [diff] [blame] | 484 | * @hide |
| 485 | */ |
| 486 | public static final int TYPE_HIDDEN_NAV_CONSUMER = FIRST_SYSTEM_WINDOW+22; |
| 487 | |
| 488 | /** |
Daniel Sandler | 7d276c3 | 2012-01-30 14:33:52 -0500 | [diff] [blame] | 489 | * Window type: Dreams (screen saver) window, just above keyguard. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 490 | * In multiuser systems shows only on the owning user's window. |
Daniel Sandler | 7d276c3 | 2012-01-30 14:33:52 -0500 | [diff] [blame] | 491 | * @hide |
| 492 | */ |
| 493 | public static final int TYPE_DREAM = FIRST_SYSTEM_WINDOW+23; |
| 494 | |
| 495 | /** |
Jim Miller | e898ac5 | 2012-04-06 17:10:57 -0700 | [diff] [blame] | 496 | * Window type: Navigation bar panel (when navigation bar is distinct from status bar) |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 497 | * In multiuser systems shows on all users' windows. |
Jim Miller | e898ac5 | 2012-04-06 17:10:57 -0700 | [diff] [blame] | 498 | * @hide |
| 499 | */ |
| 500 | public static final int TYPE_NAVIGATION_BAR_PANEL = FIRST_SYSTEM_WINDOW+24; |
| 501 | |
| 502 | /** |
Dianne Hackborn | a4b7f2f | 2012-05-21 11:28:41 -0700 | [diff] [blame] | 503 | * Window type: Behind the universe of the real windows. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 504 | * In multiuser systems shows on all users' windows. |
Dianne Hackborn | a4b7f2f | 2012-05-21 11:28:41 -0700 | [diff] [blame] | 505 | * @hide |
| 506 | */ |
| 507 | public static final int TYPE_UNIVERSE_BACKGROUND = FIRST_SYSTEM_WINDOW+25; |
| 508 | |
| 509 | /** |
Jeff Brown | bd6e150 | 2012-08-28 03:27:37 -0700 | [diff] [blame] | 510 | * Window type: Display overlay window. Used to simulate secondary display devices. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 511 | * In multiuser systems shows on all users' windows. |
Jeff Brown | bd6e150 | 2012-08-28 03:27:37 -0700 | [diff] [blame] | 512 | * @hide |
| 513 | */ |
| 514 | public static final int TYPE_DISPLAY_OVERLAY = FIRST_SYSTEM_WINDOW+26; |
| 515 | |
| 516 | /** |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 517 | * Window type: Magnification overlay window. Used to highlight the magnified |
| 518 | * portion of a display when accessibility magnification is enabled. |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 519 | * In multiuser systems shows on all users' windows. |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 520 | * @hide |
| 521 | */ |
| 522 | public static final int TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW+27; |
| 523 | |
| 524 | /** |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 525 | * Window type: Recents. Same layer as {@link #TYPE_SYSTEM_DIALOG} but only appears on |
| 526 | * one user's screen. |
| 527 | * In multiuser systems shows on all users' windows. |
| 528 | * @hide |
| 529 | */ |
| 530 | public static final int TYPE_RECENTS_OVERLAY = FIRST_SYSTEM_WINDOW+28; |
| 531 | |
Jim Miller | 5ecd811 | 2013-01-09 18:50:26 -0800 | [diff] [blame] | 532 | |
| 533 | /** |
| 534 | * Window type: keyguard scrim window. Shows if keyguard needs to be restarted. |
| 535 | * In multiuser systems shows on all users' windows. |
| 536 | * @hide |
| 537 | */ |
| 538 | public static final int TYPE_KEYGUARD_SCRIM = FIRST_SYSTEM_WINDOW+29; |
| 539 | |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 540 | /** |
keunyoung | a446bf0 | 2013-06-21 19:07:57 -0700 | [diff] [blame] | 541 | * Window type: Window for Presentation on top of private |
| 542 | * virtual display. |
| 543 | */ |
| 544 | public static final int TYPE_PRIVATE_PRESENTATION = FIRST_SYSTEM_WINDOW+30; |
| 545 | |
| 546 | /** |
Dianne Hackborn | e30e02f | 2014-05-27 18:24:45 -0700 | [diff] [blame] | 547 | * Window type: Windows in the voice interaction layer. |
| 548 | * @hide |
| 549 | */ |
| 550 | public static final int TYPE_VOICE_INTERACTION = FIRST_SYSTEM_WINDOW+31; |
| 551 | |
| 552 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 553 | * End of types of system windows. |
| 554 | */ |
| 555 | public static final int LAST_SYSTEM_WINDOW = 2999; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 556 | |
Mathias Agopian | d211230 | 2010-12-07 19:38:17 -0800 | [diff] [blame] | 557 | /** @deprecated this is ignored, this value is set automatically when needed. */ |
| 558 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 559 | public static final int MEMORY_TYPE_NORMAL = 0; |
Mathias Agopian | d211230 | 2010-12-07 19:38:17 -0800 | [diff] [blame] | 560 | /** @deprecated this is ignored, this value is set automatically when needed. */ |
Mathias Agopian | 317a628 | 2009-08-13 17:29:02 -0700 | [diff] [blame] | 561 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 562 | public static final int MEMORY_TYPE_HARDWARE = 1; |
Mathias Agopian | d211230 | 2010-12-07 19:38:17 -0800 | [diff] [blame] | 563 | /** @deprecated this is ignored, this value is set automatically when needed. */ |
Mathias Agopian | 317a628 | 2009-08-13 17:29:02 -0700 | [diff] [blame] | 564 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 565 | public static final int MEMORY_TYPE_GPU = 2; |
Mathias Agopian | d211230 | 2010-12-07 19:38:17 -0800 | [diff] [blame] | 566 | /** @deprecated this is ignored, this value is set automatically when needed. */ |
| 567 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 568 | public static final int MEMORY_TYPE_PUSH_BUFFERS = 3; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 569 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 570 | /** |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 571 | * @deprecated this is ignored |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 572 | */ |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 573 | @Deprecated |
| 574 | public int memoryType; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 575 | |
Mike Lockwood | ef73162 | 2010-01-27 17:51:34 -0500 | [diff] [blame] | 576 | /** Window flag: as long as this window is visible to the user, allow |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 577 | * the lock screen to activate while the screen is on. |
| 578 | * This can be used independently, or in combination with |
Christopher Tate | 95f7850 | 2010-01-29 15:57:34 -0800 | [diff] [blame] | 579 | * {@link #FLAG_KEEP_SCREEN_ON} and/or {@link #FLAG_SHOW_WHEN_LOCKED} */ |
Mike Lockwood | ef73162 | 2010-01-27 17:51:34 -0500 | [diff] [blame] | 580 | public static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001; |
| 581 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 582 | /** Window flag: everything behind this window will be dimmed. |
| 583 | * Use {@link #dimAmount} to control the amount of dim. */ |
| 584 | public static final int FLAG_DIM_BEHIND = 0x00000002; |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 585 | |
| 586 | /** Window flag: blur everything behind this window. |
| 587 | * @deprecated Blurring is no longer supported. */ |
| 588 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 589 | public static final int FLAG_BLUR_BEHIND = 0x00000004; |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 590 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 591 | /** Window flag: this window won't ever get key input focus, so the |
| 592 | * user can not send key or other button events to it. Those will |
| 593 | * instead go to whatever focusable window is behind it. This flag |
| 594 | * will also enable {@link #FLAG_NOT_TOUCH_MODAL} whether or not that |
| 595 | * is explicitly set. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 596 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 597 | * <p>Setting this flag also implies that the window will not need to |
| 598 | * interact with |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 599 | * a soft input method, so it will be Z-ordered and positioned |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 600 | * independently of any active input method (typically this means it |
| 601 | * gets Z-ordered on top of the input method, so it can use the full |
| 602 | * screen for its content and cover the input method if needed. You |
| 603 | * can use {@link #FLAG_ALT_FOCUSABLE_IM} to modify this behavior. */ |
| 604 | public static final int FLAG_NOT_FOCUSABLE = 0x00000008; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 605 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 606 | /** Window flag: this window can never receive touch events. */ |
| 607 | public static final int FLAG_NOT_TOUCHABLE = 0x00000010; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 608 | |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 609 | /** Window flag: even when this window is focusable (its |
| 610 | * {@link #FLAG_NOT_FOCUSABLE} is not set), allow any pointer events |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 611 | * outside of the window to be sent to the windows behind it. Otherwise |
| 612 | * it will consume all pointer events itself, regardless of whether they |
| 613 | * are inside of the window. */ |
| 614 | public static final int FLAG_NOT_TOUCH_MODAL = 0x00000020; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 615 | |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 616 | /** Window flag: when set, if the device is asleep when the touch |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 617 | * screen is pressed, you will receive this first touch event. Usually |
| 618 | * the first touch event is consumed by the system since the user can |
| 619 | * not see what they are pressing on. |
Jeff Brown | 037c33e | 2014-04-09 00:31:55 -0700 | [diff] [blame] | 620 | * |
| 621 | * @deprecated This flag has no effect. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 622 | */ |
Jeff Brown | 037c33e | 2014-04-09 00:31:55 -0700 | [diff] [blame] | 623 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 624 | public static final int FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 625 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 626 | /** Window flag: as long as this window is visible to the user, keep |
| 627 | * the device's screen turned on and bright. */ |
| 628 | public static final int FLAG_KEEP_SCREEN_ON = 0x00000080; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 629 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 630 | /** Window flag: place the window within the entire screen, ignoring |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 631 | * decorations around the border (such as the status bar). The |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 632 | * window must correctly position its contents to take the screen |
| 633 | * decoration into account. This flag is normally set for you |
| 634 | * by Window as described in {@link Window#setFlags}. */ |
| 635 | public static final int FLAG_LAYOUT_IN_SCREEN = 0x00000100; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 636 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 637 | /** Window flag: allow window to extend outside of the screen. */ |
| 638 | public static final int FLAG_LAYOUT_NO_LIMITS = 0x00000200; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 639 | |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 640 | /** |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 641 | * Window flag: hide all screen decorations (such as the status bar) while |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 642 | * this window is displayed. This allows the window to use the entire |
| 643 | * display space for itself -- the status bar will be hidden when |
Chet Haase | 45c89c2 | 2013-04-29 16:04:40 -0700 | [diff] [blame] | 644 | * an app window with this flag set is on the top layer. A fullscreen window |
| 645 | * will ignore a value of {@link #SOFT_INPUT_ADJUST_RESIZE} for the window's |
| 646 | * {@link #softInputMode} field; the window will stay fullscreen |
| 647 | * and will not resize. |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 648 | * |
| 649 | * <p>This flag can be controlled in your theme through the |
| 650 | * {@link android.R.attr#windowFullscreen} attribute; this attribute |
| 651 | * is automatically set for you in the standard fullscreen themes |
| 652 | * such as {@link android.R.style#Theme_NoTitleBar_Fullscreen}, |
| 653 | * {@link android.R.style#Theme_Black_NoTitleBar_Fullscreen}, |
| 654 | * {@link android.R.style#Theme_Light_NoTitleBar_Fullscreen}, |
| 655 | * {@link android.R.style#Theme_Holo_NoActionBar_Fullscreen}, |
| 656 | * {@link android.R.style#Theme_Holo_Light_NoActionBar_Fullscreen}, |
| 657 | * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Fullscreen}, and |
| 658 | * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Fullscreen}.</p> |
| 659 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 660 | public static final int FLAG_FULLSCREEN = 0x00000400; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 661 | |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 662 | /** Window flag: override {@link #FLAG_FULLSCREEN} and force the |
| 663 | * screen decorations (such as the status bar) to be shown. */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 664 | public static final int FLAG_FORCE_NOT_FULLSCREEN = 0x00000800; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 665 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 666 | /** Window flag: turn on dithering when compositing this window to |
Jeff Brown | 3cc321e | 2012-07-16 16:04:23 -0700 | [diff] [blame] | 667 | * the screen. |
| 668 | * @deprecated This flag is no longer used. */ |
| 669 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 670 | public static final int FLAG_DITHER = 0x00001000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 671 | |
John Spurlock | 33291d8 | 2013-03-13 14:45:14 -0400 | [diff] [blame] | 672 | /** Window flag: treat the content of the window as secure, preventing |
Jeff Brown | f0681b3 | 2012-10-23 17:35:57 -0700 | [diff] [blame] | 673 | * it from appearing in screenshots or from being viewed on non-secure |
| 674 | * displays. |
| 675 | * |
| 676 | * <p>See {@link android.view.Display#FLAG_SECURE} for more details about |
| 677 | * secure surfaces and secure displays. |
| 678 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 679 | public static final int FLAG_SECURE = 0x00002000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 680 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 681 | /** Window flag: a special mode where the layout parameters are used |
| 682 | * to perform scaling of the surface when it is composited to the |
| 683 | * screen. */ |
| 684 | public static final int FLAG_SCALED = 0x00004000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 685 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 686 | /** Window flag: intended for windows that will often be used when the user is |
| 687 | * holding the screen against their face, it will aggressively filter the event |
| 688 | * stream to prevent unintended presses in this situation that may not be |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 689 | * desired for a particular window, when such an event stream is detected, the |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 690 | * application will receive a CANCEL motion event to indicate this so applications |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 691 | * can handle this accordingly by taking no action on the event |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 692 | * until the finger is released. */ |
| 693 | public static final int FLAG_IGNORE_CHEEK_PRESSES = 0x00008000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 694 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 695 | /** Window flag: a special option only for use in combination with |
| 696 | * {@link #FLAG_LAYOUT_IN_SCREEN}. When requesting layout in the |
| 697 | * screen your window may appear on top of or behind screen decorations |
| 698 | * such as the status bar. By also including this flag, the window |
| 699 | * manager will report the inset rectangle needed to ensure your |
| 700 | * content is not covered by screen decorations. This flag is normally |
| 701 | * set for you by Window as described in {@link Window#setFlags}.*/ |
| 702 | public static final int FLAG_LAYOUT_INSET_DECOR = 0x00010000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 703 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 704 | /** Window flag: invert the state of {@link #FLAG_NOT_FOCUSABLE} with |
| 705 | * respect to how this window interacts with the current method. That |
| 706 | * is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the |
| 707 | * window will behave as if it needs to interact with the input method |
| 708 | * and thus be placed behind/away from it; if FLAG_NOT_FOCUSABLE is |
| 709 | * not set and this flag is set, then the window will behave as if it |
| 710 | * doesn't need to interact with the input method and can be placed |
| 711 | * to use more space and cover the input method. |
| 712 | */ |
| 713 | public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 714 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 715 | /** Window flag: if you have set {@link #FLAG_NOT_TOUCH_MODAL}, you |
| 716 | * can set this flag to receive a single special MotionEvent with |
| 717 | * the action |
| 718 | * {@link MotionEvent#ACTION_OUTSIDE MotionEvent.ACTION_OUTSIDE} for |
| 719 | * touches that occur outside of your window. Note that you will not |
| 720 | * receive the full down/move/up gesture, only the location of the |
| 721 | * first down as an ACTION_OUTSIDE. |
| 722 | */ |
| 723 | public static final int FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 724 | |
Suchi Amalapurapu | d1a9337 | 2009-05-14 17:54:31 -0700 | [diff] [blame] | 725 | /** Window flag: special flag to let windows be shown when the screen |
| 726 | * is locked. This will let application windows take precedence over |
| 727 | * key guard or any other lock screens. Can be used with |
| 728 | * {@link #FLAG_KEEP_SCREEN_ON} to turn screen on and display windows |
Dianne Hackborn | 9bfb707 | 2009-09-22 11:37:40 -0700 | [diff] [blame] | 729 | * directly before showing the key guard window. Can be used with |
| 730 | * {@link #FLAG_DISMISS_KEYGUARD} to automatically fully dismisss |
| 731 | * non-secure keyguards. This flag only applies to the top-most |
| 732 | * full-screen window. |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 733 | */ |
Suchi Amalapurapu | d1a9337 | 2009-05-14 17:54:31 -0700 | [diff] [blame] | 734 | public static final int FLAG_SHOW_WHEN_LOCKED = 0x00080000; |
| 735 | |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 736 | /** Window flag: ask that the system wallpaper be shown behind |
| 737 | * your window. The window surface must be translucent to be able |
| 738 | * to actually see the wallpaper behind it; this flag just ensures |
| 739 | * that the wallpaper surface will be there if this window actually |
| 740 | * has translucent regions. |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 741 | * |
| 742 | * <p>This flag can be controlled in your theme through the |
| 743 | * {@link android.R.attr#windowShowWallpaper} attribute; this attribute |
| 744 | * is automatically set for you in the standard wallpaper themes |
| 745 | * such as {@link android.R.style#Theme_Wallpaper}, |
| 746 | * {@link android.R.style#Theme_Wallpaper_NoTitleBar}, |
| 747 | * {@link android.R.style#Theme_Wallpaper_NoTitleBar_Fullscreen}, |
| 748 | * {@link android.R.style#Theme_Holo_Wallpaper}, |
| 749 | * {@link android.R.style#Theme_Holo_Wallpaper_NoTitleBar}, |
| 750 | * {@link android.R.style#Theme_DeviceDefault_Wallpaper}, and |
| 751 | * {@link android.R.style#Theme_DeviceDefault_Wallpaper_NoTitleBar}.</p> |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 752 | */ |
| 753 | public static final int FLAG_SHOW_WALLPAPER = 0x00100000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 754 | |
Dianne Hackborn | 93e462b | 2009-09-15 22:50:40 -0700 | [diff] [blame] | 755 | /** Window flag: when set as a window is being added or made |
| 756 | * visible, once the window has been shown then the system will |
| 757 | * poke the power manager's user activity (as if the user had woken |
| 758 | * up the device) to turn the screen on. */ |
| 759 | public static final int FLAG_TURN_SCREEN_ON = 0x00200000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 760 | |
Dianne Hackborn | 9bfb707 | 2009-09-22 11:37:40 -0700 | [diff] [blame] | 761 | /** Window flag: when set the window will cause the keyguard to |
| 762 | * be dismissed, only if it is not a secure lock keyguard. Because such |
| 763 | * a keyguard is not needed for security, it will never re-appear if |
| 764 | * the user navigates to another window (in contrast to |
| 765 | * {@link #FLAG_SHOW_WHEN_LOCKED}, which will only temporarily |
| 766 | * hide both secure and non-secure keyguards but ensure they reappear |
| 767 | * when the user moves to another UI that doesn't hide them). |
| 768 | * If the keyguard is currently active and is secure (requires an |
| 769 | * unlock pattern) than the user will still need to confirm it before |
| 770 | * seeing this window, unless {@link #FLAG_SHOW_WHEN_LOCKED} has |
Daniel Sandler | ae069f7 | 2010-06-17 21:56:26 -0400 | [diff] [blame] | 771 | * also been set. |
| 772 | */ |
Dianne Hackborn | 9bfb707 | 2009-09-22 11:37:40 -0700 | [diff] [blame] | 773 | public static final int FLAG_DISMISS_KEYGUARD = 0x00400000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 774 | |
Jeff Brown | 01ce2e9 | 2010-09-26 22:20:12 -0700 | [diff] [blame] | 775 | /** Window flag: when set the window will accept for touch events |
| 776 | * outside of its bounds to be sent to other windows that also |
| 777 | * support split touch. When this flag is not set, the first pointer |
| 778 | * that goes down determines the window to which all subsequent touches |
| 779 | * go until all pointers go up. When this flag is set, each pointer |
| 780 | * (not necessarily the first) that goes down determines the window |
| 781 | * to which all subsequent touches of that pointer will go until that |
| 782 | * pointer goes up thereby enabling touches with multiple pointers |
| 783 | * to be split across multiple windows. |
Dianne Hackborn | d9b3b7e | 2010-11-16 18:22:49 -0800 | [diff] [blame] | 784 | */ |
Jeff Brown | 01ce2e9 | 2010-09-26 22:20:12 -0700 | [diff] [blame] | 785 | public static final int FLAG_SPLIT_TOUCH = 0x00800000; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 786 | |
Dianne Hackborn | d9b3b7e | 2010-11-16 18:22:49 -0800 | [diff] [blame] | 787 | /** |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 788 | * <p>Indicates whether this window should be hardware accelerated. |
| 789 | * Requesting hardware acceleration does not guarantee it will happen.</p> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 790 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 791 | * <p>This flag can be controlled programmatically <em>only</em> to enable |
| 792 | * hardware acceleration. To enable hardware acceleration for a given |
| 793 | * window programmatically, do the following:</p> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 794 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 795 | * <pre> |
| 796 | * Window w = activity.getWindow(); // in Activity's onCreate() for instance |
| 797 | * w.setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, |
| 798 | * WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); |
| 799 | * </pre> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 800 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 801 | * <p>It is important to remember that this flag <strong>must</strong> |
| 802 | * be set before setting the content view of your activity or dialog.</p> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 803 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 804 | * <p>This flag cannot be used to disable hardware acceleration after it |
| 805 | * was enabled in your manifest using |
| 806 | * {@link android.R.attr#hardwareAccelerated}. If you need to selectively |
| 807 | * and programmatically disable hardware acceleration (for automated testing |
| 808 | * for instance), make sure it is turned off in your manifest and enable it |
| 809 | * on your activity or dialog when you need it instead, using the method |
| 810 | * described above.</p> |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 811 | * |
Romain Guy | 72f0a27 | 2011-01-09 16:01:46 -0800 | [diff] [blame] | 812 | * <p>This flag is automatically set by the system if the |
| 813 | * {@link android.R.attr#hardwareAccelerated android:hardwareAccelerated} |
| 814 | * XML attribute is set to true on an activity or on the application.</p> |
Dianne Hackborn | d9b3b7e | 2010-11-16 18:22:49 -0800 | [diff] [blame] | 815 | */ |
| 816 | public static final int FLAG_HARDWARE_ACCELERATED = 0x01000000; |
Daniel Sandler | 611fae4 | 2010-06-17 10:45:00 -0400 | [diff] [blame] | 817 | |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 818 | /** |
| 819 | * Window flag: allow window contents to extend in to the screen's |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 820 | * overscan area, if there is one. The window should still correctly |
| 821 | * position its contents to take the overscan area into account. |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 822 | * |
| 823 | * <p>This flag can be controlled in your theme through the |
| 824 | * {@link android.R.attr#windowOverscan} attribute; this attribute |
| 825 | * is automatically set for you in the standard overscan themes |
Ying Wang | 4e0eb22 | 2013-04-18 20:39:48 -0700 | [diff] [blame] | 826 | * such as |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 827 | * {@link android.R.style#Theme_Holo_NoActionBar_Overscan}, |
| 828 | * {@link android.R.style#Theme_Holo_Light_NoActionBar_Overscan}, |
| 829 | * {@link android.R.style#Theme_DeviceDefault_NoActionBar_Overscan}, and |
| 830 | * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_Overscan}.</p> |
| 831 | * |
| 832 | * <p>When this flag is enabled for a window, its normal content may be obscured |
| 833 | * to some degree by the overscan region of the display. To ensure key parts of |
| 834 | * that content are visible to the user, you can use |
| 835 | * {@link View#setFitsSystemWindows(boolean) View.setFitsSystemWindows(boolean)} |
| 836 | * to set the point in the view hierarchy where the appropriate offsets should |
| 837 | * be applied. (This can be done either by directly calling this function, using |
| 838 | * the {@link android.R.attr#fitsSystemWindows} attribute in your view hierarchy, |
| 839 | * or implementing you own {@link View#fitSystemWindows(android.graphics.Rect) |
| 840 | * View.fitSystemWindows(Rect)} method).</p> |
| 841 | * |
| 842 | * <p>This mechanism for positioning content elements is identical to its equivalent |
| 843 | * use with layout and {@link View#setSystemUiVisibility(int) |
| 844 | * View.setSystemUiVisibility(int)}; here is an example layout that will correctly |
| 845 | * position its UI elements with this overscan flag is set:</p> |
| 846 | * |
| 847 | * {@sample development/samples/ApiDemos/res/layout/overscan_activity.xml complete} |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 848 | */ |
| 849 | public static final int FLAG_LAYOUT_IN_OVERSCAN = 0x02000000; |
| 850 | |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 851 | /** |
| 852 | * Window flag: request a translucent status bar with minimal system-provided |
| 853 | * background protection. |
| 854 | * |
| 855 | * <p>This flag can be controlled in your theme through the |
| 856 | * {@link android.R.attr#windowTranslucentStatus} attribute; this attribute |
| 857 | * is automatically set for you in the standard translucent decor themes |
| 858 | * such as |
| 859 | * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor}, |
| 860 | * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor}, |
| 861 | * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and |
| 862 | * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p> |
| 863 | * |
| 864 | * <p>When this flag is enabled for a window, it automatically sets |
| 865 | * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and |
| 866 | * {@link View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}.</p> |
| 867 | */ |
| 868 | public static final int FLAG_TRANSLUCENT_STATUS = 0x04000000; |
| 869 | |
| 870 | /** |
| 871 | * Window flag: request a translucent navigation bar with minimal system-provided |
| 872 | * background protection. |
| 873 | * |
| 874 | * <p>This flag can be controlled in your theme through the |
| 875 | * {@link android.R.attr#windowTranslucentNavigation} attribute; this attribute |
| 876 | * is automatically set for you in the standard translucent decor themes |
| 877 | * such as |
| 878 | * {@link android.R.style#Theme_Holo_NoActionBar_TranslucentDecor}, |
| 879 | * {@link android.R.style#Theme_Holo_Light_NoActionBar_TranslucentDecor}, |
| 880 | * {@link android.R.style#Theme_DeviceDefault_NoActionBar_TranslucentDecor}, and |
| 881 | * {@link android.R.style#Theme_DeviceDefault_Light_NoActionBar_TranslucentDecor}.</p> |
| 882 | * |
| 883 | * <p>When this flag is enabled for a window, it automatically sets |
| 884 | * the system UI visibility flags {@link View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and |
| 885 | * {@link View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION}.</p> |
| 886 | */ |
| 887 | public static final int FLAG_TRANSLUCENT_NAVIGATION = 0x08000000; |
| 888 | |
Dianne Hackborn | d9b3b7e | 2010-11-16 18:22:49 -0800 | [diff] [blame] | 889 | // ----- HIDDEN FLAGS. |
| 890 | // These start at the high bit and go down. |
Jeff Brown | 98db5fa | 2011-06-08 15:37:10 -0700 | [diff] [blame] | 891 | |
Adam Lesinski | 6a591f5 | 2013-10-01 18:11:17 -0700 | [diff] [blame] | 892 | /** |
| 893 | * Flag for a window in local focus mode. |
| 894 | * Window in local focus mode can control focus independent of window manager using |
| 895 | * {@link Window#setLocalFocus(boolean, boolean)}. |
| 896 | * Usually window in this mode will not get touch/key events from window manager, but will |
| 897 | * get events only via local injection using {@link Window#injectInputEvent(InputEvent)}. |
| 898 | */ |
| 899 | public static final int FLAG_LOCAL_FOCUS_MODE = 0x10000000; |
| 900 | |
Jeff Brown | 98db5fa | 2011-06-08 15:37:10 -0700 | [diff] [blame] | 901 | /** Window flag: Enable touches to slide out of a window into neighboring |
| 902 | * windows in mid-gesture instead of being captured for the duration of |
| 903 | * the gesture. |
| 904 | * |
| 905 | * This flag changes the behavior of touch focus for this window only. |
| 906 | * Touches can slide out of the window but they cannot necessarily slide |
| 907 | * back in (unless the other window with touch focus permits it). |
| 908 | * |
| 909 | * {@hide} |
| 910 | */ |
Adam Lesinski | 6a591f5 | 2013-10-01 18:11:17 -0700 | [diff] [blame] | 911 | public static final int FLAG_SLIPPERY = 0x20000000; |
Jeff Brown | 98db5fa | 2011-06-08 15:37:10 -0700 | [diff] [blame] | 912 | |
Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 913 | /** |
| 914 | * Flag for a window belonging to an activity that responds to {@link KeyEvent#KEYCODE_MENU} |
| 915 | * and therefore needs a Menu key. For devices where Menu is a physical button this flag is |
| 916 | * ignored, but on devices where the Menu key is drawn in software it may be hidden unless |
| 917 | * this flag is set. |
| 918 | * |
| 919 | * (Note that Action Bars, when available, are the preferred way to offer additional |
| 920 | * functions otherwise accessed via an options menu.) |
| 921 | * |
| 922 | * {@hide} |
| 923 | */ |
Adam Lesinski | 6a591f5 | 2013-10-01 18:11:17 -0700 | [diff] [blame] | 924 | public static final int FLAG_NEEDS_MENU_KEY = 0x40000000; |
Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 925 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 926 | /** |
Adrian Roos | 217ccd2 | 2014-05-09 14:29:04 +0200 | [diff] [blame] | 927 | * Flag indicating that this Window is responsible for drawing the background for the |
| 928 | * system bars. If set, the system bars are drawn with a transparent background and the |
| 929 | * corresponding areas in this window are filled with the colors specified in |
| 930 | * {@link Window#getStatusBarColor()} and {@link Window#getNavigationBarColor()}. |
| 931 | */ |
| 932 | public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = 0x80000000; |
| 933 | |
| 934 | /** |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 935 | * Various behavioral options/flags. Default is none. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 936 | * |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 937 | * @see #FLAG_ALLOW_LOCK_WHILE_SCREEN_ON |
| 938 | * @see #FLAG_DIM_BEHIND |
| 939 | * @see #FLAG_NOT_FOCUSABLE |
| 940 | * @see #FLAG_NOT_TOUCHABLE |
| 941 | * @see #FLAG_NOT_TOUCH_MODAL |
| 942 | * @see #FLAG_TOUCHABLE_WHEN_WAKING |
| 943 | * @see #FLAG_KEEP_SCREEN_ON |
| 944 | * @see #FLAG_LAYOUT_IN_SCREEN |
| 945 | * @see #FLAG_LAYOUT_NO_LIMITS |
| 946 | * @see #FLAG_FULLSCREEN |
| 947 | * @see #FLAG_FORCE_NOT_FULLSCREEN |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 948 | * @see #FLAG_SECURE |
| 949 | * @see #FLAG_SCALED |
| 950 | * @see #FLAG_IGNORE_CHEEK_PRESSES |
| 951 | * @see #FLAG_LAYOUT_INSET_DECOR |
| 952 | * @see #FLAG_ALT_FOCUSABLE_IM |
| 953 | * @see #FLAG_WATCH_OUTSIDE_TOUCH |
| 954 | * @see #FLAG_SHOW_WHEN_LOCKED |
| 955 | * @see #FLAG_SHOW_WALLPAPER |
| 956 | * @see #FLAG_TURN_SCREEN_ON |
| 957 | * @see #FLAG_DISMISS_KEYGUARD |
| 958 | * @see #FLAG_SPLIT_TOUCH |
| 959 | * @see #FLAG_HARDWARE_ACCELERATED |
keunyoung | 30f420f | 2013-08-02 14:23:10 -0700 | [diff] [blame] | 960 | * @see #FLAG_LOCAL_FOCUS_MODE |
Adrian Roos | 217ccd2 | 2014-05-09 14:29:04 +0200 | [diff] [blame] | 961 | * @see #FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 962 | */ |
| 963 | @ViewDebug.ExportedProperty(flagMapping = { |
| 964 | @ViewDebug.FlagToString(mask = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, equals = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, |
| 965 | name = "FLAG_ALLOW_LOCK_WHILE_SCREEN_ON"), |
| 966 | @ViewDebug.FlagToString(mask = FLAG_DIM_BEHIND, equals = FLAG_DIM_BEHIND, |
| 967 | name = "FLAG_DIM_BEHIND"), |
| 968 | @ViewDebug.FlagToString(mask = FLAG_BLUR_BEHIND, equals = FLAG_BLUR_BEHIND, |
| 969 | name = "FLAG_BLUR_BEHIND"), |
| 970 | @ViewDebug.FlagToString(mask = FLAG_NOT_FOCUSABLE, equals = FLAG_NOT_FOCUSABLE, |
| 971 | name = "FLAG_NOT_FOCUSABLE"), |
| 972 | @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCHABLE, equals = FLAG_NOT_TOUCHABLE, |
| 973 | name = "FLAG_NOT_TOUCHABLE"), |
| 974 | @ViewDebug.FlagToString(mask = FLAG_NOT_TOUCH_MODAL, equals = FLAG_NOT_TOUCH_MODAL, |
| 975 | name = "FLAG_NOT_TOUCH_MODAL"), |
| 976 | @ViewDebug.FlagToString(mask = FLAG_TOUCHABLE_WHEN_WAKING, equals = FLAG_TOUCHABLE_WHEN_WAKING, |
| 977 | name = "FLAG_TOUCHABLE_WHEN_WAKING"), |
| 978 | @ViewDebug.FlagToString(mask = FLAG_KEEP_SCREEN_ON, equals = FLAG_KEEP_SCREEN_ON, |
| 979 | name = "FLAG_KEEP_SCREEN_ON"), |
| 980 | @ViewDebug.FlagToString(mask = FLAG_LAYOUT_IN_SCREEN, equals = FLAG_LAYOUT_IN_SCREEN, |
| 981 | name = "FLAG_LAYOUT_IN_SCREEN"), |
| 982 | @ViewDebug.FlagToString(mask = FLAG_LAYOUT_NO_LIMITS, equals = FLAG_LAYOUT_NO_LIMITS, |
| 983 | name = "FLAG_LAYOUT_NO_LIMITS"), |
| 984 | @ViewDebug.FlagToString(mask = FLAG_FULLSCREEN, equals = FLAG_FULLSCREEN, |
| 985 | name = "FLAG_FULLSCREEN"), |
| 986 | @ViewDebug.FlagToString(mask = FLAG_FORCE_NOT_FULLSCREEN, equals = FLAG_FORCE_NOT_FULLSCREEN, |
| 987 | name = "FLAG_FORCE_NOT_FULLSCREEN"), |
| 988 | @ViewDebug.FlagToString(mask = FLAG_DITHER, equals = FLAG_DITHER, |
| 989 | name = "FLAG_DITHER"), |
| 990 | @ViewDebug.FlagToString(mask = FLAG_SECURE, equals = FLAG_SECURE, |
| 991 | name = "FLAG_SECURE"), |
| 992 | @ViewDebug.FlagToString(mask = FLAG_SCALED, equals = FLAG_SCALED, |
| 993 | name = "FLAG_SCALED"), |
| 994 | @ViewDebug.FlagToString(mask = FLAG_IGNORE_CHEEK_PRESSES, equals = FLAG_IGNORE_CHEEK_PRESSES, |
| 995 | name = "FLAG_IGNORE_CHEEK_PRESSES"), |
| 996 | @ViewDebug.FlagToString(mask = FLAG_LAYOUT_INSET_DECOR, equals = FLAG_LAYOUT_INSET_DECOR, |
| 997 | name = "FLAG_LAYOUT_INSET_DECOR"), |
| 998 | @ViewDebug.FlagToString(mask = FLAG_ALT_FOCUSABLE_IM, equals = FLAG_ALT_FOCUSABLE_IM, |
| 999 | name = "FLAG_ALT_FOCUSABLE_IM"), |
| 1000 | @ViewDebug.FlagToString(mask = FLAG_WATCH_OUTSIDE_TOUCH, equals = FLAG_WATCH_OUTSIDE_TOUCH, |
| 1001 | name = "FLAG_WATCH_OUTSIDE_TOUCH"), |
| 1002 | @ViewDebug.FlagToString(mask = FLAG_SHOW_WHEN_LOCKED, equals = FLAG_SHOW_WHEN_LOCKED, |
| 1003 | name = "FLAG_SHOW_WHEN_LOCKED"), |
| 1004 | @ViewDebug.FlagToString(mask = FLAG_SHOW_WALLPAPER, equals = FLAG_SHOW_WALLPAPER, |
| 1005 | name = "FLAG_SHOW_WALLPAPER"), |
| 1006 | @ViewDebug.FlagToString(mask = FLAG_TURN_SCREEN_ON, equals = FLAG_TURN_SCREEN_ON, |
| 1007 | name = "FLAG_TURN_SCREEN_ON"), |
| 1008 | @ViewDebug.FlagToString(mask = FLAG_DISMISS_KEYGUARD, equals = FLAG_DISMISS_KEYGUARD, |
| 1009 | name = "FLAG_DISMISS_KEYGUARD"), |
| 1010 | @ViewDebug.FlagToString(mask = FLAG_SPLIT_TOUCH, equals = FLAG_SPLIT_TOUCH, |
| 1011 | name = "FLAG_SPLIT_TOUCH"), |
| 1012 | @ViewDebug.FlagToString(mask = FLAG_HARDWARE_ACCELERATED, equals = FLAG_HARDWARE_ACCELERATED, |
keunyoung | 30f420f | 2013-08-02 14:23:10 -0700 | [diff] [blame] | 1013 | name = "FLAG_HARDWARE_ACCELERATED"), |
| 1014 | @ViewDebug.FlagToString(mask = FLAG_LOCAL_FOCUS_MODE, equals = FLAG_LOCAL_FOCUS_MODE, |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 1015 | name = "FLAG_LOCAL_FOCUS_MODE"), |
| 1016 | @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_STATUS, equals = FLAG_TRANSLUCENT_STATUS, |
| 1017 | name = "FLAG_TRANSLUCENT_STATUS"), |
| 1018 | @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_NAVIGATION, equals = FLAG_TRANSLUCENT_NAVIGATION, |
Adrian Roos | 217ccd2 | 2014-05-09 14:29:04 +0200 | [diff] [blame] | 1019 | name = "FLAG_TRANSLUCENT_NAVIGATION"), |
| 1020 | @ViewDebug.FlagToString(mask = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, equals = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, |
| 1021 | name = "FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS") |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1022 | }) |
| 1023 | public int flags; |
| 1024 | |
| 1025 | /** |
| 1026 | * If the window has requested hardware acceleration, but this is not |
| 1027 | * allowed in the process it is in, then still render it as if it is |
| 1028 | * hardware accelerated. This is used for the starting preview windows |
| 1029 | * in the system process, which don't need to have the overhead of |
| 1030 | * hardware acceleration (they are just a static rendering), but should |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 1031 | * be rendered as such to match the actual window of the app even if it |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1032 | * is hardware accelerated. |
| 1033 | * Even if the window isn't hardware accelerated, still do its rendering |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 1034 | * as if it was. |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1035 | * Like {@link #FLAG_HARDWARE_ACCELERATED} except for trusted system windows |
| 1036 | * that need hardware acceleration (e.g. LockScreen), where hardware acceleration |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1037 | * is generally disabled. This flag must be specified in addition to |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1038 | * {@link #FLAG_HARDWARE_ACCELERATED} to enable hardware acceleration for system |
| 1039 | * windows. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1040 | * |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1041 | * @hide |
| 1042 | */ |
| 1043 | public static final int PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED = 0x00000001; |
| 1044 | |
| 1045 | /** |
| 1046 | * In the system process, we globally do not use hardware acceleration |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 1047 | * because there are many threads doing UI there and they conflict. |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1048 | * If certain parts of the UI that really do want to use hardware |
| 1049 | * acceleration, this flag can be set to force it. This is basically |
| 1050 | * for the lock screen. Anyone else using it, you are probably wrong. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1051 | * |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1052 | * @hide |
| 1053 | */ |
| 1054 | public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 0x00000002; |
| 1055 | |
| 1056 | /** |
Chet Haase | a8e5a2b | 2011-10-28 13:18:16 -0700 | [diff] [blame] | 1057 | * By default, wallpapers are sent new offsets when the wallpaper is scrolled. Wallpapers |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 1058 | * may elect to skip these notifications if they are not doing anything productive with |
Chet Haase | a8e5a2b | 2011-10-28 13:18:16 -0700 | [diff] [blame] | 1059 | * them (they do not affect the wallpaper scrolling operation) by calling |
| 1060 | * {@link |
| 1061 | * android.service.wallpaper.WallpaperService.Engine#setOffsetNotificationsEnabled(boolean)}. |
| 1062 | * |
| 1063 | * @hide |
| 1064 | */ |
| 1065 | public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS = 0x00000004; |
| 1066 | |
| 1067 | /** |
Dianne Hackborn | 73ab6a4 | 2011-12-13 11:16:23 -0800 | [diff] [blame] | 1068 | * This is set for a window that has explicitly specified its |
| 1069 | * FLAG_NEEDS_MENU_KEY, so we know the value on this window is the |
| 1070 | * appropriate one to use. If this is not set, we should look at |
| 1071 | * windows behind it to determine the appropriate value. |
| 1072 | * |
| 1073 | * @hide |
| 1074 | */ |
| 1075 | public static final int PRIVATE_FLAG_SET_NEEDS_MENU_KEY = 0x00000008; |
| 1076 | |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 1077 | /** In a multiuser system if this flag is set and the owner is a system process then this |
| 1078 | * window will appear on all user screens. This overrides the default behavior of window |
| 1079 | * types that normally only appear on the owning user's screen. Refer to each window type |
| 1080 | * to determine its default behavior. |
| 1081 | * |
| 1082 | * {@hide} */ |
| 1083 | public static final int PRIVATE_FLAG_SHOW_FOR_ALL_USERS = 0x00000010; |
| 1084 | |
Dianne Hackborn | 73ab6a4 | 2011-12-13 11:16:23 -0800 | [diff] [blame] | 1085 | /** |
Dianne Hackborn | 1c5383c | 2013-04-15 15:07:21 -0700 | [diff] [blame] | 1086 | * Never animate position changes of the window. |
| 1087 | * |
| 1088 | * {@hide} */ |
| 1089 | public static final int PRIVATE_FLAG_NO_MOVE_ANIMATION = 0x00000040; |
| 1090 | |
Adam Lesinski | 6a591f5 | 2013-10-01 18:11:17 -0700 | [diff] [blame] | 1091 | /** Window flag: special flag to limit the size of the window to be |
| 1092 | * original size ([320x480] x density). Used to create window for applications |
| 1093 | * running under compatibility mode. |
| 1094 | * |
| 1095 | * {@hide} */ |
| 1096 | public static final int PRIVATE_FLAG_COMPATIBLE_WINDOW = 0x00000080; |
| 1097 | |
| 1098 | /** Window flag: a special option intended for system dialogs. When |
| 1099 | * this flag is set, the window will demand focus unconditionally when |
| 1100 | * it is created. |
| 1101 | * {@hide} */ |
| 1102 | public static final int PRIVATE_FLAG_SYSTEM_ERROR = 0x00000100; |
| 1103 | |
John Spurlock | 3f7cd51 | 2013-10-07 12:25:09 -0400 | [diff] [blame] | 1104 | /** Window flag: maintain the previous translucent decor state when this window |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 1105 | * becomes top-most. |
| 1106 | * {@hide} */ |
| 1107 | public static final int PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR = 0x00000200; |
| 1108 | |
Dianne Hackborn | 1c5383c | 2013-04-15 15:07:21 -0700 | [diff] [blame] | 1109 | /** |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 1110 | * Flag whether the current window is a keyguard window, meaning that it will hide all other |
| 1111 | * windows behind it except for windows with flag {@link #FLAG_SHOW_WHEN_LOCKED} set. |
| 1112 | * Further, this can only be set by {@link LayoutParams#TYPE_STATUS_BAR}. |
| 1113 | * {@hide} |
| 1114 | */ |
| 1115 | public static final int PRIVATE_FLAG_KEYGUARD = 0x00000400; |
| 1116 | |
| 1117 | /** |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1118 | * Control flags that are private to the platform. |
| 1119 | * @hide |
| 1120 | */ |
| 1121 | public int privateFlags; |
| 1122 | |
| 1123 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1124 | * Given a particular set of window manager flags, determine whether |
| 1125 | * such a window may be a target for an input method when it has |
| 1126 | * focus. In particular, this checks the |
| 1127 | * {@link #FLAG_NOT_FOCUSABLE} and {@link #FLAG_ALT_FOCUSABLE_IM} |
| 1128 | * flags and returns true if the combination of the two corresponds |
| 1129 | * to a window that needs to be behind the input method so that the |
| 1130 | * user can type into it. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1131 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1132 | * @param flags The current window manager flags. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1133 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1134 | * @return Returns true if such a window should be behind/interact |
| 1135 | * with an input method, false if not. |
| 1136 | */ |
| 1137 | public static boolean mayUseInputMethod(int flags) { |
| 1138 | switch (flags&(FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM)) { |
| 1139 | case 0: |
| 1140 | case FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM: |
| 1141 | return true; |
| 1142 | } |
| 1143 | return false; |
| 1144 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1145 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1146 | /** |
| 1147 | * Mask for {@link #softInputMode} of the bits that determine the |
| 1148 | * desired visibility state of the soft input area for this window. |
| 1149 | */ |
| 1150 | public static final int SOFT_INPUT_MASK_STATE = 0x0f; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1151 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1152 | /** |
| 1153 | * Visibility state for {@link #softInputMode}: no state has been specified. |
| 1154 | */ |
| 1155 | public static final int SOFT_INPUT_STATE_UNSPECIFIED = 0; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1156 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1157 | /** |
| 1158 | * Visibility state for {@link #softInputMode}: please don't change the state of |
| 1159 | * the soft input area. |
| 1160 | */ |
| 1161 | public static final int SOFT_INPUT_STATE_UNCHANGED = 1; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1162 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1163 | /** |
| 1164 | * Visibility state for {@link #softInputMode}: please hide any soft input |
| 1165 | * area when normally appropriate (when the user is navigating |
| 1166 | * forward to your window). |
| 1167 | */ |
| 1168 | public static final int SOFT_INPUT_STATE_HIDDEN = 2; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1169 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1170 | /** |
| 1171 | * Visibility state for {@link #softInputMode}: please always hide any |
| 1172 | * soft input area when this window receives focus. |
| 1173 | */ |
| 1174 | public static final int SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1175 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1176 | /** |
| 1177 | * Visibility state for {@link #softInputMode}: please show the soft |
| 1178 | * input area when normally appropriate (when the user is navigating |
| 1179 | * forward to your window). |
| 1180 | */ |
| 1181 | public static final int SOFT_INPUT_STATE_VISIBLE = 4; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1182 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1183 | /** |
| 1184 | * Visibility state for {@link #softInputMode}: please always make the |
| 1185 | * soft input area visible when this window receives input focus. |
| 1186 | */ |
| 1187 | public static final int SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1188 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1189 | /** |
| 1190 | * Mask for {@link #softInputMode} of the bits that determine the |
| 1191 | * way that the window should be adjusted to accommodate the soft |
| 1192 | * input window. |
| 1193 | */ |
| 1194 | public static final int SOFT_INPUT_MASK_ADJUST = 0xf0; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1195 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1196 | /** Adjustment option for {@link #softInputMode}: nothing specified. |
| 1197 | * The system will try to pick one or |
| 1198 | * the other depending on the contents of the window. |
| 1199 | */ |
| 1200 | public static final int SOFT_INPUT_ADJUST_UNSPECIFIED = 0x00; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1201 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1202 | /** Adjustment option for {@link #softInputMode}: set to allow the |
| 1203 | * window to be resized when an input |
| 1204 | * method is shown, so that its contents are not covered by the input |
Scott Main | f10e633 | 2010-06-11 09:03:22 -0700 | [diff] [blame] | 1205 | * method. This can <em>not</em> be combined with |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1206 | * {@link #SOFT_INPUT_ADJUST_PAN}; if |
| 1207 | * neither of these are set, then the system will try to pick one or |
Chet Haase | 45c89c2 | 2013-04-29 16:04:40 -0700 | [diff] [blame] | 1208 | * the other depending on the contents of the window. If the window's |
| 1209 | * layout parameter flags include {@link #FLAG_FULLSCREEN}, this |
| 1210 | * value for {@link #softInputMode} will be ignored; the window will |
| 1211 | * not resize, but will stay fullscreen. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1212 | */ |
| 1213 | public static final int SOFT_INPUT_ADJUST_RESIZE = 0x10; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1214 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1215 | /** Adjustment option for {@link #softInputMode}: set to have a window |
| 1216 | * pan when an input method is |
| 1217 | * shown, so it doesn't need to deal with resizing but just panned |
| 1218 | * by the framework to ensure the current input focus is visible. This |
Scott Main | f10e633 | 2010-06-11 09:03:22 -0700 | [diff] [blame] | 1219 | * can <em>not</em> be combined with {@link #SOFT_INPUT_ADJUST_RESIZE}; if |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1220 | * neither of these are set, then the system will try to pick one or |
| 1221 | * the other depending on the contents of the window. |
| 1222 | */ |
| 1223 | public static final int SOFT_INPUT_ADJUST_PAN = 0x20; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1224 | |
Dianne Hackborn | dea3ef7 | 2010-10-28 14:24:22 -0700 | [diff] [blame] | 1225 | /** Adjustment option for {@link #softInputMode}: set to have a window |
| 1226 | * not adjust for a shown input method. The window will not be resized, |
| 1227 | * and it will not be panned to make its focus visible. |
| 1228 | */ |
| 1229 | public static final int SOFT_INPUT_ADJUST_NOTHING = 0x30; |
| 1230 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1231 | /** |
| 1232 | * Bit for {@link #softInputMode}: set when the user has navigated |
| 1233 | * forward to the window. This is normally set automatically for |
| 1234 | * you by the system, though you may want to set it in certain cases |
| 1235 | * when you are displaying a window yourself. This flag will always |
| 1236 | * be cleared automatically after the window is displayed. |
| 1237 | */ |
| 1238 | public static final int SOFT_INPUT_IS_FORWARD_NAVIGATION = 0x100; |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1239 | |
| 1240 | /** |
Gilles Debunne | be2c4f9 | 2011-01-17 15:14:32 -0800 | [diff] [blame] | 1241 | * Desired operating mode for any soft input area. May be any combination |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1242 | * of: |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1243 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1244 | * <ul> |
| 1245 | * <li> One of the visibility states |
| 1246 | * {@link #SOFT_INPUT_STATE_UNSPECIFIED}, {@link #SOFT_INPUT_STATE_UNCHANGED}, |
| 1247 | * {@link #SOFT_INPUT_STATE_HIDDEN}, {@link #SOFT_INPUT_STATE_ALWAYS_VISIBLE}, or |
| 1248 | * {@link #SOFT_INPUT_STATE_VISIBLE}. |
| 1249 | * <li> One of the adjustment options |
| 1250 | * {@link #SOFT_INPUT_ADJUST_UNSPECIFIED}, |
| 1251 | * {@link #SOFT_INPUT_ADJUST_RESIZE}, or |
| 1252 | * {@link #SOFT_INPUT_ADJUST_PAN}. |
Dianne Hackborn | 1bf1af6 | 2013-02-25 16:48:53 -0800 | [diff] [blame] | 1253 | * </ul> |
| 1254 | * |
| 1255 | * |
| 1256 | * <p>This flag can be controlled in your theme through the |
| 1257 | * {@link android.R.attr#windowSoftInputMode} attribute.</p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1258 | */ |
| 1259 | public int softInputMode; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1260 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1261 | /** |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 1262 | * Placement of window within the screen as per {@link Gravity}. Both |
| 1263 | * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int, |
| 1264 | * android.graphics.Rect) Gravity.apply} and |
| 1265 | * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect) |
| 1266 | * Gravity.applyDisplay} are used during window layout, with this value |
| 1267 | * given as the desired gravity. For example you can specify |
| 1268 | * {@link Gravity#DISPLAY_CLIP_HORIZONTAL Gravity.DISPLAY_CLIP_HORIZONTAL} and |
| 1269 | * {@link Gravity#DISPLAY_CLIP_VERTICAL Gravity.DISPLAY_CLIP_VERTICAL} here |
| 1270 | * to control the behavior of |
| 1271 | * {@link Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect) |
| 1272 | * Gravity.applyDisplay}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1273 | * |
| 1274 | * @see Gravity |
| 1275 | */ |
| 1276 | public int gravity; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1277 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1278 | /** |
| 1279 | * The horizontal margin, as a percentage of the container's width, |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 1280 | * between the container and the widget. See |
| 1281 | * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int, |
| 1282 | * android.graphics.Rect) Gravity.apply} for how this is used. This |
| 1283 | * field is added with {@link #x} to supply the <var>xAdj</var> parameter. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1284 | */ |
| 1285 | public float horizontalMargin; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1286 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1287 | /** |
| 1288 | * The vertical margin, as a percentage of the container's height, |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 1289 | * between the container and the widget. See |
| 1290 | * {@link Gravity#apply(int, int, int, android.graphics.Rect, int, int, |
| 1291 | * android.graphics.Rect) Gravity.apply} for how this is used. This |
| 1292 | * field is added with {@link #y} to supply the <var>yAdj</var> parameter. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1293 | */ |
| 1294 | public float verticalMargin; |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame^] | 1295 | |
| 1296 | /** |
| 1297 | * Positive insets between the drawing surface and window content. |
| 1298 | * |
| 1299 | * @hide |
| 1300 | */ |
| 1301 | public Rect shadowInsets = new Rect(); |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1302 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1303 | /** |
| 1304 | * The desired bitmap format. May be one of the constants in |
| 1305 | * {@link android.graphics.PixelFormat}. Default is OPAQUE. |
| 1306 | */ |
| 1307 | public int format; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1308 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1309 | /** |
| 1310 | * A style resource defining the animations to use for this window. |
| 1311 | * This must be a system resource; it can not be an application resource |
| 1312 | * because the window manager does not have access to applications. |
| 1313 | */ |
| 1314 | public int windowAnimations; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1315 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1316 | /** |
| 1317 | * An alpha value to apply to this entire window. |
| 1318 | * An alpha of 1.0 means fully opaque and 0.0 means fully transparent |
| 1319 | */ |
| 1320 | public float alpha = 1.0f; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1321 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1322 | /** |
| 1323 | * When {@link #FLAG_DIM_BEHIND} is set, this is the amount of dimming |
| 1324 | * to apply. Range is from 1.0 for completely opaque to 0.0 for no |
| 1325 | * dim. |
| 1326 | */ |
| 1327 | public float dimAmount = 1.0f; |
Dianne Hackborn | dea3ef7 | 2010-10-28 14:24:22 -0700 | [diff] [blame] | 1328 | |
| 1329 | /** |
| 1330 | * Default value for {@link #screenBrightness} and {@link #buttonBrightness} |
| 1331 | * indicating that the brightness value is not overridden for this window |
| 1332 | * and normal brightness policy should be used. |
| 1333 | */ |
| 1334 | public static final float BRIGHTNESS_OVERRIDE_NONE = -1.0f; |
| 1335 | |
| 1336 | /** |
| 1337 | * Value for {@link #screenBrightness} and {@link #buttonBrightness} |
| 1338 | * indicating that the screen or button backlight brightness should be set |
| 1339 | * to the lowest value when this window is in front. |
| 1340 | */ |
| 1341 | public static final float BRIGHTNESS_OVERRIDE_OFF = 0.0f; |
| 1342 | |
| 1343 | /** |
| 1344 | * Value for {@link #screenBrightness} and {@link #buttonBrightness} |
| 1345 | * indicating that the screen or button backlight brightness should be set |
| 1346 | * to the hightest value when this window is in front. |
| 1347 | */ |
| 1348 | public static final float BRIGHTNESS_OVERRIDE_FULL = 1.0f; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1349 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1350 | /** |
| 1351 | * This can be used to override the user's preferred brightness of |
| 1352 | * the screen. A value of less than 0, the default, means to use the |
| 1353 | * preferred screen brightness. 0 to 1 adjusts the brightness from |
| 1354 | * dark to full bright. |
| 1355 | */ |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1356 | public float screenBrightness = BRIGHTNESS_OVERRIDE_NONE; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1357 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1358 | /** |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1359 | * This can be used to override the standard behavior of the button and |
| 1360 | * keyboard backlights. A value of less than 0, the default, means to |
| 1361 | * use the standard backlight behavior. 0 to 1 adjusts the brightness |
| 1362 | * from dark to full bright. |
| 1363 | */ |
| 1364 | public float buttonBrightness = BRIGHTNESS_OVERRIDE_NONE; |
| 1365 | |
| 1366 | /** |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1367 | * Value for {@link #rotationAnimation} to define the animation used to |
| 1368 | * specify that this window will rotate in or out following a rotation. |
| 1369 | */ |
| 1370 | public static final int ROTATION_ANIMATION_ROTATE = 0; |
| 1371 | |
| 1372 | /** |
| 1373 | * Value for {@link #rotationAnimation} to define the animation used to |
| 1374 | * specify that this window will fade in or out following a rotation. |
| 1375 | */ |
| 1376 | public static final int ROTATION_ANIMATION_CROSSFADE = 1; |
| 1377 | |
| 1378 | /** |
| 1379 | * Value for {@link #rotationAnimation} to define the animation used to |
| 1380 | * specify that this window will immediately disappear or appear following |
| 1381 | * a rotation. |
| 1382 | */ |
| 1383 | public static final int ROTATION_ANIMATION_JUMPCUT = 2; |
| 1384 | |
| 1385 | /** |
Craig Mautner | bdcc9a5 | 2013-04-19 13:06:53 -0700 | [diff] [blame] | 1386 | * Define the exit and entry animations used on this window when the device is rotated. |
| 1387 | * This only has an affect if the incoming and outgoing topmost |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1388 | * opaque windows have the #FLAG_FULLSCREEN bit set and are not covered |
Craig Mautner | bdcc9a5 | 2013-04-19 13:06:53 -0700 | [diff] [blame] | 1389 | * by other windows. All other situations default to the |
| 1390 | * {@link #ROTATION_ANIMATION_ROTATE} behavior. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1391 | * |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1392 | * @see #ROTATION_ANIMATION_ROTATE |
| 1393 | * @see #ROTATION_ANIMATION_CROSSFADE |
| 1394 | * @see #ROTATION_ANIMATION_JUMPCUT |
| 1395 | */ |
| 1396 | public int rotationAnimation = ROTATION_ANIMATION_ROTATE; |
| 1397 | |
| 1398 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1399 | * Identifier for this window. This will usually be filled in for |
| 1400 | * you. |
| 1401 | */ |
| 1402 | public IBinder token = null; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1403 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1404 | /** |
| 1405 | * Name of the package owning this window. |
| 1406 | */ |
| 1407 | public String packageName = null; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1408 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1409 | /** |
| 1410 | * Specific orientation value for a window. |
| 1411 | * May be any of the same values allowed |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1412 | * for {@link android.content.pm.ActivityInfo#screenOrientation}. |
| 1413 | * If not set, a default value of |
| 1414 | * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_UNSPECIFIED} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1415 | * will be used. |
| 1416 | */ |
| 1417 | public int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1418 | |
| 1419 | /** |
| 1420 | * Control the visibility of the status bar. |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1421 | * |
| 1422 | * @see View#STATUS_BAR_VISIBLE |
| 1423 | * @see View#STATUS_BAR_HIDDEN |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1424 | */ |
| 1425 | public int systemUiVisibility; |
| 1426 | |
| 1427 | /** |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1428 | * @hide |
| 1429 | * The ui visibility as requested by the views in this hierarchy. |
| 1430 | * the combined value should be systemUiVisibility | subtreeSystemUiVisibility. |
| 1431 | */ |
| 1432 | public int subtreeSystemUiVisibility; |
| 1433 | |
| 1434 | /** |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1435 | * Get callbacks about the system ui visibility changing. |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1436 | * |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1437 | * TODO: Maybe there should be a bitfield of optional callbacks that we need. |
| 1438 | * |
| 1439 | * @hide |
| 1440 | */ |
| 1441 | public boolean hasSystemUiListeners; |
| 1442 | |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1443 | /** |
| 1444 | * When this window has focus, disable touch pad pointer gesture processing. |
| 1445 | * The window will receive raw position updates from the touch pad instead |
| 1446 | * of pointer movements and synthetic touch events. |
| 1447 | * |
| 1448 | * @hide |
| 1449 | */ |
| 1450 | public static final int INPUT_FEATURE_DISABLE_POINTER_GESTURES = 0x00000001; |
| 1451 | |
| 1452 | /** |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 1453 | * Does not construct an input channel for this window. The channel will therefore |
| 1454 | * be incapable of receiving input. |
| 1455 | * |
| 1456 | * @hide |
| 1457 | */ |
| 1458 | public static final int INPUT_FEATURE_NO_INPUT_CHANNEL = 0x00000002; |
| 1459 | |
| 1460 | /** |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1461 | * When this window has focus, does not call user activity for all input events so |
| 1462 | * the application will have to do it itself. Should only be used by |
| 1463 | * the keyguard and phone app. |
| 1464 | * <p> |
| 1465 | * Should only be used by the keyguard and phone app. |
| 1466 | * </p> |
| 1467 | * |
| 1468 | * @hide |
| 1469 | */ |
| 1470 | public static final int INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004; |
| 1471 | |
| 1472 | /** |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1473 | * Control special features of the input subsystem. |
| 1474 | * |
Craig Mautner | bdcc9a5 | 2013-04-19 13:06:53 -0700 | [diff] [blame] | 1475 | * @see #INPUT_FEATURE_DISABLE_POINTER_GESTURES |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 1476 | * @see #INPUT_FEATURE_NO_INPUT_CHANNEL |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1477 | * @see #INPUT_FEATURE_DISABLE_USER_ACTIVITY |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1478 | * @hide |
| 1479 | */ |
| 1480 | public int inputFeatures; |
| 1481 | |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1482 | /** |
| 1483 | * Sets the number of milliseconds before the user activity timeout occurs |
| 1484 | * when this window has focus. A value of -1 uses the standard timeout. |
| 1485 | * A value of 0 uses the minimum support display timeout. |
| 1486 | * <p> |
| 1487 | * This property can only be used to reduce the user specified display timeout; |
| 1488 | * it can never make the timeout longer than it normally would be. |
| 1489 | * </p><p> |
| 1490 | * Should only be used by the keyguard and phone app. |
| 1491 | * </p> |
| 1492 | * |
| 1493 | * @hide |
| 1494 | */ |
| 1495 | public long userActivityTimeout = -1; |
| 1496 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1497 | public LayoutParams() { |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 1498 | super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1499 | type = TYPE_APPLICATION; |
| 1500 | format = PixelFormat.OPAQUE; |
| 1501 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1502 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1503 | public LayoutParams(int _type) { |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 1504 | super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1505 | type = _type; |
| 1506 | format = PixelFormat.OPAQUE; |
| 1507 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1508 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1509 | public LayoutParams(int _type, int _flags) { |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 1510 | super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1511 | type = _type; |
| 1512 | flags = _flags; |
| 1513 | format = PixelFormat.OPAQUE; |
| 1514 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1515 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1516 | public LayoutParams(int _type, int _flags, int _format) { |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 1517 | super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1518 | type = _type; |
| 1519 | flags = _flags; |
| 1520 | format = _format; |
| 1521 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1522 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1523 | public LayoutParams(int w, int h, int _type, int _flags, int _format) { |
| 1524 | super(w, h); |
| 1525 | type = _type; |
| 1526 | flags = _flags; |
| 1527 | format = _format; |
| 1528 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1529 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1530 | public LayoutParams(int w, int h, int xpos, int ypos, int _type, |
| 1531 | int _flags, int _format) { |
| 1532 | super(w, h); |
| 1533 | x = xpos; |
| 1534 | y = ypos; |
| 1535 | type = _type; |
| 1536 | flags = _flags; |
| 1537 | format = _format; |
| 1538 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1539 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1540 | public final void setTitle(CharSequence title) { |
| 1541 | if (null == title) |
| 1542 | title = ""; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1543 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1544 | mTitle = TextUtils.stringOrSpannedString(title); |
| 1545 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1546 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1547 | public final CharSequence getTitle() { |
| 1548 | return mTitle; |
| 1549 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1550 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1551 | public int describeContents() { |
| 1552 | return 0; |
| 1553 | } |
| 1554 | |
| 1555 | public void writeToParcel(Parcel out, int parcelableFlags) { |
| 1556 | out.writeInt(width); |
| 1557 | out.writeInt(height); |
| 1558 | out.writeInt(x); |
| 1559 | out.writeInt(y); |
| 1560 | out.writeInt(type); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1561 | out.writeInt(flags); |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1562 | out.writeInt(privateFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1563 | out.writeInt(softInputMode); |
| 1564 | out.writeInt(gravity); |
| 1565 | out.writeFloat(horizontalMargin); |
| 1566 | out.writeFloat(verticalMargin); |
| 1567 | out.writeInt(format); |
| 1568 | out.writeInt(windowAnimations); |
| 1569 | out.writeFloat(alpha); |
| 1570 | out.writeFloat(dimAmount); |
| 1571 | out.writeFloat(screenBrightness); |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1572 | out.writeFloat(buttonBrightness); |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1573 | out.writeInt(rotationAnimation); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1574 | out.writeStrongBinder(token); |
| 1575 | out.writeString(packageName); |
| 1576 | TextUtils.writeToParcel(mTitle, out, parcelableFlags); |
| 1577 | out.writeInt(screenOrientation); |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1578 | out.writeInt(systemUiVisibility); |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1579 | out.writeInt(subtreeSystemUiVisibility); |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1580 | out.writeInt(hasSystemUiListeners ? 1 : 0); |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1581 | out.writeInt(inputFeatures); |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1582 | out.writeLong(userActivityTimeout); |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame^] | 1583 | out.writeInt(shadowInsets.left); |
| 1584 | out.writeInt(shadowInsets.top); |
| 1585 | out.writeInt(shadowInsets.right); |
| 1586 | out.writeInt(shadowInsets.bottom); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1587 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1588 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1589 | public static final Parcelable.Creator<LayoutParams> CREATOR |
| 1590 | = new Parcelable.Creator<LayoutParams>() { |
| 1591 | public LayoutParams createFromParcel(Parcel in) { |
| 1592 | return new LayoutParams(in); |
| 1593 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1594 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1595 | public LayoutParams[] newArray(int size) { |
| 1596 | return new LayoutParams[size]; |
| 1597 | } |
| 1598 | }; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1599 | |
| 1600 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1601 | public LayoutParams(Parcel in) { |
| 1602 | width = in.readInt(); |
| 1603 | height = in.readInt(); |
| 1604 | x = in.readInt(); |
| 1605 | y = in.readInt(); |
| 1606 | type = in.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1607 | flags = in.readInt(); |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1608 | privateFlags = in.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1609 | softInputMode = in.readInt(); |
| 1610 | gravity = in.readInt(); |
| 1611 | horizontalMargin = in.readFloat(); |
| 1612 | verticalMargin = in.readFloat(); |
| 1613 | format = in.readInt(); |
| 1614 | windowAnimations = in.readInt(); |
| 1615 | alpha = in.readFloat(); |
| 1616 | dimAmount = in.readFloat(); |
| 1617 | screenBrightness = in.readFloat(); |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1618 | buttonBrightness = in.readFloat(); |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1619 | rotationAnimation = in.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1620 | token = in.readStrongBinder(); |
| 1621 | packageName = in.readString(); |
| 1622 | mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in); |
| 1623 | screenOrientation = in.readInt(); |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1624 | systemUiVisibility = in.readInt(); |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1625 | subtreeSystemUiVisibility = in.readInt(); |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1626 | hasSystemUiListeners = in.readInt() != 0; |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1627 | inputFeatures = in.readInt(); |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1628 | userActivityTimeout = in.readLong(); |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame^] | 1629 | shadowInsets.set(in.readInt(), in.readInt(), in.readInt(), in.readInt()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1630 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1631 | |
Romain Guy | 7299807 | 2009-06-22 11:09:20 -0700 | [diff] [blame] | 1632 | @SuppressWarnings({"PointlessBitwiseExpression"}) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1633 | public static final int LAYOUT_CHANGED = 1<<0; |
| 1634 | public static final int TYPE_CHANGED = 1<<1; |
| 1635 | public static final int FLAGS_CHANGED = 1<<2; |
| 1636 | public static final int FORMAT_CHANGED = 1<<3; |
| 1637 | public static final int ANIMATION_CHANGED = 1<<4; |
| 1638 | public static final int DIM_AMOUNT_CHANGED = 1<<5; |
| 1639 | public static final int TITLE_CHANGED = 1<<6; |
| 1640 | public static final int ALPHA_CHANGED = 1<<7; |
| 1641 | public static final int MEMORY_TYPE_CHANGED = 1<<8; |
| 1642 | public static final int SOFT_INPUT_MODE_CHANGED = 1<<9; |
| 1643 | public static final int SCREEN_ORIENTATION_CHANGED = 1<<10; |
| 1644 | public static final int SCREEN_BRIGHTNESS_CHANGED = 1<<11; |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1645 | public static final int ROTATION_ANIMATION_CHANGED = 1<<12; |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1646 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1647 | public static final int BUTTON_BRIGHTNESS_CHANGED = 1<<13; |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1648 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1649 | public static final int SYSTEM_UI_VISIBILITY_CHANGED = 1<<14; |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1650 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1651 | public static final int SYSTEM_UI_LISTENER_CHANGED = 1<<15; |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1652 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1653 | public static final int INPUT_FEATURES_CHANGED = 1<<16; |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1654 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1655 | public static final int PRIVATE_FLAGS_CHANGED = 1<<17; |
Romain Guy | f21c9b0 | 2011-09-06 16:56:54 -0700 | [diff] [blame] | 1656 | /** {@hide} */ |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1657 | public static final int USER_ACTIVITY_TIMEOUT_CHANGED = 1<<18; |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1658 | /** {@hide} */ |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 1659 | public static final int TRANSLUCENT_FLAGS_CHANGED = 1<<19; |
| 1660 | /** {@hide} */ |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame^] | 1661 | public static final int SHADOW_INSETS_CHANGED = 1<<20; |
| 1662 | /** {@hide} */ |
Romain Guy | f21c9b0 | 2011-09-06 16:56:54 -0700 | [diff] [blame] | 1663 | public static final int EVERYTHING_CHANGED = 0xffffffff; |
| 1664 | |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 1665 | // internal buffer to backup/restore parameters under compatibility mode. |
| 1666 | private int[] mCompatibilityParamsBackup = null; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1667 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1668 | public final int copyFrom(LayoutParams o) { |
| 1669 | int changes = 0; |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1670 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1671 | if (width != o.width) { |
| 1672 | width = o.width; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1673 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1674 | } |
| 1675 | if (height != o.height) { |
| 1676 | height = o.height; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1677 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1678 | } |
| 1679 | if (x != o.x) { |
| 1680 | x = o.x; |
| 1681 | changes |= LAYOUT_CHANGED; |
| 1682 | } |
| 1683 | if (y != o.y) { |
| 1684 | y = o.y; |
| 1685 | changes |= LAYOUT_CHANGED; |
| 1686 | } |
| 1687 | if (horizontalWeight != o.horizontalWeight) { |
| 1688 | horizontalWeight = o.horizontalWeight; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1689 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1690 | } |
| 1691 | if (verticalWeight != o.verticalWeight) { |
| 1692 | verticalWeight = o.verticalWeight; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1693 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1694 | } |
| 1695 | if (horizontalMargin != o.horizontalMargin) { |
| 1696 | horizontalMargin = o.horizontalMargin; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1697 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1698 | } |
| 1699 | if (verticalMargin != o.verticalMargin) { |
| 1700 | verticalMargin = o.verticalMargin; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1701 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1702 | } |
| 1703 | if (type != o.type) { |
| 1704 | type = o.type; |
| 1705 | changes |= TYPE_CHANGED; |
| 1706 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1707 | if (flags != o.flags) { |
John Spurlock | bd95740 | 2013-10-03 11:38:39 -0400 | [diff] [blame] | 1708 | final int diff = flags ^ o.flags; |
| 1709 | if ((diff & (FLAG_TRANSLUCENT_STATUS | FLAG_TRANSLUCENT_NAVIGATION)) != 0) { |
| 1710 | changes |= TRANSLUCENT_FLAGS_CHANGED; |
| 1711 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1712 | flags = o.flags; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1713 | changes |= FLAGS_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1714 | } |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1715 | if (privateFlags != o.privateFlags) { |
| 1716 | privateFlags = o.privateFlags; |
| 1717 | changes |= PRIVATE_FLAGS_CHANGED; |
| 1718 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1719 | if (softInputMode != o.softInputMode) { |
| 1720 | softInputMode = o.softInputMode; |
| 1721 | changes |= SOFT_INPUT_MODE_CHANGED; |
| 1722 | } |
| 1723 | if (gravity != o.gravity) { |
| 1724 | gravity = o.gravity; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1725 | changes |= LAYOUT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1726 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1727 | if (format != o.format) { |
| 1728 | format = o.format; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1729 | changes |= FORMAT_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1730 | } |
| 1731 | if (windowAnimations != o.windowAnimations) { |
| 1732 | windowAnimations = o.windowAnimations; |
| 1733 | changes |= ANIMATION_CHANGED; |
| 1734 | } |
| 1735 | if (token == null) { |
| 1736 | // NOTE: token only copied if the recipient doesn't |
| 1737 | // already have one. |
| 1738 | token = o.token; |
| 1739 | } |
| 1740 | if (packageName == null) { |
| 1741 | // NOTE: packageName only copied if the recipient doesn't |
| 1742 | // already have one. |
| 1743 | packageName = o.packageName; |
| 1744 | } |
| 1745 | if (!mTitle.equals(o.mTitle)) { |
| 1746 | mTitle = o.mTitle; |
| 1747 | changes |= TITLE_CHANGED; |
| 1748 | } |
| 1749 | if (alpha != o.alpha) { |
| 1750 | alpha = o.alpha; |
| 1751 | changes |= ALPHA_CHANGED; |
| 1752 | } |
| 1753 | if (dimAmount != o.dimAmount) { |
| 1754 | dimAmount = o.dimAmount; |
| 1755 | changes |= DIM_AMOUNT_CHANGED; |
| 1756 | } |
| 1757 | if (screenBrightness != o.screenBrightness) { |
| 1758 | screenBrightness = o.screenBrightness; |
| 1759 | changes |= SCREEN_BRIGHTNESS_CHANGED; |
| 1760 | } |
Mike Lockwood | fb73f79 | 2009-11-20 11:31:18 -0500 | [diff] [blame] | 1761 | if (buttonBrightness != o.buttonBrightness) { |
| 1762 | buttonBrightness = o.buttonBrightness; |
| 1763 | changes |= BUTTON_BRIGHTNESS_CHANGED; |
| 1764 | } |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1765 | if (rotationAnimation != o.rotationAnimation) { |
| 1766 | rotationAnimation = o.rotationAnimation; |
| 1767 | changes |= ROTATION_ANIMATION_CHANGED; |
| 1768 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1769 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1770 | if (screenOrientation != o.screenOrientation) { |
| 1771 | screenOrientation = o.screenOrientation; |
Chet Haase | 40e0383 | 2011-10-06 08:34:13 -0700 | [diff] [blame] | 1772 | changes |= SCREEN_ORIENTATION_CHANGED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1773 | } |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 1774 | |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1775 | if (systemUiVisibility != o.systemUiVisibility |
| 1776 | || subtreeSystemUiVisibility != o.subtreeSystemUiVisibility) { |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1777 | systemUiVisibility = o.systemUiVisibility; |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1778 | subtreeSystemUiVisibility = o.subtreeSystemUiVisibility; |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1779 | changes |= SYSTEM_UI_VISIBILITY_CHANGED; |
| 1780 | } |
| 1781 | |
| 1782 | if (hasSystemUiListeners != o.hasSystemUiListeners) { |
| 1783 | hasSystemUiListeners = o.hasSystemUiListeners; |
| 1784 | changes |= SYSTEM_UI_LISTENER_CHANGED; |
| 1785 | } |
| 1786 | |
Jeff Brown | 474dcb5 | 2011-06-14 20:22:50 -0700 | [diff] [blame] | 1787 | if (inputFeatures != o.inputFeatures) { |
| 1788 | inputFeatures = o.inputFeatures; |
| 1789 | changes |= INPUT_FEATURES_CHANGED; |
| 1790 | } |
| 1791 | |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1792 | if (userActivityTimeout != o.userActivityTimeout) { |
| 1793 | userActivityTimeout = o.userActivityTimeout; |
| 1794 | changes |= USER_ACTIVITY_TIMEOUT_CHANGED; |
| 1795 | } |
| 1796 | |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame^] | 1797 | if (!shadowInsets.equals(o.shadowInsets)) { |
| 1798 | shadowInsets.set(o.shadowInsets); |
| 1799 | changes |= SHADOW_INSETS_CHANGED; |
| 1800 | } |
| 1801 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1802 | return changes; |
| 1803 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1804 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1805 | @Override |
| 1806 | public String debug(String output) { |
| 1807 | output += "Contents of " + this + ":"; |
| 1808 | Log.d("Debug", output); |
| 1809 | output = super.debug(""); |
| 1810 | Log.d("Debug", output); |
| 1811 | Log.d("Debug", ""); |
| 1812 | Log.d("Debug", "WindowManager.LayoutParams={title=" + mTitle + "}"); |
| 1813 | return ""; |
| 1814 | } |
Wonsik Kim | 475e3f0 | 2014-03-17 11:17:47 +0000 | [diff] [blame] | 1815 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1816 | @Override |
| 1817 | public String toString() { |
| 1818 | StringBuilder sb = new StringBuilder(256); |
| 1819 | sb.append("WM.LayoutParams{"); |
| 1820 | sb.append("("); |
| 1821 | sb.append(x); |
| 1822 | sb.append(','); |
| 1823 | sb.append(y); |
| 1824 | sb.append(")("); |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 1825 | sb.append((width== MATCH_PARENT ?"fill":(width==WRAP_CONTENT?"wrap":width))); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1826 | sb.append('x'); |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 1827 | sb.append((height== MATCH_PARENT ?"fill":(height==WRAP_CONTENT?"wrap":height))); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1828 | sb.append(")"); |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 1829 | if (horizontalMargin != 0) { |
| 1830 | sb.append(" hm="); |
| 1831 | sb.append(horizontalMargin); |
| 1832 | } |
| 1833 | if (verticalMargin != 0) { |
| 1834 | sb.append(" vm="); |
| 1835 | sb.append(verticalMargin); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1836 | } |
| 1837 | if (gravity != 0) { |
| 1838 | sb.append(" gr=#"); |
| 1839 | sb.append(Integer.toHexString(gravity)); |
| 1840 | } |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 1841 | if (softInputMode != 0) { |
| 1842 | sb.append(" sim=#"); |
| 1843 | sb.append(Integer.toHexString(softInputMode)); |
| 1844 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1845 | sb.append(" ty="); |
| 1846 | sb.append(type); |
| 1847 | sb.append(" fl=#"); |
| 1848 | sb.append(Integer.toHexString(flags)); |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1849 | if (privateFlags != 0) { |
Adam Lesinski | 95c4297 | 2013-10-02 10:13:27 -0700 | [diff] [blame] | 1850 | if ((privateFlags & PRIVATE_FLAG_COMPATIBLE_WINDOW) != 0) { |
| 1851 | sb.append(" compatible=true"); |
| 1852 | } |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 1853 | sb.append(" pfl=0x").append(Integer.toHexString(privateFlags)); |
| 1854 | } |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1855 | if (format != PixelFormat.OPAQUE) { |
| 1856 | sb.append(" fmt="); |
| 1857 | sb.append(format); |
| 1858 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1859 | if (windowAnimations != 0) { |
| 1860 | sb.append(" wanim=0x"); |
| 1861 | sb.append(Integer.toHexString(windowAnimations)); |
| 1862 | } |
| 1863 | if (screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) { |
| 1864 | sb.append(" or="); |
| 1865 | sb.append(screenOrientation); |
| 1866 | } |
Dianne Hackborn | 8eb2e24 | 2010-11-01 12:31:24 -0700 | [diff] [blame] | 1867 | if (alpha != 1.0f) { |
| 1868 | sb.append(" alpha="); |
| 1869 | sb.append(alpha); |
| 1870 | } |
| 1871 | if (screenBrightness != BRIGHTNESS_OVERRIDE_NONE) { |
| 1872 | sb.append(" sbrt="); |
| 1873 | sb.append(screenBrightness); |
| 1874 | } |
| 1875 | if (buttonBrightness != BRIGHTNESS_OVERRIDE_NONE) { |
| 1876 | sb.append(" bbrt="); |
| 1877 | sb.append(buttonBrightness); |
| 1878 | } |
Craig Mautner | 3c17437 | 2013-02-21 17:54:37 -0800 | [diff] [blame] | 1879 | if (rotationAnimation != ROTATION_ANIMATION_ROTATE) { |
| 1880 | sb.append(" rotAnim="); |
| 1881 | sb.append(rotationAnimation); |
| 1882 | } |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1883 | if (systemUiVisibility != 0) { |
| 1884 | sb.append(" sysui=0x"); |
| 1885 | sb.append(Integer.toHexString(systemUiVisibility)); |
| 1886 | } |
Joe Onorato | 14782f7 | 2011-01-25 19:53:17 -0800 | [diff] [blame] | 1887 | if (subtreeSystemUiVisibility != 0) { |
| 1888 | sb.append(" vsysui=0x"); |
| 1889 | sb.append(Integer.toHexString(subtreeSystemUiVisibility)); |
| 1890 | } |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 1891 | if (hasSystemUiListeners) { |
| 1892 | sb.append(" sysuil="); |
| 1893 | sb.append(hasSystemUiListeners); |
| 1894 | } |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1895 | if (inputFeatures != 0) { |
| 1896 | sb.append(" if=0x").append(Integer.toHexString(inputFeatures)); |
| 1897 | } |
Jeff Brown | 1e3b98d | 2012-09-30 18:58:59 -0700 | [diff] [blame] | 1898 | if (userActivityTimeout >= 0) { |
| 1899 | sb.append(" userActivityTimeout=").append(userActivityTimeout); |
| 1900 | } |
Alan Viverette | ccb11e1 | 2014-07-08 16:04:02 -0700 | [diff] [blame^] | 1901 | if (!shadowInsets.equals(Insets.NONE)) { |
| 1902 | sb.append(" shadowInsets=").append(shadowInsets); |
| 1903 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1904 | sb.append('}'); |
| 1905 | return sb.toString(); |
| 1906 | } |
Mitsuru Oshima | 8d11267 | 2009-04-27 12:01:23 -0700 | [diff] [blame] | 1907 | |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 1908 | /** |
| 1909 | * Scale the layout params' coordinates and size. |
Mitsuru Oshima | 64f5934 | 2009-06-21 00:03:11 -0700 | [diff] [blame] | 1910 | * @hide |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 1911 | */ |
Mitsuru Oshima | 64f5934 | 2009-06-21 00:03:11 -0700 | [diff] [blame] | 1912 | public void scale(float scale) { |
Mitsuru Oshima | 61324e5 | 2009-07-21 15:40:36 -0700 | [diff] [blame] | 1913 | x = (int) (x * scale + 0.5f); |
| 1914 | y = (int) (y * scale + 0.5f); |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 1915 | if (width > 0) { |
Mitsuru Oshima | 61324e5 | 2009-07-21 15:40:36 -0700 | [diff] [blame] | 1916 | width = (int) (width * scale + 0.5f); |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 1917 | } |
| 1918 | if (height > 0) { |
Mitsuru Oshima | 61324e5 | 2009-07-21 15:40:36 -0700 | [diff] [blame] | 1919 | height = (int) (height * scale + 0.5f); |
Mitsuru Oshima | 8d11267 | 2009-04-27 12:01:23 -0700 | [diff] [blame] | 1920 | } |
| 1921 | } |
| 1922 | |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 1923 | /** |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 1924 | * Backup the layout parameters used in compatibility mode. |
| 1925 | * @see LayoutParams#restore() |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 1926 | */ |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 1927 | void backup() { |
| 1928 | int[] backup = mCompatibilityParamsBackup; |
| 1929 | if (backup == null) { |
Mitsuru Oshima | 64f5934 | 2009-06-21 00:03:11 -0700 | [diff] [blame] | 1930 | // we backup 4 elements, x, y, width, height |
| 1931 | backup = mCompatibilityParamsBackup = new int[4]; |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 1932 | } |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 1933 | backup[0] = x; |
| 1934 | backup[1] = y; |
| 1935 | backup[2] = width; |
| 1936 | backup[3] = height; |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 1937 | } |
| 1938 | |
| 1939 | /** |
| 1940 | * Restore the layout params' coordinates, size and gravity |
| 1941 | * @see LayoutParams#backup() |
| 1942 | */ |
| 1943 | void restore() { |
| 1944 | int[] backup = mCompatibilityParamsBackup; |
| 1945 | if (backup != null) { |
| 1946 | x = backup[0]; |
| 1947 | y = backup[1]; |
| 1948 | width = backup[2]; |
Mitsuru Oshima | 3d91492 | 2009-05-13 22:29:15 -0700 | [diff] [blame] | 1949 | height = backup[3]; |
| 1950 | } |
| 1951 | } |
| 1952 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1953 | private CharSequence mTitle = ""; |
| 1954 | } |
| 1955 | } |