MockResources 类

定义

模拟 android.content.res.Resources 类。

[Android.Runtime.Register("android/test/mock/MockResources", DoNotGenerateAcw=true)]
public class MockResources : Android.Content.Res.Resources
[<Android.Runtime.Register("android/test/mock/MockResources", DoNotGenerateAcw=true)>]
type MockResources = class
    inherit Resources
继承
MockResources
属性

注解

模拟 android.content.res.Resources 类。 所有方法都是非功能性和引发 java.lang.UnsupportedOperationException方法。 重写它以提供所需的操作。

此成员已弃用。 使用 Mockito模拟框架。 应使用 Android 测试支持库编写新测试。

适用于 . 的 android.test.mock.MockResourcesJava 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

构造函数

MockResources()
MockResources(IntPtr, JniHandleOwnership)

创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。

字段

IdNull

null资源 ID。

(继承自 Resources)

属性

Assets

检索这些资源的基础 AssetManager 存储。

(继承自 Resources)
Class

返回此 Object的运行时类。

(继承自 Object)
Configuration

返回此资源对象生效的当前配置。

(继承自 Resources)
DisplayMetrics

返回此资源对象生效的当前显示指标。

(继承自 Resources)
Handle

基础 Android 实例的句柄。

(继承自 Object)
JniIdentityHashCode

模拟 android.content.res.Resources 类。

(继承自 Object)
JniPeerMembers

模拟 android.content.res.Resources 类。

PeerReference

模拟 android.content.res.Resources 类。

(继承自 Object)
ThresholdClass

此 API 支持 Mono for Android 基础结构,不打算直接从代码使用。

ThresholdType

此 API 支持 Mono for Android 基础结构,不打算直接从代码使用。

方法

AddLoaders(ResourcesLoader[])

将加载程序添加到加载程序列表中。

(继承自 Resources)
Clone()

创建并返回此对象的副本。

(继承自 Object)
Dispose()

模拟 android.content.res.Resources 类。

(继承自 Object)
Dispose(Boolean)

模拟 android.content.res.Resources 类。

(继承自 Object)
Equals(Object)

指示其他对象是否“等于”此对象。

(继承自 Object)
FinishPreloading()

完成预加载资源后,由 zygote 调用,以更改回正常资源操作。

(继承自 Resources)
FlushLayoutCache()

调用此项可从 Resources 对象中删除所有缓存的已加载布局资源。

(继承自 Resources)
GetAnimation(Int32)

返回一个 XmlResourceParser,通过该程序可以读取给定资源 ID 的动画说明。

(继承自 Resources)
GetBoolean(Int32)

返回与特定资源 ID 关联的布尔值。

(继承自 Resources)
GetColor(Int32)

返回与特定资源 ID 关联的颜色整数。

(继承自 Resources)
GetColor(Int32, Resources+Theme)

返回与特定资源 ID 关联的颜色整数。

(继承自 Resources)
GetColorStateList(Int32)

返回与特定资源 ID 关联的颜色状态列表。

(继承自 Resources)
GetColorStateList(Int32, Resources+Theme)

返回与特定资源 ID 关联的颜色状态列表。

(继承自 Resources)
GetDimension(Int32)

检索特定资源 ID 的维度。

(继承自 Resources)
GetDimensionPixelOffset(Int32)

检索用作原始像素偏移量的特定资源 ID 的维度。

(继承自 Resources)
GetDimensionPixelSize(Int32)

检索用作原始像素大小的特定资源 ID 的维度。

(继承自 Resources)
GetDrawable(Int32)

返回与特定资源 ID 关联的可绘制对象。

(继承自 Resources)
GetDrawable(Int32, Resources+Theme)

返回与特定资源 ID 关联的可绘制对象。

(继承自 Resources)
GetDrawableForDensity(Int32, Int32)

返回一个可绘制对象,该对象与给定屏幕密度(以 DPI 为单位)的特定资源 ID 相关联。

(继承自 Resources)
GetDrawableForDensity(Int32, Int32, Resources+Theme)

返回一个可绘制对象,该对象与给定屏幕密度(以 DPI 为单位)的特定资源 ID 相关联。

(继承自 Resources)
GetFloat(Int32)

检索特定资源 ID 的浮点值。

(继承自 Resources)
GetFont(Int32)

返回与特定资源 ID 关联的 Typeface 值。

(继承自 Resources)
GetFraction(Int32, Int32, Int32)

检索特定资源 ID 的小数部分单位。

(继承自 Resources)
GetHashCode()

返回对象的哈希代码值。

(继承自 Object)
GetIdentifier(String, String, String)

返回给定资源名称的资源标识符。

(继承自 Resources)
GetIntArray(Int32)

返回与特定资源 ID 关联的 int 数组。

(继承自 Resources)
GetInteger(Int32)

返回与特定资源 ID 关联的整数。

(继承自 Resources)
GetLayout(Int32)

返回一个 XmlResourceParser,通过它可以读取给定资源 ID 的视图布局说明。

(继承自 Resources)
GetMovie(Int32)

返回与特定资源 ID 关联的电影对象。

(继承自 Resources)
GetQuantityString(Int32, Int32)

返回给定数量语法正确复数给定资源 ID 所需的字符串。

(继承自 Resources)
GetQuantityString(Int32, Int32, Object[])

返回给定数量语法正确复数给定资源 ID 所需的字符串。

(继承自 Resources)
GetQuantityText(Int32, Int32)

返回给定数量语法正确复数给定资源 ID 所需的字符序列。

(继承自 Resources)
GetQuantityTextFormatted(Int32, Int32)

