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