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