返回给定数量语法正确复数给定资源 ID 所需的字符序列。

(继承自 Resources)
GetResourceEntryName(Int32)

返回给定资源标识符的条目名称。

(继承自 Resources)
GetResourceName(Int32)

返回给定资源标识符的全名。

(继承自 Resources)
GetResourcePackageName(Int32)

返回给定资源标识符的包名称。

(继承自 Resources)
GetResourceTypeName(Int32)

返回给定资源标识符的类型名称。

(继承自 Resources)
GetString(Int32)

返回与特定资源 ID 关联的字符串值。

(继承自 Resources)
GetString(Int32, Object[])

模拟 android.content.res.Resources 类。

(继承自 Resources)
GetStringArray(Int32)

返回与特定资源 ID 关联的字符串数组。

(继承自 Resources)
GetText(Int32)

返回与特定资源 ID 关联的字符串值。

(继承自 Resources)
GetText(Int32, String)

返回与特定资源 ID 关联的字符串值。

(继承自 Resources)
GetTextArray(Int32)

返回与特定资源 ID 关联的样式文本数组。

(继承自 Resources)
GetTextArrayFormatted(Int32)

返回与特定资源 ID 关联的样式文本数组。

(继承自 Resources)
GetTextFormatted(Int32)

返回与特定资源 ID 关联的字符串值。

(继承自 Resources)
GetTextFormatted(Int32, ICharSequence)

返回与特定资源 ID 关联的字符串值。

(继承自 Resources)
GetValue(Int32, TypedValue, Boolean)

返回与特定资源 ID 关联的原始数据。

(继承自 Resources)
GetValue(String, TypedValue, Boolean)

返回与特定资源 ID 关联的原始数据。

(继承自 Resources)
GetValueForDensity(Int32, Int32, TypedValue, Boolean)

获取与具有关联密度的资源关联的原始值。

(继承自 Resources)
GetXml(Int32)

返回一个 XmlResourceParser,通过该程序可以读取给定资源 ID 的通用 XML 资源。

(继承自 Resources)
JavaFinalize()

当垃圾回收确定不再引用该对象时,由对象上的垃圾回收器调用。

(继承自 Object)
NewTheme()

为此一组资源生成新的 Theme 对象。

(继承自 Resources)
Notify()

唤醒正在等待此对象的监视器的单个线程。

(继承自 Object)
NotifyAll()

唤醒正在等待此对象的监视器的所有线程。

(继承自 Object)
ObtainAttributes(IAttributeSet, Int32[])

从 AttributeSet 中检索一组基本属性值,而不是使用主题和/或样式资源执行它们的样式设置。

(继承自 Resources)
ObtainTypedArray(Int32)

返回异类值的数组。

(继承自 Resources)
OpenRawResource(Int32)

打开用于读取原始资源的数据流。

(继承自 Resources)
OpenRawResource(Int32, TypedValue)

打开用于读取原始资源的数据流。

(继承自 Resources)
OpenRawResourceFd(Int32)

打开用于读取原始资源的文件描述符。

(继承自 Resources)
ParseBundleExtra(String, IAttributeSet, Bundle)

将名称/值对分析出保存该数据的 XML 标记。

(继承自 Resources)
ParseBundleExtras(XmlReader, Bundle)

分析 XML 文件中的 android.R.styleable#Extra &lt;extra&gt; 一系列标记。

(继承自 Resources)
RemoveLoaders(ResourcesLoader[])

从加载程序列表中删除加载程序。

(继承自 Resources)
SetHandle(IntPtr, JniHandleOwnership)

设置 Handle 属性。

(继承自 Object)
ToArray<T>()

模拟 android.content.res.Resources 类。

(继承自 Object)
ToString()

返回对象的字符串表示形式。

(继承自 Object)
UnregisterFromRuntime()

模拟 android.content.res.Resources 类。

(继承自 Object)
UpdateConfiguration(Configuration, DisplayMetrics)

存储新更新的配置。

(继承自 Resources)
Wait()

使当前线程等待,直到唤醒它,通常是通过 em 通知/em> 或 <em>interrupted</em>。<><

(继承自 Object)
Wait(Int64)

使当前线程等待直到唤醒,通常是通过 <em>通知</em> 或 <em interrupted</em>>,或直到经过一定数量的实时。

(继承自 Object)
Wait(Int64, Int32)

使当前线程等待直到唤醒,通常是通过 <em>通知</em> 或 <em interrupted</em>>,或直到经过一定数量的实时。

(继承自 Object)

显式接口实现

IJavaPeerable.Disposed()

模拟 android.content.res.Resources 类。

(继承自 Object)
IJavaPeerable.DisposeUnlessReferenced()

模拟 android.content.res.Resources 类。

(继承自 Object)
IJavaPeerable.Finalized()

模拟 android.content.res.Resources 类。

(继承自 Object)
IJavaPeerable.JniManagedPeerState

模拟 android.content.res.Resources 类。

(继承自 Object)
IJavaPeerable.SetJniIdentityHashCode(Int32)

模拟 android.content.res.Resources 类。

(继承自 Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates)

模拟 android.content.res.Resources 类。

(继承自 Object)
IJavaPeerable.SetPeerReference(JniObjectReference)

模拟 android.content.res.Resources 类。

(继承自 Object)

扩展方法

JavaCast<TResult>(IJavaObject)

执行 Android 运行时检查的类型转换。

JavaCast<TResult>(IJavaObject)

模拟 android.content.res.Resources 类。

GetJniTypeName(IJavaPeerable)

模拟 android.content.res.Resources 类。

适用于