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