android_manifest/activity.rs
1use crate::VarOrBool;
2
3use super::attribute_list::{AttributeList, VerticalBar};
4use super::intent_filter::IntentFilter;
5use super::layout::Layout;
6use super::meta_data::MetaData;
7use super::resources::{
8 DrawableResource, MipmapOrDrawableResource, Resource, StringResourceOrString, StyleResource,
9};
10use super::ui_options::UiOptions;
11use serde::{Deserialize, Serialize};
12
13/// Declares an activity (an [`Activity`] subclass) that implements part of the
14/// application's visual user interface.
15///
16/// All activities must be represented by `<activity>` elements in the manifest file. Any
17/// that are not declared there will not be seen by the system and will never be run.
18///
19/// ## XML Syntax
20/// ```xml
21/// <activity android:allowEmbedded=["true" | "false"]
22/// android:allowTaskReparenting=["true" | "false"]
23/// android:alwaysRetainTaskState=["true" | "false"]
24/// android:autoRemoveFromRecents=["true" | "false"]
25/// android:banner="drawable resource"
26/// android:clearTaskOnLaunch=["true" | "false"]
27/// android:colorMode=["hdr" | "wideColorGamut"]
28/// android:configChanges=["mcc", "mnc", "locale",
29/// "touchscreen", "keyboard", "keyboardHidden",
30/// "navigation", "screenLayout", "fontScale",
31/// "uiMode", "orientation", "density",
32/// "screenSize", "smallestScreenSize"]
33/// android:directBootAware=["true" | "false"]
34/// android:documentLaunchMode=["intoExisting" | "always" |
35/// "none" | "never"]
36/// android:enabled=["true" | "false"]
37/// android:excludeFromRecents=["true" | "false"]
38/// android:exported=["true" | "false"]
39/// android:finishOnTaskLaunch=["true" | "false"]
40/// android:hardwareAccelerated=["true" | "false"]
41/// android:icon="drawable resource"
42/// android:immersive=["true" | "false"]
43/// android:label="string resource"
44/// android:launchMode=["standard" | "singleTop"|
45/// "singleTask" | "singleInstance"]
46/// android:lockTaskMode=["normal" | "never" |
47/// "if_whitelisted" | "always"]
48/// android:maxRecents="integer"
49/// android:maxAspectRatio="float"
50/// android:multiprocess=["true" | "false"]
51/// android:name="string"
52/// android:noHistory=["true" | "false"]
53/// android:parentActivityName="string"
54/// android:persistableMode=["persistRootOnly" |
55/// "persistAcrossReboots" | "persistNever"]
56/// android:permission="string"
57/// android:process="string"
58/// android:relinquishTaskIdentity=["true" | "false"]
59/// android:resizeableActivity=["true" | "false"]
60/// android:screenOrientation=["unspecified" | "behind" |
61/// "landscape" | "portrait" |
62/// "reverseLandscape" | "reversePortrait" |
63/// "sensorLandscape" | "sensorPortrait" |
64/// "userLandscape" | "userPortrait" |
65/// "sensor" | "fullSensor"|"nosensor" |
66/// "user" | "fullUser" | "locked"]
67/// android:showForAllUsers=["true" | "false"]
68/// android:stateNotNeeded=["true" | "false"]
69/// android:supportsPictureInPicture=["true" | "false"]
70/// android:taskAffinity="string"
71/// android:theme="resource or theme"
72/// android:uiOptions=["none" | "splitActionBarWhenNarrow"]
73/// android:windowSoftInputMode=["stateUnspecified",
74/// "stateUnchanged", "stateHidden",
75/// "stateAlwaysHidden", "stateVisible",
76/// "stateAlwaysVisible", "adjustUnspecified",
77/// "adjustResize", "adjustPan"]
78/// tools:replace="string"
79/// tools:remove="string"
80/// tools:node=["merge" | "replace" | "removeAll" | "merge-only" | "strict"]
81/// tools:ignore="string"
82/// tools:targetApi="string"
83/// tools:selector="string"
84/// tools:strict="string" >
85/// ...
86/// </activity>
87/// ```
88///
89/// ## Contained in
90/// * [`<application>`]
91///
92/// ## Can contain
93/// * [`<intent-filter>`]
94/// * [`<meta-data>`]
95/// * [`<layout>`]
96///
97/// ## Introduced in
98/// API Level 1 for all attributes except for [`noHistory`] and [`windowSoftInputMode`],
99/// which were added in API Level 3.
100///
101/// [`Activity`]: https://developer.android.com/reference/android/app/Activity
102/// [`<application>`]: crate::Application
103/// [`<intent-filter>`]: crate::IntentFilter
104/// [`<meta-data>`]: crate::MetaData
105/// [`<layout>`]: crate::Layout
106/// [`noHistory`]: crate::Activity#structfield.no_history
107/// [`windowSoftInputMode`]: crate::Activity#structfield.window_soft_input_mode
108#[derive(Debug, Deserialize, Serialize, YaSerialize, YaDeserialize, PartialEq, Default, Clone)]
109pub struct Activity {
110 /// Indicate that the activity can be launched as the embedded child of another
111 /// activity. Particularly in the case where the child lives in a container such
112 /// as a Display owned by another activity. For example, activities that are used
113 /// for Wear custom notifications must declare this so Wear can display the
114 /// activity in it's context stream, which resides in another process. The default
115 /// value of this attribute is "`false`".
116 #[yaserde(attribute = true, prefix = "android", rename = "allowEmbedded")]
117 pub allow_embedded: Option<VarOrBool>,
118 /// Whether or not the activity can move from the task that started it to the task it
119 /// has an affinity for when that task is next brought to the front — "`true`" if
120 /// it can move, and "`false`" if it must remain with the task where it started.
121 ///
122 /// If this attribute is not set, the value set by the corresponding
123 /// [`allowTaskReparenting`] attribute of the [`<application>`] element
124 /// applies to the activity. The default value is "`false`".
125 ///
126 /// Normally when an activity is started, it's associated with the task of the
127 /// activity that started it and it stays there for its entire lifetime. You can use
128 /// this attribute to force it to be re-parented to the task it has an affinity for
129 /// when its current task is no longer displayed. Typically, it's used to cause the
130 /// activities of an application to move to the main task associated with that
131 /// application.
132 ///
133 /// For example, if an e-mail message contains a link to a web page, clicking the link
134 /// brings up an activity that can display the page. That activity is defined by the
135 /// browser application, but is launched as part of the e-mail task. If it's
136 /// reparented to the browser task, it will be shown when the browser next comes to
137 /// the front, and will be absent when the e-mail task again comes forward.
138 ///
139 /// The affinity of an activity is defined by the [`taskAffinity`] attribute. The
140 /// affinity of a task is determined by reading the affinity of its root activity.
141 /// Therefore, by definition, a root activity is always in a task with the same
142 /// affinity. Since activities with "`singleTask`" or "`singleInstance`" launch
143 /// modes can only be at the root of a task, re-parenting is limited to the
144 /// "`standard`" and "`singleTop`" modes. (See also the [`launchMode`] attribute.)
145 ///
146 /// [`allowTaskReparenting`]: crate::Application#structfield.allow_task_reparenting
147 /// [`<application>`]: crate::Application
148 /// [`taskAffinity`]: crate::Activity#structfield.task_affinity
149 /// [`launchMode`]: crate::Activity#structfield.launch_mode
150 #[yaserde(attribute = true, prefix = "android", rename = "allowTaskReparenting")]
151 pub allow_task_reparenting: Option<VarOrBool>,
152 /// Whether or not the state of the task that the activity is in will always be
153 /// maintained by the system — "`true`" if it will be, and "`false`" if the system
154 /// is allowed to reset the task to its initial state in certain situations. The
155 /// default value is "`false`". This attribute is meaningful only for the root
156 /// activity of a task; it's ignored for all other activities.
157 ///
158 /// Normally, the system clears a task (removes all activities from the stack above
159 /// the root activity) in certain situations when the user re-selects that task
160 /// from the home screen. Typically, this is done if the user hasn't visited the
161 /// task for a certain amount of time, such as 30 minutes.
162 ///
163 /// However, when this attribute is "`true`", users will always return to the task in
164 /// its last state, regardless of how they get there. This is useful, for example, in
165 /// an application like the web browser where there is a lot of state (such as
166 /// multiple open tabs) that users would not like to lose.
167 #[yaserde(attribute = true, prefix = "android", rename = "alwaysRetainTaskState")]
168 pub always_retain_task_state: Option<VarOrBool>,
169 /// Whether or not tasks launched by activities with this attribute remains in the
170 /// [`overview screen`] until the last activity in the task is completed. If true, the
171 /// task is automatically removed from the `overview screen.` This overrides the
172 /// caller's use of [`FLAG_ACTIVITY_RETAIN_IN_RECENTS`]. It must be a boolean value,
173 /// either "`true`" or "`false`".
174 ///
175 /// [`overview screen`]: https://developer.android.com/guide/components/activities/recents
176 /// [`FLAG_ACTIVITY_RETAIN_IN_RECENTS`]: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_RETAIN_IN_RECENTS
177 #[yaserde(attribute = true, prefix = "android", rename = "autoRemoveFromRecents")]
178 pub auto_remove_from_recents: Option<VarOrBool>,
179 /// A [`drawable resource`] providing an extended graphical banner for its associated
180 /// item. Use with the `<activity>` tag to supply a default banner for a specific
181 /// activity, or with the [`<application>`] tag to supply a banner for all
182 /// application activities.
183 ///
184 /// The system uses the banner to represent an app in the Android TV home screen.
185 /// Since the banner is displayed only in the home screen, it should only be
186 /// specified by applications with an activity that handles the
187 /// [`CATEGORY_LEANBACK_LAUNCHER`] intent.
188 ///
189 /// This attribute must be set as a reference to a drawable resource containing the
190 /// image (for example "`@drawable/banner`"). There is no default banner.
191 ///
192 /// See [`Provide a home screen banner`] in Get Started with TV Apps for more
193 /// information.
194 ///
195 /// [`drawable resource`]: https://developer.android.com/guide/topics/resources/drawable-resource
196 /// [`<application>`]: crate::Application
197 /// [`CATEGORY_LEANBACK_LAUNCHER`]: https://developer.android.com/reference/android/content/Intent#CATEGORY_LEANBACK_LAUNCHER
198 /// [`Provide a home screen banner`]: https://developer.android.com/training/tv/start/start#banner
199 #[yaserde(attribute = true, prefix = "android")]
200 pub banner: Option<Resource<DrawableResource>>,
201 /// Whether or not all activities will be removed from the task, except for the root
202 /// activity, whenever it is re-launched from the home screen — "`true`" if the
203 /// task is always stripped down to its root activity, and "`false`" if not. The
204 /// default value is "`false`". This attribute is meaningful only for activities
205 /// that start a new task (the root activity); it's ignored for all other
206 /// activities in the task.
207 ///
208 /// When the value is "`true`", every time users start the task again, they are
209 /// brought to its root activity regardless of what they were last doing in the
210 /// task and regardless of whether they used the Back or Home button to leave it.
211 /// When the value is "`false`", the task may be cleared of activities in some
212 /// situations (see the [`alwaysRetainTaskState`] attribute), but not always.
213 ///
214 /// Suppose, for example, that someone launches activity P from the home screen, and
215 /// from there goes to activity Q. The user next presses Home, and then returns to
216 /// activity P. Normally, the user would see activity Q, since that is what they were
217 /// last doing in P's task. However, if P set this flag to "`true`", all of the
218 /// activities on top of it (Q in this case) would be removed when the user launched
219 /// activity P from the home screen. So the user would see only P when returning to
220 /// the task.
221 ///
222 /// If this attribute and [`allowTaskReparenting`] are both "`true`", any activities
223 /// that can be re-parented are moved to the task they share an affinity with; the
224 /// remaining activities are then dropped, as described above.
225 ///
226 /// This attribute is ignored if [`FLAG_ACTIVITY_RESET_TASK_IF_NEEDED`] is not set.
227 ///
228 /// [`alwaysRetainTaskState`]: crate::Activity#structfield.always_retain_task_state
229 /// [`allowTaskReparenting`]: crate::Activity#structfield.allow_task_reparenting
230 /// [`FLAG_ACTIVITY_RESET_TASK_IF_NEEDED`]: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
231 #[yaserde(attribute = true, prefix = "android", rename = "clearTaskOnLaunch")]
232 pub clear_task_on_launch: Option<VarOrBool>,
233 /// Requests the activity to be displayed in wide color gamut mode on compatible
234 /// devices. In wide color gamut mode, a window can render outside of the [`SRGB`]
235 /// gamut to display more vibrant colors. If the device doesn't support wide color
236 /// gamut rendering, this attribute has no effect. For more information about
237 /// rendering in wide color mode, see [`Enhancing Graphics with Wide Color Content`].
238 ///
239 /// [`Enhancing Graphics with Wide Color Content`]: https://developer.android.com/training/wide-color-gamut
240 /// [`SRGB`]: https://developer.android.com/reference/android/graphics/ColorSpace.Named#SRGB
241 #[yaserde(attribute = true, prefix = "android", rename = "colorMode")]
242 pub color_mode: Option<ColorMode>,
243 /// Lists configuration changes that the activity will handle itself. When a
244 /// configuration change occurs at runtime, the activity is shut down and
245 /// restarted by default, but declaring a configuration with this
246 /// attribute will prevent the activity from being restarted. Instead, the
247 /// activity remains running and its [`onConfigurationChanged()`] method is
248 /// called.
249 ///
250 /// Any or all of the following strings are valid values for this attribute. Multiple
251 /// values are separated by '`|`' — for example: "`locale|navigation|orientation`".
252 ///
253 /// ## Note
254 /// Using this attribute should be avoided and used only as a last resort. Please read
255 /// [`Handling Runtime Changes`] for more information about how to properly handle a
256 /// restart due to a configuration change.
257 ///
258 /// [`Handling Runtime Changes`]: https://developer.android.com/guide/topics/resources/runtime-changes
259 /// [`onConfigurationChanged()`]: https://developer.android.com/reference/android/app/Activity#onConfigurationChanged(android.content.res.Configuration)
260 #[yaserde(
261 attribute = true,
262 prefix = "android",
263 rename = "configChanges",
264 skip_serializing_if = "check_config_changes",
265 default = "default_config_changes"
266 )]
267 #[serde(default, skip_serializing_if = "AttributeList::is_empty")]
268 pub config_changes: AttributeList<VerticalBar, ConfigChanges>,
269 /// Whether or not the activity is direct-boot aware; that is, whether or not it can
270 /// run before the user unlocks the device.
271 ///
272 /// The default value is "`false`".
273 ///
274 /// ## Note
275 /// During [`Direct Boot`], an activity in your application can only access the data
276 /// that is stored in device protected storage.
277 ///
278 /// [`Direct Boot`]: https://developer.android.com/training/articles/direct-boot
279 #[yaserde(attribute = true, prefix = "android", rename = "directBootAware")]
280 pub direct_boot_aware: Option<VarOrBool>,
281 /// Specifies how a new instance of an activity should be added to a task
282 /// each time it is launched. This attribute permits the user to have
283 /// multiple documents from the same application appear in the [`overview
284 /// screen`].
285 ///
286 /// ## Note
287 /// For values other than "`none`" and "`never`" the activity must be defined with
288 /// `launchMode`="`standard`". If this attribute is not specified,
289 /// `documentLaunchMode`="`none`" is used.
290 ///
291 /// [`overview screen`]: https://developer.android.com/guide/components/activities/recents
292 #[yaserde(attribute = true, prefix = "android", rename = "documentLaunchMode")]
293 pub document_launch_mode: Option<DocumentLaunchMode>,
294 /// Whether or not the activity can be instantiated by the system — "`true`" if it can
295 /// be, and "`false`" if not.
296 ///
297 /// The default value is "`true`".
298 ///
299 /// The [`<application>`] element has its own [`enabled`] attribute that applies to
300 /// all application components, including activities. The [`<application>`] and
301 /// `<activity>` attributes must both be "`true`" (as they both are by default)
302 /// for the system to be able to instantiate the activity. If either is "`false`",
303 /// it cannot be instantiated.
304 ///
305 /// [`<application>`]: crate::Application
306 /// [`enabled`]: crate::Application#structfield.enabled
307 #[yaserde(attribute = true, prefix = "android")]
308 pub enabled: Option<VarOrBool>,
309 /// Whether or not the task initiated by this activity should be excluded
310 /// from the list of recently used applications, the [`overview screen`].
311 /// That is, when this activity is the root activity of a new task, this
312 /// attribute determines whether the task should not appear in the list of
313 /// recent apps. Set "`true`" if the task should be excluded from the
314 /// list; set "`false`" if it should be included.
315 ///
316 /// The default value is "`false`".
317 ///
318 /// [`overview screen`]: https://developer.android.com/guide/components/activities/recents
319 #[yaserde(attribute = true, prefix = "android", rename = "excludeFromRecents")]
320 pub exclude_from_recents: Option<VarOrBool>,
321 /// This element sets whether the activity can be launched by components of other
322 /// applications — "`true`" if it can be, and "`false`" if not. If "`false`", the
323 /// activity can be launched only by components of the same application or
324 /// applications with the same user ID.
325 ///
326 /// If you are using intent filters, you should not set this element "`false`". If you
327 /// do so, and an app tries to call the activity, system throws an
328 /// [`ActivityNotFoundException`]. Instead, you should prevent other apps
329 /// from calling the activity by not setting intent filters for it.
330 ///
331 /// If you do not have intent filters, the default value for this element is
332 /// "false". If you set the element "true", the activity is accessible to
333 /// any app that knows its exact class name, but does not resolve when
334 /// the system tries to match an implicit intent.
335 ///
336 /// This attribute is not the only way to limit an activity's exposure to other
337 /// applications. You can also use a permission to limit the external entities
338 /// that can invoke the activity (see the [`permission`] attribute).
339 ///
340 /// [`ActivityNotFoundException`]: https://developer.android.com/reference/android/content/ActivityNotFoundException
341 /// [`permission`]: crate::Activity#structfield.permission
342 #[yaserde(attribute = true, prefix = "android")]
343 pub exported: Option<VarOrBool>,
344 /// Whether or not an existing instance of the activity should be shut down (finished)
345 /// whenever the user again launches its task (chooses the task on the home
346 /// screen) — "`true`" if it should be shut down, and "`false`" if not.
347 ///
348 /// The default value is "`false`".
349 ///
350 /// If this attribute and [`allowTaskReparenting`] are both "`true`", this attribute
351 /// trumps the other. The affinity of the activity is ignored. The activity is not
352 /// re-parented, but destroyed.
353 ///
354 /// [`allowTaskReparenting`]: https://developer.android.com/guide/topics/manifest/activity-element#reparent
355 #[yaserde(attribute = true, prefix = "android", rename = "finishOnTaskLaunch")]
356 pub finish_on_task_launch: Option<VarOrBool>,
357 /// Whether or not hardware-accelerated rendering should be enabled for this Activity
358 /// — "`true`" if it should be enabled, and "`false`" if not.
359 ///
360 /// The default value is "`false`".
361 ///
362 /// Starting from Android 3.0, a hardware-accelerated OpenGL renderer is available to
363 /// applications, to improve performance for many common 2D graphics operations.
364 /// When the hardware-accelerated renderer is enabled, most operations in Canvas,
365 /// Paint, Xfermode, ColorFilter, Shader, and Camera are accelerated.This results in
366 /// smoother animations, smoother scrolling, and improved responsiveness overall, even
367 /// for applications that do not explicitly make use the framework's OpenGL libraries.
368 /// Because of the increased resources required to enable hardware acceleration, your
369 /// app will consume more RAM.
370 ///
371 /// Note that not all of the OpenGL 2D operations are accelerated. If you enable the
372 /// hardware-accelerated renderer, test your application to ensure that it can
373 /// make use of the renderer without errors.
374 #[yaserde(attribute = true, prefix = "android", rename = "hardwareAccelerated")]
375 pub hardware_accelerated: Option<VarOrBool>,
376 /// An icon representing the activity. The icon is displayed to users when a
377 /// representation of the activity is required on-screen. For example,
378 /// icons for activities that initiate tasks are displayed in the launcher
379 /// window. The icon is often accompanied by a label (see the
380 /// [`android:label`] attribute).
381 ///
382 /// This attribute must be set as a reference to a drawable resource containing the
383 /// image definition. If it is not set, the icon specified for the application as
384 /// a whole is used instead (see the [`<application>`] element's
385 /// [`icon`](crate::Application#structfield.icon) attribute).
386 ///
387 /// The activity's icon — whether set here or by the [`<application>`] element — is
388 /// also the default icon for all the activity's intent filters (see the
389 /// [`<intent-filter>`] element's [`icon`](crate::IntentFilter#structfield.icon)
390 /// attribute).
391 ///
392 /// [`android:label`]: crate::Activity#structfield.label
393 /// [`<application>`]: crate::Application
394 /// [`<intent-filter>`]: crate::IntentFilter
395 #[yaserde(attribute = true, prefix = "android")]
396 pub icon: Option<MipmapOrDrawableResource>,
397 /// Sets the immersive mode setting for the current activity. If the
398 /// `android:immersive` attribute is set to true in the app's manifest entry
399 /// for this activity, the [`ActivityInfo.flags`] member always has its
400 /// [`FLAG_IMMERSIVE`] bit set, even if the immersive mode is changed at
401 /// runtime using the [`setImmersive()`] method.
402 ///
403 /// [`ActivityInfo.flags`]: https://developer.android.com/reference/android/content/pm/ActivityInfo#flags
404 /// [`FLAG_IMMERSIVE`]: https://developer.android.com/reference/android/content/pm/ActivityInfo#FLAG_IMMERSIVE
405 /// [`setImmersive()`]: https://developer.android.com/reference/android/app/Activity#setImmersive(boolean)
406 #[yaserde(attribute = true, prefix = "android")]
407 pub immersive: Option<VarOrBool>,
408 /// A user-readable label for the activity. The label is displayed on-screen when the
409 /// activity must be represented to the user. It's often displayed along with the
410 /// activity icon. If this attribute is not set, the label set for the application
411 /// as a whole is used instead (see the [`<application>`] element's
412 /// [`label`](crate::Application#structfield.label) attribute).
413 ///
414 /// The activity's label — whether set here or by the [`<application>`] element — is
415 /// also the default label for all the activity's intent filters (see the
416 /// [`<intent-filter>`] element's [`label`](crate::IntentFilter#structfield.label)
417 /// attribute).
418 ///
419 /// The label should be set as a reference to a string resource, so that it can be
420 /// localized like other strings in the user interface. However, as a convenience
421 /// while you're developing the application, it can also be set as a raw string.
422 ///
423 /// [`<application>`]: crate::Application
424 /// [`<intent-filter>`]: crate::IntentFilter
425 #[yaserde(attribute = true, prefix = "android")]
426 pub label: Option<StringResourceOrString>,
427 /// An instruction on how the activity should be launched. There are four modes that
428 /// work in conjunction with activity flags (`FLAG_ACTIVITY_*` constants) in
429 /// [`Intent`] objects to determine what should happen when the activity is called
430 /// upon to handle an intent.
431 ///
432 /// The default mode is `"standard"`.
433 ///
434 /// [`Intent`]: https://developer.android.com/reference/android/content/Intent
435 #[yaserde(attribute = true, prefix = "android", rename = "launchMode")]
436 pub launch_mode: Option<LaunchMode>,
437 /// Determines how the system presents this activity when the device is running in
438 /// [`lock task mode`].
439 ///
440 /// Android can run tasks in an immersive, kiosk-like fashion called lock task mode.
441 /// When the system runs in lock task mode, device users typically can’t see
442 /// notifications, access non-allowlisted apps, or return to the home screen
443 /// (unless the Home app is allowlisted). Only apps that have been allowlisted by
444 /// a device policy controller (DPC) can run when the system is in lock task mode.
445 /// System and [`privileged apps`], however, can run in lock task mode without
446 /// being allowlisted.
447 ///
448 /// This attribute was introduced in API Level 23.
449 ///
450 /// [`lock task mode`]: https://developer.android.com/work/dpc/dedicated-devices/lock-task-mode
451 /// [`privileged apps`]: https://source.android.com/devices/tech/config/perms-allowlist
452 #[yaserde(attribute = true, prefix = "android", rename = "lockTaskMode")]
453 pub lock_task_mode: Option<LockTaskMode>,
454 /// The maximum number of tasks rooted at this activity in the [`overview screen`].
455 /// When this number of entries is reached, the system removes the least-recently
456 /// used instance from the overview screen. Valid values are 1 through 50 (25 on
457 /// low memory devices); zero is invalid. This must be an integer value, such as
458 /// 50.
459 ///
460 /// The default value is 16.
461 ///
462 /// [`overview screen`]: https://developer.android.com/guide/components/activities/recents
463 #[yaserde(attribute = true, prefix = "android", rename = "maxRecents")]
464 pub max_recents: Option<u32>,
465 /// The maximum aspect ratio the activity supports. If the app runs on a device with a
466 /// wider aspect ratio, the system automatically letterboxes the app, leaving
467 /// portions of the screen unused so the app can run at its specified maximum
468 /// aspect ratio. Maximum aspect ratio is expressed as the decimal form of the
469 /// quotient of the device's longer dimension divided by its shorter dimension.
470 /// For example, if the maximum aspect ratio is 7:3, set the value of this
471 /// attribute to 2.33. On non-wearable devices, the value of this attribute needs
472 /// to be 1.33 or greater. On wearable devices, it must be 1.0 or greater.
473 /// Otherwise, the system ignores the set value.
474 ///
475 /// ## Note
476 /// This attribute is ignored if the activity has [`resizeableActivity`] set to true,
477 /// since that means your activity supports any size.
478 ///
479 /// For more information about this attribute, see [`Supporting Multiple Screens`].
480 ///
481 /// [`Supporting Multiple Screens`]: https://developer.android.com/guide/practices/screens_support
482 /// [`resizeableActivity`]: crate::Activity#structfield.resizeable_activity
483 #[yaserde(attribute = true, prefix = "android", rename = "maxAspectRatio")]
484 pub max_aspect_ratio: Option<f32>,
485 /// Whether an instance of the activity can be launched into the process of the
486 /// component that started it — "`true`" if it can be, and "`false`" if not.
487 ///
488 /// The default value is "`false`".
489 ///
490 /// Normally, a new instance of an activity is launched into the process of the
491 /// application that defined it, so all instances of the activity run in the same
492 /// process. However, if this flag is set to "`true`", instances of the activity
493 /// can run in multiple processes, allowing the system to create instances
494 /// wherever they are used (provided permissions allow it), something that is
495 /// almost never necessary or desirable.
496 #[yaserde(attribute = true, prefix = "android")]
497 pub multiprocess: Option<VarOrBool>,
498 /// The name of the class that implements the activity, a subclass of [`Activity`].
499 /// The attribute value should be a fully qualified class name (such as, "`com.
500 /// example.project.ExtracurricularActivity`"). However, as a shorthand, if the
501 /// first character of the name is a period (for example, "`.
502 /// ExtracurricularActivity`"), it is appended to the package name specified in
503 /// the [`<manifest>`] element.
504 ///
505 /// Once you publish your application, you [`should not change this name`] (unless
506 /// you've set [`android:exported`]="`false`").
507 ///
508 /// There is no default. The name must be specified.
509 ///
510 /// [`Activity`]: https://developer.android.com/reference/android/app/Activity
511 /// [`<manifest>`]: crate::AndroidManifest
512 /// [`should not change this name`]: https://android-developers.googleblog.com/2011/06/things-that-cannot-change.html
513 /// [`android:exported`]: crate::Activity#structfield.exported
514 #[yaserde(attribute = true, prefix = "android")]
515 pub name: String,
516 /// Whether or not the activity should be removed from the activity stack and finished
517 /// (its [`finish()`] method called) when the user navigates away from it and it's
518 /// no longer visible on screen — "`true`" if it should be finished, and "`false`"
519 /// if not.
520 ///
521 /// The default value is "`false`".
522 ///
523 /// A value of "`true`" means that the activity will not leave a historical
524 /// trace. It will not remain in the activity stack for the task, so the
525 /// user will not be able to return to it. In this case,
526 /// [`onActivityResult()`] is never called if you start another activity for a
527 /// result from this activity.
528 ///
529 /// This attribute was introduced in API Level 3.
530 ///
531 /// [`finish()`]: https://developer.android.com/reference/android/app/Activity#finish()
532 /// [`onActivityResult()`]: https://developer.android.com/reference/android/app/Activity#onActivityResult(int,%20int,%20android.content.Intent)
533 #[yaserde(attribute = true, prefix = "android", rename = "noHistory")]
534 pub no_history: Option<VarOrBool>,
535 /// The class name of the logical parent of the activity. The name here must match the
536 /// class name given to the corresponding `<activity>` element's [`android:name`]
537 /// attribute.
538 ///
539 /// The system reads this attribute to determine which activity should be started when
540 /// the user presses the Up button in the action bar. The system can also use this
541 /// information to synthesize a back stack of activities with
542 /// [`TaskStackBuilder`].
543 ///
544 /// To support API levels 4 - 16, you can also declare the parent activity
545 /// with a `<meta-data>` element that specifies a value for
546 /// `"android.support.PARENT_ACTIVITY"`.
547 ///
548 /// For more information about declaring the parent activity to support Up navigation,
549 /// read [`Providing Up Navigation`].
550 ///
551 /// This attribute was introduced in API Level 16.
552 ///
553 /// ## XML Examples
554 /// To support API levels 4 - 16:
555 /// ```xml
556 /// <activity android:name="com.example.app.ChildActivity"
557 /// android:label="@string/title_child_activity"
558 /// android:parentActivityName="com.example.app.MainActivity" >
559 /// <!-- Parent activity meta-data to support API level 4+ -->
560 /// <meta-data android:name="android.support.PARENT_ACTIVITY"
561 /// android:value="com.example.app.MainActivity" />
562 /// </activity>
563 /// ```
564 ///
565 /// [`android:name`]: crate::Activity#structfield.name
566 /// [`TaskStackBuilder`]: https://developer.android.com/reference/android/app/TaskStackBuilder
567 /// [`Providing Up Navigation`]: https://developer.android.com/guide/navigation
568 #[yaserde(attribute = true, prefix = "android", rename = "parentActivityName")]
569 pub parent_activity_name: Option<String>,
570 /// Defines how an instance of an activity is preserved within a containing task
571 /// across device restarts.
572 ///
573 /// If the root activity of a task sets this attribute's value to `persistRootOnly`,
574 /// then only the root activity is preserved. Otherwise, the activities that are
575 /// higher up the task's [`back stack`] are examined; any of these activities that
576 /// set this attribute's value to `persistAcrossReboots` are preserved.
577 ///
578 /// This attribute was introduced in API level 21.
579 ///
580 /// [`back stack`]: https://developer.android.com/guide/components/activities/tasks-and-back-stack
581 #[yaserde(attribute = true, prefix = "android", rename = "persistableMode")]
582 pub persistable_mode: Option<PersistableMode>,
583 /// The name of a permission that clients must have to launch the activity or
584 /// otherwise get it to respond to an intent. If a caller of [`startActivity()`]
585 /// or [`startActivityForResult()`] has not been granted the specified permission,
586 /// its intent will not be delivered to the activity.
587 ///
588 /// If this attribute is not set, the permission set by the [`<application>`]
589 /// element's [`permission`] attribute applies to the activity. If neither
590 /// attribute is set, the activity is not protected by a permission.
591 ///
592 /// For more information on permissions, see the [`Permissions`] section in the
593 /// introduction and another document, [`Security and Permissions`].
594 ///
595 /// [`startActivity()`]: https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent)
596 /// [`startActivityForResult()`]: https://developer.android.com/reference/android/app/Activity#startActivityForResult(android.content.Intent,%20int)
597 /// [`<application>`]: crate::Application
598 /// [`permission`]: crate::Application#structfield.permission
599 /// [`Permissions`]: https://developer.android.com/guide/topics/manifest/manifest-intro#perms
600 /// [`Security and Permissions`]: https://developer.android.com/training/articles/security-tips
601 #[yaserde(attribute = true, prefix = "android")]
602 pub permission: Option<String>,
603 /// The name of the process in which the activity should run. Normally, all components
604 /// of an application run in a default process name created for the application
605 /// and you do not need to use this attribute. But if necessary, you can override
606 /// the default process name with this attribute, allowing you to spread your app
607 /// components across multiple processes.
608 ///
609 /// If the name assigned to this attribute begins with a colon (':'), a new process,
610 /// private to the application, is created when it's needed and the activity runs
611 /// in that process. If the process name begins with a lowercase character, the
612 /// activity will run in a global process of that name, provided that it has
613 /// permission to do so. This allows components in different applications to share
614 /// a process, reducing resource usage.
615 ///
616 /// The [`<application>`] element's [`process`] attribute can set a different default
617 /// process name for all components.
618 ///
619 /// [`<application>`]: crate::Application
620 /// [`process`]: crate::Application#structfield.process
621 #[yaserde(attribute = true, prefix = "android")]
622 pub process: Option<String>,
623 /// Whether or not the activity relinquishes its task identifiers to an activity above
624 /// it in the task stack. A task whose root activity has this attribute set to
625 /// "`true`" replaces the base Intent with that of the next activity in the task.
626 /// If the next activity also has this attribute set to "`true`" then it will
627 /// yield the base Intent to any activity that it launches in the same task. This
628 /// continues for each activity until an activity is encountered which has this
629 /// attribute set to "`false`".
630 ///
631 /// The default value is "`false`".
632 ///
633 /// This attribute set to "`true`" also permits the activity's use of the
634 /// [`ActivityManager.TaskDescription`] to change labels, colors and icons in the
635 /// [`overview screen`].
636 ///
637 /// [`ActivityManager.TaskDescription`]: https://developer.android.com/reference/android/app/ActivityManager.TaskDescription
638 /// [`overview screen`]: https://developer.android.com/guide/components/activities/recents
639 #[yaserde(
640 attribute = true,
641 prefix = "android",
642 rename = "relinquishTaskIdentity"
643 )]
644 pub relinquish_task_identity: Option<VarOrBool>,
645 /// Specifies whether the app supports [`multi-window display`]. You can set
646 /// this attribute in either the `<activity>` or [`<application>`] element.
647 ///
648 /// If you set this attribute to true, the user can launch the activity in
649 /// split-screen and freeform modes. If you set the attribute to false, the
650 /// activity does not support multi-window mode. If this value is false,
651 /// and the user attempts to launch the activity in multi-window mode, the
652 /// activity takes over the full screen.
653 ///
654 /// If your app targets API level 24 or higher, but you do not specify a value for
655 /// this attribute, the attribute's value defaults to true.
656 ///
657 /// This attribute was added in API level 24.
658 ///
659 /// ## Note
660 /// A task's root activity value is applied to all additional activities launched
661 /// in the task. That is, if the root activity of a task is resizable then the system
662 /// treats all other activities in the task as resizable. If the root activity is not
663 /// resizable, the other activities in the task are not resizable.
664 ///
665 /// [`multi-window display`]: https://developer.android.com/guide/topics/ui/multi-window
666 /// [`<application>`]: crate::Application
667 #[yaserde(attribute = true, prefix = "android", rename = "resizeableActivity")]
668 pub resizeable_activity: Option<VarOrBool>,
669 /// The orientation of the activity's display on the device. The system ignores this
670 /// attribute if the activity is running in [`multi-window mode`].
671 ///
672 /// ## Note
673 /// When you declare one of the landscape or portrait values, it is considered a hard
674 /// requirement for the orientation in which the activity runs. As such, the value
675 /// you declare enables filtering by services such as Google Play so your
676 /// application is available only to devices that support the orientation required
677 /// by your activities. For example, if you declare either `"landscape"`,
678 /// `"reverseLandscape"`, or `"sensorLandscape"`, then your application will be
679 /// available only to devices that support landscape orientation. However, you
680 /// should also explicitly declare that your application requires either portrait
681 /// or landscape orientation with the [`<uses-feature>`] element.
682 ///
683 /// ```xml
684 /// <uses-feature android:name="android.hardware.screen.portrait"/>.
685 /// ```
686 ///
687 /// This is purely a filtering behavior provided by Google Play (and other services
688 /// that support it) and the platform itself does not control whether your app can
689 /// be installed when a device supports only certain orientations.
690 ///
691 /// [`multi-window mode`]: https://developer.android.com/guide/topics/ui/multi-window
692 /// [`<uses-feature>`]: crate::UsesFeature
693 #[yaserde(attribute = true, prefix = "android", rename = "screenOrientation")]
694 pub screen_orientation: Option<ScreenOrientation>,
695 /// Whether or not the activity is shown when the device's current user is
696 /// different than the user who launched the activity. You can set this
697 /// attribute to a literal value — "`true`" or "`false`" — or you can set the
698 /// attribute to a resource or theme attribute that contains a boolean
699 /// value.
700 ///
701 /// This attribute was added in API level 23.
702 #[yaserde(attribute = true, prefix = "android", rename = "showForAllUsers")]
703 pub show_for_all_users: Option<VarOrBool>,
704 /// Whether or not the activity can be killed and successfully restarted without
705 /// having saved its state — "`true`" if it can be restarted without reference to
706 /// its previous state, and "`false`" if its previous state is required. The
707 /// default value is "`false`".
708 ///
709 /// Normally, before an activity is temporarily shut down to save resources, its
710 /// [`onSaveInstanceState()`] method is called. This method stores the current
711 /// state of the activity in a [`Bundle`] object, which is then passed to
712 /// [`onCreate()`] when the activity is restarted. If this attribute is set to
713 /// "`true`", `onSaveInstanceState()` may not be called and `onCreate()`
714 /// will be passed null instead of the Bundle — just as it was when the
715 /// activity started for the first time.
716 ///
717 /// A "`true`" setting ensures that the activity can be restarted in the absence of
718 /// retained state. For example, the activity that displays the home screen uses
719 /// this setting to make sure that it does not get removed if it crashes for some
720 /// reason.
721 ///
722 /// [`onSaveInstanceState()`]: https://developer.android.com/reference/android/app/Activity#onSaveInstanceState(android.os.Bundle)
723 /// [`Bundle`]: https://developer.android.com/reference/android/os/Bundle
724 /// [`onCreate()`]: https://developer.android.com/reference/android/app/Activity#onCreate(android.os.Bundle)
725 #[yaserde(attribute = true, prefix = "android", rename = "stateNotNeeded")]
726 pub state_not_needed: Option<VarOrBool>,
727 /// Specifies whether the activity supports [`Picture-in-Picture`] display.
728 ///
729 /// This attribute was added in API level 24.
730 ///
731 /// [`Picture-in-Picture`]: https://developer.android.com/guide/topics/ui/picture-in-picture
732 #[yaserde(
733 attribute = true,
734 prefix = "android",
735 rename = "supportsPictureInPicture"
736 )]
737 pub supports_picture_in_picture: Option<VarOrBool>,
738 /// The task that the activity has an affinity for. Activities with the same affinity
739 /// conceptually belong to the same task (to the same `"application"` from the
740 /// user's perspective). The affinity of a task is determined by the affinity of
741 /// its root activity.
742 ///
743 /// The affinity determines two things — the task that the activity is re-parented to
744 /// (see the [`allowTaskReparenting`] attribute) and the task that will house
745 /// the activity when it is launched with the [`FLAG_ACTIVITY_NEW_TASK`] flag.
746 ///
747 /// By default, all activities in an application have the same affinity. You can set
748 /// this attribute to group them differently, and even place activities defined in
749 /// different applications within the same task. To specify that the activity does
750 /// not have an affinity for any task, set it to an empty string.
751 ///
752 /// If this attribute is not set, the activity inherits the affinity set for the
753 /// application (see the [`<application>`] element's [`taskAffinity`] attribute). The
754 /// name of the default affinity for an application is the package name set by the
755 /// [`<manifest>`] element.
756 ///
757 /// [`allowTaskReparenting`]: crate::Activity#structfield.allow_task_reparenting
758 /// [`FLAG_ACTIVITY_NEW_TASK`]: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_TASK
759 /// [`<application>`]: crate::Application
760 /// [`taskAffinity`]: crate::Application#structfield.task_affinity
761 /// [`<manifest>`]: crate::AndroidManifest
762 #[yaserde(attribute = true, prefix = "android", rename = "taskAffinity")]
763 pub task_affinity: Option<String>,
764 /// A reference to a style resource defining an overall theme for the activity. This
765 /// automatically sets the activity's context to use this theme (see
766 /// [`setTheme()`] and may also cause "starting" animations prior to the
767 /// activity being launched (to better match what the activity actually looks
768 /// like).
769 ///
770 /// If this attribute is not set, the activity inherits the theme set for the
771 /// application as a whole — from the [`<application>`] element's [`theme`]
772 /// attribute. If that attribute is also not set, the default system theme is
773 /// used.
774 ///
775 /// For more information, see the [`Styles and Themes`] developer guide.
776 ///
777 /// [`setTheme()`]: https://developer.android.com/reference/android/content/Context#setTheme(int)
778 /// [`<application>`]: crate::Application
779 /// [`theme`]: crate::Application#structfield.theme
780 /// [`Styles and Themes`]: https://developer.android.com/guide/topics/ui/look-and-feel/themes
781 #[yaserde(attribute = true, prefix = "android")]
782 pub theme: Option<Resource<StyleResource>>,
783 /// Extra options for an activity's UI.
784 ///
785 /// For more information about the app bar, see the [`Adding the App Bar`] training
786 /// class.
787 ///
788 /// This attribute was added in API level 14.
789 ///
790 /// [`Adding the App Bar`]: https://developer.android.com/training/appbar
791 #[yaserde(attribute = true, prefix = "android", rename = "uiOptions")]
792 pub ui_options: Option<UiOptions>,
793 /// How the main window of the activity interacts with the window containing the
794 /// on-screen soft keyboard. The setting for this attribute affects two things:
795 ///
796 /// * The state of the soft keyboard — whether it is hidden or visible — when the
797 /// activity becomes the focus of user attention.
798 /// * The adjustment made to the activity's main window — whether it is resized
799 /// smaller to make room for the soft keyboard or whether its contents pan to make
800 /// the current focus visible when part of the window is covered by the soft
801 /// keyboard.
802 ///
803 /// The setting must be one of the values listed in the following table, or a
804 /// combination of one "`state...`" value plus one "`adjust...`" value.
805 /// Setting multiple values in either group — multiple "`state...`" values,
806 /// for example — has undefined results. Individual values are separated
807 /// by a vertical bar (`|`).
808 ///
809 /// ## XML Examples
810 /// ```xml
811 /// <activity android:windowSoftInputMode="stateVisible|adjustResize" ... >
812 /// ```
813 ///
814 /// Values set here (other than "`stateUnspecified`" and "`adjustUnspecified`")
815 /// override values set in the theme.
816 #[yaserde(
817 attribute = true,
818 prefix = "android",
819 rename = "windowSoftInputMode",
820 skip_serializing_if = "check_window_soft_input_mode",
821 default = "default_window_soft_input_mode"
822 )]
823 #[serde(default, skip_serializing_if = "AttributeList::is_empty")]
824 pub window_soft_input_mode: AttributeList<VerticalBar, WindowSoftInputMode>,
825 /// A `<layout>` tag.
826 pub layout: Option<Layout>,
827 /// List of `<intent-filter>` tags.
828 #[yaserde(rename = "intent-filter")]
829 #[serde(default, skip_serializing_if = "Vec::is_empty")]
830 pub intent_filter: Vec<IntentFilter>,
831 /// List of `<meta-data>` tags.
832 #[yaserde(rename = "meta-data")]
833 #[serde(default, skip_serializing_if = "Vec::is_empty")]
834 pub meta_data: Vec<MetaData>,
835 /// Specifies which attributes from lower priority manifest files should be replaced
836 /// by attributes from this manifest. This is a comma-separated list of attribute
837 /// names.
838 ///
839 /// For example: `tools:replace="android:theme,android:exported"`
840 ///
841 /// Reference: [Merge manifest files - tools:replace](https://developer.android.com/studio/build/manage-manifests#merge-manifests)
842 #[yaserde(attribute = true, prefix = "tools")]
843 pub replace: Option<String>,
844 /// Specifies which attributes or child elements from lower priority manifest files
845 /// should be removed entirely.
846 ///
847 /// For example: `tools:remove="android:configChanges"`
848 ///
849 /// Reference: [Merge manifest files - tools:remove](https://developer.android.com/studio/build/manage-manifests#merge-manifests)
850 #[yaserde(attribute = true, prefix = "tools")]
851 pub remove: Option<String>,
852 /// Specifies the merge strategy for this element. Can be "merge", "replace",
853 /// "removeAll", "merge-only", or "strict".
854 ///
855 /// For example: `tools:node="replace"`
856 ///
857 /// Reference: [Merge manifest files - tools:node](https://developer.android.com/studio/build/manage-manifests#merge-manifests)
858 #[yaserde(attribute = true, prefix = "tools")]
859 pub node: Option<String>,
860 /// This attribute accepts a comma-separated list of lint issue IDs that you'd like
861 /// the tools to ignore on this element or any of its descendants.
862 ///
863 /// For example: `tools:ignore="UnusedAttribute"`
864 ///
865 /// Reference: [Tools Attributes - tools:ignore](https://developer.android.com/studio/write/tool-attributes#tools-ignore)
866 #[yaserde(attribute = true, prefix = "tools")]
867 pub ignore: Option<String>,
868 /// This attribute works the same as the @TargetApi annotation in Java code. It lets
869 /// you specify the API level (either as an integer or as a code name) that supports
870 /// this element.
871 ///
872 /// For example: `tools:targetApi="14"`
873 ///
874 /// Reference: [Tools Attributes - tools:targetApi](https://developer.android.com/studio/write/tool-attributes#toolstargetapi)
875 #[yaserde(attribute = true, prefix = "tools", rename = "targetApi")]
876 pub target_api: Option<String>,
877 /// Specifies library package names to apply the merge rule to.
878 ///
879 /// For example: `tools:selector="com.example.lib1"`
880 ///
881 /// Reference: [Merge manifest files - tools:selector](https://developer.android.com/studio/build/manage-manifests#marker_selector)
882 #[yaserde(attribute = true, prefix = "tools")]
883 pub selector: Option<String>,
884 /// Generate a build failure if attributes don't exactly match.
885 ///
886 /// For example: `tools:strict="android:screenOrientation"`
887 ///
888 /// Reference: [Merge manifest files - tools:strict](https://developer.android.com/studio/build/manage-manifests#attribute_markers)
889 #[yaserde(attribute = true, prefix = "tools")]
890 pub strict: Option<String>,
891}
892
893fn default_config_changes() -> AttributeList<VerticalBar, ConfigChanges> {
894 AttributeList::default()
895}
896
897fn default_window_soft_input_mode() -> AttributeList<VerticalBar, WindowSoftInputMode> {
898 AttributeList::default()
899}
900
901impl Activity {
902 fn check_config_changes(&self, value: &AttributeList<VerticalBar, ConfigChanges>) -> bool {
903 value.is_empty()
904 }
905
906 fn check_window_soft_input_mode(
907 &self,
908 value: &AttributeList<VerticalBar, WindowSoftInputMode>,
909 ) -> bool {
910 value.is_empty()
911 }
912}
913
914/// Requests the activity to be displayed in wide color gamut mode on compatible
915/// devices.
916#[derive(Debug, Deserialize, Serialize, YaSerialize, YaDeserialize, PartialEq, Eq, Clone)]
917#[serde(rename_all = "camelCase")]
918#[derive(Default)]
919pub enum ColorMode {
920 /// Indicating that the activity should use a high dynamic range if the presentation
921 /// display supports it.
922 #[yaserde(rename = "hdr")]
923 #[default]
924 Hdr,
925 /// Indicating that the activity should use a wide color gamut if the presentation
926 /// display supports it. To render wide color gamut content, your app must load a
927 /// wide color bitmap, that is a bitmap with a color profile containing a color
928 /// space wider than sRGB.
929 #[yaserde(rename = "wideColorGamut")]
930 WideColorGamut,
931}
932
933/// Lists configuration changes that the `activity` will handle itself.
934#[derive(Debug, Deserialize, Serialize, YaSerialize, YaDeserialize, PartialEq, Eq, Clone)]
935#[serde(rename_all = "camelCase")]
936#[derive(Default)]
937pub enum ConfigChanges {
938 /// The display density has changed — the user might have specified a different
939 /// display scale, or a different display might now be active. Added in API level
940 /// 24.
941 #[yaserde(rename = "density")]
942 #[default]
943 Density,
944 /// The font scaling factor has changed — the user has selected a new global font
945 /// size.
946 #[yaserde(rename = "fontScale")]
947 FontScale,
948 /// The keyboard type has changed — for example, the user has plugged in an external
949 /// keyboard.
950 #[yaserde(rename = "keyboard")]
951 Keyboard,
952 /// The keyboard accessibility has changed — for example, the user hasrevealed the
953 /// hardware keyboard.
954 #[yaserde(rename = "keyboardHidden")]
955 KeyboardHidden,
956 /// The layout direction has changed — for example, changing from left-to-right (LTR)
957 /// to right-to-left (RTL). Added in API level 17.
958 #[yaserde(rename = "layoutDirection")]
959 LayoutDirection,
960 /// The locale has changed — the user has selected a new language that text should be
961 /// displayed in.
962 #[yaserde(rename = "locale")]
963 Locale,
964 /// The IMSI mobile country code (MCC) has changed — a SIM has been detected and
965 /// updated the MCC.
966 #[yaserde(rename = "mcc")]
967 Mcc,
968 /// The IMSI mobile network code (MNC) has changed — a SIM has been detected and
969 /// updated the MNC.
970 #[yaserde(rename = "mnc")]
971 Mnc,
972 /// The navigation type (trackball/dpad) has changed. (This should never
973 /// normally happen.)
974 #[yaserde(rename = "navigation")]
975 Navigation,
976 /// The screen orientation has changed — the user has rotated the device.
977 ///
978 /// ## Note
979 /// If your application targets Android 3.2 (API level 13) or higher, then you should
980 /// also declare the "`screenSize`" and "`screenLayout`" configurations, because
981 /// they might also change when a device switches between portrait and landscape
982 /// orientations.
983 #[yaserde(rename = "orientation")]
984 Orientation,
985 /// The screen layout has changed — a different display might now be active.
986 #[yaserde(rename = "screenLayout")]
987 ScreenLayout,
988 /// The current available screen size has changed. This represents a change in the
989 /// currently available size, relative to the current aspect ratio, so will change
990 /// when the user switches between landscape and portrait. Added in API level 13.
991 #[yaserde(rename = "screenSize")]
992 ScreenSize,
993 /// The physical screen size has changed. This represents a change in size regardless
994 /// of orientation, so will only change when the actual physical screen size has
995 /// changed such as switching to an external display. A change to this
996 /// configuration corresponds to a change in the [`smallestWidth configuration`].
997 /// Added in API level 13
998 ///
999 /// [`smallestWidth configuration`]: https://developer.android.com/guide/topics/resources/providing-resources#SmallestScreenWidthQualifier
1000 #[yaserde(rename = "smallestScreenSize")]
1001 SmallestScreenSize,
1002 /// The touchscreen has changed. (This should never normally happen.)
1003 #[yaserde(rename = "touchscreen")]
1004 Touchscreen,
1005 /// The user interface mode has changed — the user has placed the device into a desk
1006 /// or car dock, or the night mode has changed. For more information about the
1007 /// different UI modes, see [`UiModeManager`]. Added in API level 8.
1008 ///
1009 /// [`UiModeManager`]: https://developer.android.com/reference/android/app/UiModeManager
1010 #[yaserde(rename = "uiMode")]
1011 UiMode,
1012}
1013
1014/// Four values which produce the following effects when the user opens a document with
1015/// the application
1016#[derive(Debug, Deserialize, Serialize, YaSerialize, YaDeserialize, PartialEq, Eq, Clone)]
1017#[serde(rename_all = "camelCase")]
1018#[derive(Default)]
1019pub enum DocumentLaunchMode {
1020 /// The system searches for a task whose base intent's `ComponentName` and data URI
1021 /// match those of the launching intent. If the system finds such a task, the
1022 /// system clears the task, and restarts with the root activity receiving a call
1023 /// to [`onNewIntent(android.content.Intent)`]. If the system does not find such a
1024 /// task, the system creates a new task.
1025 ///
1026 /// [`onNewIntent(android.content.Intent)`]: https://developer.android.com/reference/android/app/Activity#onNewIntent(android.content.Intent)
1027 #[yaserde(rename = "intoExisting")]
1028 IntoExisting,
1029 /// The activity creates a new task for the document, even if the document is already
1030 /// opened. This is the same as setting both the [`FLAG_ACTIVITY_NEW_DOCUMENT`]
1031 /// and [`FLAG_ACTIVITY_MULTIPLE_TASK`] flags.
1032 ///
1033 /// [`FLAG_ACTIVITY_NEW_DOCUMENT`]: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_DOCUMENT
1034 /// [`FLAG_ACTIVITY_MULTIPLE_TASK`]: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_MULTIPLE_TASK
1035 #[yaserde(rename = "always")]
1036 Always,
1037 /// The activity does not create a new task for the activity. This is the default
1038 /// value, which creates a new task only when [`FLAG_ACTIVITY_NEW_TASK`]
1039 /// is set. The overview screen treats the activity as it would by
1040 /// default: it displays a single task for the app, which resumes from
1041 /// whatever activity the user last invoked.
1042 ///
1043 /// [`FLAG_ACTIVITY_NEW_TASK`]: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_TASK
1044 #[yaserde(rename = "none")]
1045 #[default]
1046 None,
1047 /// This activity is not launched into a new document even if the Intent contains
1048 /// [`FLAG_ACTIVITY_NEW_DOCUMENT`]. Setting this overrides the behavior of the
1049 /// [`FLAG_ACTIVITY_NEW_DOCUMENT`] and [`FLAG_ACTIVITY_MULTIPLE_TASK`] flags, if
1050 /// either of these are set in the activity, and the overview screen displays a
1051 /// single task for the app, which resumes from whatever activity the user last
1052 /// invoked.
1053 ///
1054 /// [`FLAG_ACTIVITY_NEW_DOCUMENT`]: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_DOCUMENT
1055 /// [`FLAG_ACTIVITY_MULTIPLE_TASK`]: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_MULTIPLE_TASK
1056 #[yaserde(rename = "never")]
1057 Never,
1058}
1059
1060/// An instruction on how the activity should be launched.
1061///
1062/// As shown in the enum variant description, the modes fall into two main groups, with
1063/// `"standard"` and `"singleTop"`activities on one side, and "singleTask"
1064/// and "singleInstance" activities on the other. An activity with the
1065/// `"standard"` or "singleTop" launch mode can be instantiated multiple
1066/// times. The instances can belong to any task and can be located
1067/// anywhere in the activity stack. Typically, they're launched into the
1068/// task that called [`startActivity()`] (unless the Intent object contains a
1069/// [`FLAG_ACTIVITY_NEW_TASK`] instruction, in which case a different task is
1070/// chosen — see the [`taskAffinity`] attribute).
1071///
1072/// In contrast, `"singleTask"` and `"singleInstance"` activities can only begin a
1073/// task. They are always at the root of the activity stack. Moreover, the
1074/// device can hold only one instance of the activity at a time — only one
1075/// such task.
1076///
1077/// The `"standard"` and `"singleTop"` modes differ from each other in just one
1078/// respect: Every time there's a new intent for a `"standard"` activity, a new
1079/// instance of the class is created to respond to that intent. Each instance
1080/// handles a single intent. Similarly, a new instance of a `"singleTop"` activity
1081/// may also be created to handle a new intent. However, if the target task
1082/// already has an existing instance of the activity at the top of its stack, that
1083/// instance will receive the new intent (in an [`onNewIntent()`] call); a new
1084/// instance is not created. In other circumstances — for example, if an existing
1085/// instance of the `"singleTop"` activity is in the target task, but not at
1086/// the top of the stack, or if it's at the top of a stack, but not in
1087/// the target task — a new instance would be created and pushed on the
1088/// stack.
1089///
1090/// Similarly, if you [`navigate up`] to an activity on the current stack, the behavior is
1091/// determined by the parent activity's launch mode. If the parent activity has
1092/// launch mode `singleTop` (or the `up` intent contains [`FLAG_ACTIVITY_CLEAR_TOP`]),
1093/// the parent is brought to the top of the stack, and its state is preserved. The
1094/// navigation intent is received by the parent activity's [`onNewIntent()`] method.
1095/// If the parent activity has launch mode standard (and the up intent does not
1096/// contain [`FLAG_ACTIVITY_CLEAR_TOP`]), the current activity and its parent
1097/// are both popped off the stack, and a new instance of the parent activity
1098/// is created to receive the navigation intent.
1099///
1100/// The "singleTask" and "singleInstance" modes also differ from each other in only
1101/// one respect: A "singleTask" activity allows other activities to be part of its
1102/// task. It's always at the root of its task, but other activities (necessarily
1103/// "standard" and "singleTop" activities) can be launched into that task. A
1104/// "singleInstance" activity, on the other hand, permits no other activities to be
1105/// part of its task. It's the only activity in the task. If it starts another
1106/// activity, that activity is assigned to a different task — as if
1107/// FLAG_ACTIVITY_NEW_TASK was in the intent.
1108///
1109/// As shown in the enum variant description, `standard` is the default mode and is
1110/// appropriate for most types of activities. `SingleTop` is also a common and useful
1111/// launch mode for many types of activities. The other modes — `singleTask` and
1112/// `singleInstance` — are `not appropriate for most applications`, since they result in
1113/// an interaction model that is likely to be unfamiliar to users and is very different
1114/// from most other applications.
1115///
1116/// Regardless of the launch mode that you choose, make sure to test the usability of the
1117/// activity during launch and when navigating back to it from other activities and tasks
1118/// using the Back button.
1119///
1120/// For more information on launch modes and their interaction with Intent flags, see the
1121/// [`Tasks and Back Stack`] document.
1122///
1123/// [`startActivity()`]: https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent)
1124/// [`FLAG_ACTIVITY_NEW_TASK`]: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_TASK
1125/// [`taskAffinity`]: crate::Activity#structfield.task_affinity
1126/// [`onNewIntent()`]: https://developer.android.com/reference/android/app/Activity#onNewIntent(android.content.Intent)
1127/// [`navigate up`]: https://developer.android.com/guide/navigation
1128/// [`FLAG_ACTIVITY_CLEAR_TOP`]: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_TOP
1129/// [`Tasks and Back Stack`]: https://developer.android.com/guide/components/activities/tasks-and-back-stack
1130#[derive(Debug, Deserialize, Serialize, YaSerialize, YaDeserialize, PartialEq, Eq, Clone)]
1131#[serde(rename_all = "camelCase")]
1132#[derive(Default)]
1133pub enum LaunchMode {
1134 /// Default. The system always creates a new instance of the activity in the target
1135 /// task and routes the intent to it.
1136 ///
1137 /// Use Cases: Normal launches for most activities
1138 ///
1139 /// Multiple Instances?: Yes
1140 #[yaserde(rename = "standard")]
1141 #[default]
1142 Standard,
1143 /// If an instance of the activity already exists at the top of the target task, the
1144 /// system routes the intent to that instance through a call to
1145 /// its [`onNewIntent()`] method, rather than creating a new instance of the
1146 /// activity.
1147 ///
1148 /// Use Cases: Normal launches for most activities
1149 ///
1150 /// Multiple Instances?: Conditionally
1151 ///
1152 /// [`onNewIntent()`]: https://developer.android.com/reference/android/app/Activity#onNewIntent(android.content.Intent)
1153 #[yaserde(rename = "singleTop")]
1154 SingleTop,
1155 /// The system creates the activity at the root of a new task and routes the intent to
1156 /// it. However, if an instance of the activity already exists, the system routes
1157 /// the intent to existing instance through a call to its [`onNewIntent()`]
1158 /// method, rather than creating a new one.
1159 ///
1160 /// Use Cases: Specialized launches (not recommended for general use)
1161 ///
1162 /// Multiple Instances?: No
1163 ///
1164 /// [`onNewIntent()`]: https://developer.android.com/reference/android/app/Activity#onNewIntent(android.content.Intent)
1165 #[yaserde(rename = "singleTask")]
1166 SingleTask,
1167 /// Same as "`singleTask`", except that the system doesn't launch any other activities
1168 /// into the task holding the instance. The activity is always the single and only
1169 /// member of its task.
1170 ///
1171 /// Use Cases: Specialized launches (not recommended for general use)
1172 ///
1173 /// Multiple Instances?: No
1174 #[yaserde(rename = "singleInstance")]
1175 SingleInstance,
1176}
1177
1178/// This value indicates how tasks rooted at this activity will behave in lockTask mode.
1179/// The value can be any one of the following [`R.attr.lockTaskMode`] string values:
1180///
1181/// [`R.attr.lockTaskMode`]: https://developer.android.com/reference/android/R.attr#lockTaskMode
1182#[derive(Debug, Deserialize, Serialize, YaSerialize, YaDeserialize, PartialEq, Eq, Clone)]
1183#[serde(rename_all = "camelCase")]
1184#[derive(Default)]
1185pub enum LockTaskMode {
1186 /// `Default value`. This is the default value. Tasks don't launch into lock task mode
1187 /// but can be placed there by calling [`startLockTask()`].
1188 ///
1189 /// [`startLockTask()`]: https://developer.android.com/reference/android/app/Activity#startLockTask()
1190 #[yaserde(rename = "normal")]
1191 #[default]
1192 Normal,
1193 /// Tasks don't launch into lockTask mode, and the device user can't pin these tasks
1194 /// from the overview screen.
1195 ///
1196 /// ## Note
1197 /// This mode is only available to system and privileged applications.
1198 /// Non-privileged apps with this value are treated as `normal`.
1199 #[yaserde(rename = "never")]
1200 Never,
1201 /// If the DPC authorizes this package using
1202 /// [`DevicePolicyManager.setLockTaskPackages()`], then this mode is identical to
1203 /// always, except that the activity needs to call [`stopLockTask()`] before being
1204 /// able to finish if it is the last locked task. If the DPC does not authorize
1205 /// this package then this mode is identical to normal.
1206 ///
1207 /// [`DevicePolicyManager.setLockTaskPackages()`]: https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setLockTaskPackages(android.content.ComponentName,%20java.lang.String[])
1208 /// [`stopLockTask()`]: https://developer.android.com/reference/android/app/Activity#stopLockTask()
1209 #[serde(rename = "if_whitelisted")]
1210 #[yaserde(rename = "if_whitelisted")]
1211 IfWhitelisted,
1212 /// Tasks rooted at this activity always launch into lock task mode. If the
1213 /// system is already in lock task mode when this task is launched then the
1214 /// new task are launched on top of the current task. Tasks launched in
1215 /// this mode can exit lock task mode by calling [`finish()`].
1216 ///
1217 /// ## Note
1218 /// This mode is only available to system and privileged
1219 /// applications. Non-privileged apps with this value are treated as `normal`.
1220 ///
1221 /// [`finish()`]: https://developer.android.com/reference/android/app/Activity#finish()
1222 #[yaserde(rename = "always")]
1223 Always,
1224}
1225
1226/// Defines how an instance of an activity is preserved within a containing task
1227/// across device restarts.
1228#[derive(Debug, Deserialize, Serialize, YaSerialize, YaDeserialize, PartialEq, Eq, Clone)]
1229#[serde(rename_all = "camelCase")]
1230#[derive(Default)]
1231pub enum PersistableMode {
1232 /// `Default value`. When the system restarts, the activity task is preserved, but
1233 /// only the root activity's launching intent is used.
1234 ///
1235 /// When your app's launching intent loads your app's root activity, the activity
1236 /// doesn't receive a [`PersistableBundle`] object. Therefore,
1237 /// don't use [`onSaveInstanceState()`] to preserve the state of your app's
1238 /// root activity across a device restart.
1239 ///
1240 /// ## Note
1241 /// This attribute value affects your app's behavior only if it's set on your app's
1242 /// root activity.
1243 ///
1244 /// [`PersistableBundle`]: https://developer.android.com/reference/android/os/PersistableBundle
1245 /// [`onSaveInstanceState()`]: https://developer.android.com/reference/android/app/Activity#onSaveInstanceState(android.os.Bundle,%20android.os.PersistableBundle)
1246 #[yaserde(rename = "persistRootOnly")]
1247 #[default]
1248 PersistRootOnly,
1249 /// This activity's state is preserved, along with the state of each activity higher
1250 /// up the [`back stack`] that has its own persistableMode attribute set to
1251 /// persistAcrossReboots. If an activity doesn't have a persistableMode attribute
1252 /// that is set to persistAcrossReboots, or if it's launched using the
1253 /// [`Intent.FLAG_ACTIVITY_NEW_DOCUMENT`] flag, then that activity, along with all
1254 /// activities higher up the back stack, aren't preserved.
1255 ///
1256 /// When an intent loads an activity whose persistableMode attribute is set to
1257 /// `persistAcrossReboots` in your app, the activity receives a
1258 /// [`PersistableBundle`] object in its [`onCreate()`] method. Therefore, you can
1259 /// use [`onSaveInstanceState()`] to preserve the state of an activity across a
1260 /// device restart as long as its persistableMode attribute is set to
1261 /// `persistAcrossReboots`.
1262 ///
1263 /// ## Note
1264 /// This attribute value affects your app's behavior even if it's
1265 /// set on an activity other than your app's root activity
1266 ///
1267 /// [`back stack`]: https://developer.android.com/guide/components/activities/tasks-and-back-stack
1268 /// [`Intent.FLAG_ACTIVITY_NEW_DOCUMENT`]: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_DOCUMENT
1269 /// [`PersistableBundle`]: https://developer.android.com/reference/android/os/PersistableBundle
1270 /// [`onCreate()`]: https://developer.android.com/reference/android/app/Activity#onCreate(android.os.Bundle,%20android.os.PersistableBundle)
1271 /// [`onSaveInstanceState()`]: https://developer.android.com/reference/android/app/Activity#onSaveInstanceState(android.os.Bundle,%20android.os.PersistableBundle)
1272 #[yaserde(rename = "persistAcrossReboots")]
1273 PersistAcrossReboots,
1274 /// The activity's state isn't preserved.
1275 ///
1276 /// ## Note
1277 /// This attribute value affects your app's behavior only if it's
1278 /// set on your app's root activity.
1279 #[yaserde(rename = "persistNever")]
1280 PersistNever,
1281}
1282
1283/// The orientation of the activity's display on the device.
1284#[derive(Debug, Deserialize, Serialize, YaSerialize, YaDeserialize, PartialEq, Eq, Clone)]
1285#[serde(rename_all = "camelCase")]
1286#[derive(Default)]
1287pub enum ScreenOrientation {
1288 /// `The default value`. The system chooses the orientation. The policy it uses, and
1289 /// therefore the choices made in specific contexts, may differ from device to
1290 /// device.
1291 #[yaserde(rename = "unspecified")]
1292 #[default]
1293 Unspecified,
1294 /// The same orientation as the activity that's immediately beneath it in the activity
1295 /// stack.
1296 #[yaserde(rename = "behind")]
1297 Behind,
1298 /// Landscape orientation (the display is wider than it is tall).
1299 #[yaserde(rename = "landscape")]
1300 Landscape,
1301 /// Portrait orientation (the display is taller than it is wide).
1302 #[yaserde(rename = "portrait")]
1303 Portrait,
1304 /// Landscape orientation in the opposite direction from normal landscape.
1305 ///
1306 /// Added in API level 9.
1307 #[yaserde(rename = "reverseLandscape")]
1308 ReverseLandscape,
1309 /// Portrait orientation in the opposite direction from normal portrait.
1310 ///
1311 /// Added in API level 9.
1312 #[yaserde(rename = "reversePortrait")]
1313 ReversePortrait,
1314 /// Landscape orientation, but can be either normal or reverse landscape based on the
1315 /// device sensor. The sensor is used even if the user has locked sensor-based
1316 /// rotation.
1317 ///
1318 /// Added in API level 9.
1319 #[yaserde(rename = "sensorLandscape")]
1320 SensorLandscape,
1321 /// Portrait orientation, but can be either normal or reverse portrait based on the
1322 /// device sensor. The sensor is used even if the user has locked sensor-based
1323 /// rotation.
1324 ///
1325 /// Added in API level 9.
1326 #[yaserde(rename = "sensorPortrait")]
1327 SensorPortrait,
1328 /// Landscape orientation, but can be either normal or reverse landscape based on the
1329 /// device sensor and the user's preference.
1330 ///
1331 /// Added in API level 18.
1332 #[yaserde(rename = "userLandscape")]
1333 UserLandscape,
1334 /// Portrait orientation, but can be either normal or reverse portrait based on the
1335 /// device sensor and the user's preference.
1336 ///
1337 /// Added in API level 18.
1338 #[yaserde(rename = "userPortrait")]
1339 UserPortrait,
1340 /// The orientation is determined by the device orientation sensor. The orientation of
1341 /// the display depends on how the user is holding the device; it changes when the
1342 /// user rotates the device. Some devices, though, will not rotate to all four
1343 /// possible orientations, by default. To allow all four orientations, use
1344 /// "`fullSensor`" The sensor is used even if the user locked sensor-based rotation.
1345 #[yaserde(rename = "sensor")]
1346 Sensor,
1347 /// The orientation is determined by the device orientation sensor for any of the 4
1348 /// orientations. This is similar to "`sensor`" except this allows any of the 4
1349 /// possible screen orientations, regardless of what the device will normally do
1350 /// (for example, some devices won't normally use reverse portrait or reverse
1351 /// landscape, but this enables those).
1352 ///
1353 /// Added in API level 9.
1354 #[yaserde(rename = "fullSensor")]
1355 FullSensor,
1356 /// The orientation is determined without reference to a physical orientation sensor.
1357 /// The sensor is ignored, so the display will not rotate based on how the user
1358 /// moves the device.
1359 #[yaserde(rename = "nosensor")]
1360 Nosensor,
1361 /// The user's current preferred orientation.
1362 #[yaserde(rename = "user")]
1363 User,
1364 /// If the user has locked sensor-based rotation, this behaves the same as user,
1365 /// otherwise it behaves the same as `fullSensor` and allows any of the 4 possible
1366 /// screen orientations.
1367 ///
1368 /// Added in API level 18.
1369 #[yaserde(rename = "fullUser")]
1370 FullUser,
1371 /// Locks the orientation to its current rotation, whatever that is.
1372 ///
1373 /// Added in API level 18.
1374 #[yaserde(rename = "locked")]
1375 Locked,
1376}
1377
1378/// How the main window of the activity interacts with the window containing the on-screen
1379/// soft keyboard.
1380#[derive(Debug, Deserialize, Serialize, YaSerialize, YaDeserialize, PartialEq, Eq, Clone)]
1381#[serde(rename_all = "camelCase")]
1382#[derive(Default)]
1383pub enum WindowSoftInputMode {
1384 /// The state of the soft keyboard (whether it is hidden or visible) is not
1385 /// specified. The system will choose an appropriate state or rely on the
1386 /// setting in the theme. This is the default setting for the behavior
1387 /// of the soft keyboard.
1388 #[yaserde(rename = "stateUnspecified")]
1389 #[default]
1390 StateUnspecified,
1391 /// The soft keyboard is kept in whatever state it was last in, whether
1392 /// visible or hidden, when the activity comes to the fore.
1393 #[yaserde(rename = "stateUnchanged")]
1394 StateUnchanged,
1395 /// The soft keyboard is hidden when the user chooses the activity — that
1396 /// is, when the user affirmatively navigates forward to the activity,
1397 /// rather than backs into it because of leaving another activity.
1398 #[yaserde(rename = "stateHidden")]
1399 StateHidden,
1400 /// The soft keyboard is always hidden when the activity's main window has
1401 /// input focus.
1402 #[yaserde(rename = "stateAlwaysHidden")]
1403 StateAlwaysHidden,
1404 /// The soft keyboard is made visible when the user chooses the activity —
1405 /// that is, when the user affirmatively navigates forward to the activity,
1406 /// rather than backs into it because of leaving another activity.
1407 #[yaserde(rename = "stateVisible")]
1408 StateVisible,
1409 /// The soft keyboard is visible when the window receives input focus.
1410 #[yaserde(rename = "stateAlwaysVisible")]
1411 StateAlwaysVisible,
1412 /// It is unspecified whether the activity's main window resizes to make
1413 /// room for the soft keyboard, or whether the contents of the window pan to
1414 /// make the current focus visible on-screen. The system will
1415 /// automatically select one of these modes depending on whether the content
1416 /// of the window has any layout views that can scroll their contents.
1417 /// If there is such a view, the window will be resized, on the assumption
1418 /// that scrolling can make all of the window's contents visible within a
1419 /// smaller area.
1420 ///
1421 /// This is the default setting for the behavior of the main window.
1422 #[yaserde(rename = "adjustUnspecified")]
1423 AdjustUnspecified,
1424 /// The activity's main window is always resized to make room for the soft
1425 /// keyboard on screen.
1426 #[yaserde(rename = "adjustResize")]
1427 AdjustResize,
1428 /// The activity's main window is not resized to make room for the soft
1429 /// keyboard. Rather, the contents of the window are automatically panned so
1430 /// that the current focus is never obscured by the keyboard and users can
1431 /// always see what they are typing. This is generally less desirable
1432 /// than resizing, because the user may need to close the soft keyboard to
1433 /// get at and interact with obscured parts of the window.
1434 #[yaserde(rename = "adjustPan")]
1435 AdjustPan,
1436}