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