/// <summary>Create from an existing xml block native object.</summary> /// <remarks> /// Create from an existing xml block native object. This is /// -extremely- dangerous -- only use it if you absolutely know what you /// are doing! The given native object must exist for the entire lifetime /// of this newly creating XmlBlock. /// </remarks> internal XmlBlock(android.content.res.AssetManager assets, android.content.res.XmlBlock.NativeXmlBlock xmlBlock) { mAssets = assets; mNative = xmlBlock; mStrings = new android.content.res.StringBlock(nativeGetStringBlock(xmlBlock), false ); }
private static void ensureSystemAssets() { lock (sSync) { if (sSystem == null) { android.content.res.AssetManager system = new android.content.res.AssetManager(true ); system.makeStringBlocks(false); sSystem = system; } } }
private Resources() { mAssets = android.content.res.AssetManager.getSystem(); // NOTE: Intentionally leaving this uninitialized (all values set // to zero), so that anyone who tries to do something that requires // metrics will get a very wrong value. mConfiguration.setToDefaults(); mMetrics.setToDefaults(); updateConfiguration(null, null); mAssets.ensureStringBlocks(); mCompatibilityInfo = android.content.res.CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO; }
/// <summary>Creates a new Resources object with CompatibilityInfo.</summary> /// <remarks>Creates a new Resources object with CompatibilityInfo.</remarks> /// <param name="assets">Previously created AssetManager.</param> /// <param name="metrics"> /// Current display metrics to consider when /// selecting/computing resource values. /// </param> /// <param name="config"> /// Desired device configuration to consider when /// selecting/computing resource values (optional). /// </param> /// <param name="compInfo"> /// this resource's compatibility info. It will use the default compatibility /// info when it's null. /// </param> /// <hide></hide> public Resources(android.content.res.AssetManager assets, android.util.DisplayMetrics metrics, android.content.res.Configuration config, android.content.res.CompatibilityInfo compInfo) { mAssets = assets; mMetrics.setToDefaults(); mCompatibilityInfo = compInfo; updateConfiguration(config, metrics); assets.ensureStringBlocks(); }
private int loadNativeCode(string path, string funcname, android.os.MessageQueue queue, string internalDataPath, string obbPath, string externalDataPath, int sdkVersion , android.content.res.AssetManager assetMgr, byte[] savedState) { throw new System.NotImplementedException(); }
public static android.graphics.Typeface createFromAsset(android.content.res.AssetManager mgr, string path) { throw new System.NotImplementedException(); }
/// <summary>Creates the top level Resources for applications with the given compatibility info. /// </summary> /// <remarks>Creates the top level Resources for applications with the given compatibility info. /// </remarks> /// <param name="resDir">the resource directory.</param> /// <param name="compInfo"> /// the compability info. It will use the default compatibility info when it's /// null. /// </param> internal android.content.res.Resources getTopLevelResources(string resDir, android.content.res.CompatibilityInfo compInfo) { android.app.ActivityThread.ResourcesKey key = new android.app.ActivityThread.ResourcesKey (resDir, compInfo.applicationScale); android.content.res.Resources r; lock (mPackages) { // Resources is app scale dependent. if (false) { android.util.Slog.w(TAG, "getTopLevelResources: " + resDir + " / " + compInfo.applicationScale ); } [email protected]<android.content.res.Resources> wr = mActiveResources .get(key); r = wr != null ? wr.get() : null; //if (r != null) Slog.i(TAG, "isUpToDate " + resDir + ": " + r.getAssets().isUpToDate()); if (r != null && r.getAssets().isUpToDate()) { if (false) { android.util.Slog.w(TAG, "Returning cached resources " + r + " " + resDir + ": appScale=" + r.getCompatibilityInfo().applicationScale); } return r; } } //if (r != null) { // Slog.w(TAG, "Throwing away out-of-date resources!!!! " // + r + " " + resDir); //} android.content.res.AssetManager assets = new android.content.res.AssetManager(); if (assets.addAssetPath(resDir) == 0) { return null; } //Slog.i(TAG, "Resource: key=" + key + ", display metrics=" + metrics); android.util.DisplayMetrics metrics = getDisplayMetricsLocked(null, false); r = new android.content.res.Resources(assets, metrics, getConfiguration(), compInfo ); if (false) { android.util.Slog.i(TAG, "Created app resources " + resDir + " " + r + ": " + r.getConfiguration () + " appScale=" + r.getCompatibilityInfo().applicationScale); } lock (mPackages) { [email protected]<android.content.res.Resources> wr = mActiveResources .get(key); android.content.res.Resources existing = wr != null ? wr.get() : null; if (existing != null && existing.getAssets().isUpToDate()) { // Someone else already created the resources while we were // unlocked; go ahead and use theirs. r.getAssets().close(); return existing; } // XXX need to remove entries when weak references go away mActiveResources.put(key, new [email protected]<android.content.res.Resources >(r)); return r; } }
public static global::android.graphics.Typeface createFromAsset(android.content.res.AssetManager arg0, java.lang.String arg1) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; return(global::MonoJavaBridge.JavaBridge.WrapJavaObject(@__env.CallStaticObjectMethod(android.graphics.Typeface.staticClass, global::android.graphics.Typeface._createFromAsset3813, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1))) as android.graphics.Typeface); }