using System;
// 指定该特性用于类,并且不可重复或被继承
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class ActivityAttribute : Attribute, IJniNameProviderAttribute
{
public ActivityAttribute();
// 是否允许该 Activity 在启动它的组件的进程中启动实例
public bool MultiProcess { get; set; }
// 当用户离开该 Activity 时,是否应该从任务栈中移除该 Activity 并将其完成
public bool NoHistory { get; set; }
// 父活动的类型,可用于指定该 Activity 的父类
public Type? ParentActivity { get; set; }
// 指定启动此 Activity 的客户端必须具备的权限
public string? Permission { get; set; }
// 指定该 Activity 的持久化模式
public ActivityPersistableMode PersistableMode { get; set; }
// 指定该 Activity 运行的进程名称
public string? Process { get; set; }
// 指定该 Activity 如何处理配置更改
public ConfigChanges RecreateOnConfigChanges { get; set; }
// 指定是否放弃任务身份
public bool RelinquishTaskIdentity { get; set; }
// 指定该 Activity 是否可调整大小
public bool ResizeableActivity { get; set; }
// 指定该 Activity 是否在用户暂停时恢复
public bool ResumeWhilePausing { get; set; }
// 指定活动的窗口旋转动画
public WindowRotationAnimation RotationAnimation { get; set; }
// 指定最近任务的最大数量
public int MaxRecents { get; set; }
// 指定该 Activity 的圆形图标
public string? RoundIcon { get; set; }
// 指定该 Activity 是否应该显示在锁屏上(已过时,建议使用 ShowForAllUsers)
[Obsolete("Please use ShowForAllUsers instead.")]
public bool ShowOnLockScreen { get; set; }
// 是否支持画中画模式
public bool SupportsPictureInPicture { get; set; }
// 指定活动在设备上的显示方向
public ScreenOrientation ScreenOrientation { get; set; }
// 指定当设备锁定时,Activity 是否可显示
public bool ShowWhenLocked { get; set; }
// 指定活动是否仅限于单用户
public bool SingleUser { get; set; }
// 指定该 Activity 是否能够在不保存状态的情况下被终止和重启
public bool StateNotNeeded { get; set; }
// 指定任务与该 Activity 的一致性
public string? TaskAffinity { get; set; }
// 定义 Activity 的整体主题的样式资源引用
public string? Theme { get; set; }
// 指定启动活动时是否打开屏幕
public bool TurnScreenOn { get; set; }
// 指定 UI 选项
public UiOptions UiOptions { get; set; }
// 指定该 Activity 是否对即时应用可见
public bool VisibleToInstantApps { get; set; }
// 指定所有用户是否都可显示该 Activity
public bool ShowForAllUsers { get; set; }
// 指定 Activity 窗口与屏幕上的软键盘窗口的交互方式
public SoftInput WindowSoftInputMode { get; set; }
// 指定最大宽高比
public float MaxAspectRatio { get; set; }
// 指定该 Activity 的布局方向(已过时)
[Obsolete("There is no //activity/@android:layoutDirection attribute. This was a mistake. Perhaps you wanted ConfigurationChanges=ConfigChanges.LayoutDirection?")]
public LayoutDirection LayoutDirection { get; set; }
// 指定实现该 Activity 的类名
public string? Name { get; set; }
// 指定是否允许嵌入该 Activity
public bool AllowEmbedded { get; set; }
// 指定该 Activity 是否可以从启动它的任务移动到其具有一致性的任务
public bool AllowTaskReparenting { get; set; }
// 指定活动所在的任务状态是否总是由系统保留
public bool AlwaysRetainTaskState { get; set; }
// 指定该 Activity 是否应自动从最近任务中移除
public bool AutoRemoveFromRecents { get; set; }
// 指定该 Activity 的横幅
public string? Banner { get; set; }
// 指定当从主屏幕重新启动时,除根 Activity 外,是否要移除所有 Activity
public bool ClearTaskOnLaunch { get; set; }
// 指定颜色模式的名称
public string? ColorMode { get; set; }
// 指定该 Activity 处理的配置更改
public ConfigChanges ConfigurationChanges { get; set; }
// 指定该 Activity 的描述
public string? Description { get; set; }
// 指定该 Activity 是否意识到直接启动
public bool DirectBootAware { get; set; }
// 指定该 Activity 是否应该是应用程序的主要启动器
public bool MainLauncher { get; set; }
// 指定文档启动模式
public DocumentLaunchMode DocumentLaunchMode { get; set; }
// 指定该 Activity 是否可由系统实例化
public bool Enabled { get; set; }
// 指定该 Activity 是否应排除在最近启动的活动列表之外
public bool ExcludeFromRecents { get; set; }
// 指定该 Activity 是否可由其他应用程序的组件启动
public bool Exported { get; set; }
// 指定是否在关闭系统对话框时结束该 Activity
public bool FinishOnCloseSystemDialogs { get; set; }
// 指定当用户再次启动其任务时,现有实例的 Activity 是否应该被关闭
public bool FinishOnTaskLaunch { get; set; }
// 指定该 Activity 是否启用硬件加速
public bool HardwareAccelerated { get; set; }
// 指定表示该 Activity 的图标
public string? Icon { get; set; }
// 指定该 Activity 的用户可读标签
public string? Label { get; set; }
// 指定该 Activity 应如何启动
public LaunchMode LaunchMode { get; set; }
// 指定锁任务模式
public string? LockTaskMode { get; set; }
// 指定该 Activity 的徽标
public string? Logo { get; set; }
// 指定是否启用 VR 模式
public string? EnableVrMode { get; set; }
// 指定该 Activity 是否为沉浸式模式
public bool Immersive { get; set; }
}