Search in sources :

Example 1 with ResourcesManager

use of android.app.ResourcesManager in project android_frameworks_base by ResurrectionRemix.

the class ResourcesManagerTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mDisplayMetrics = new DisplayMetrics();
    mDisplayMetrics.setToDefaults();
    // Override defaults (which take device specific properties).
    mDisplayMetrics.density = 1.0f;
    mDisplayMetrics.densityDpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.xdpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.ydpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.noncompatDensity = mDisplayMetrics.density;
    mDisplayMetrics.noncompatDensityDpi = mDisplayMetrics.densityDpi;
    mDisplayMetrics.noncompatXdpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.noncompatYdpi = DisplayMetrics.DENSITY_DEFAULT;
    mResourcesManager = new ResourcesManager() {

        @Override
        protected AssetManager createAssetManager(@NonNull ResourcesKey key) {
            return new AssetManager();
        }

        @Override
        protected DisplayMetrics getDisplayMetrics(int displayId, DisplayAdjustments daj) {
            return mDisplayMetrics;
        }
    };
}
Also used : ResourcesManager(android.app.ResourcesManager) DisplayAdjustments(android.view.DisplayAdjustments) DisplayMetrics(android.util.DisplayMetrics)

Example 2 with ResourcesManager

use of android.app.ResourcesManager in project android_frameworks_base by DirtyUnicorns.

the class ResourcesManagerTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mDisplayMetrics = new DisplayMetrics();
    mDisplayMetrics.setToDefaults();
    // Override defaults (which take device specific properties).
    mDisplayMetrics.density = 1.0f;
    mDisplayMetrics.densityDpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.xdpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.ydpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.noncompatDensity = mDisplayMetrics.density;
    mDisplayMetrics.noncompatDensityDpi = mDisplayMetrics.densityDpi;
    mDisplayMetrics.noncompatXdpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.noncompatYdpi = DisplayMetrics.DENSITY_DEFAULT;
    mResourcesManager = new ResourcesManager() {

        @Override
        protected AssetManager createAssetManager(@NonNull ResourcesKey key) {
            return new AssetManager();
        }

        @Override
        protected DisplayMetrics getDisplayMetrics(int displayId, DisplayAdjustments daj) {
            return mDisplayMetrics;
        }
    };
}
Also used : ResourcesManager(android.app.ResourcesManager) DisplayAdjustments(android.view.DisplayAdjustments) DisplayMetrics(android.util.DisplayMetrics)

Example 3 with ResourcesManager

use of android.app.ResourcesManager in project platform_frameworks_base by android.

the class ResourcesManagerTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mDisplayMetrics = new DisplayMetrics();
    mDisplayMetrics.setToDefaults();
    // Override defaults (which take device specific properties).
    mDisplayMetrics.density = 1.0f;
    mDisplayMetrics.densityDpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.xdpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.ydpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.noncompatDensity = mDisplayMetrics.density;
    mDisplayMetrics.noncompatDensityDpi = mDisplayMetrics.densityDpi;
    mDisplayMetrics.noncompatXdpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.noncompatYdpi = DisplayMetrics.DENSITY_DEFAULT;
    mResourcesManager = new ResourcesManager() {

        @Override
        protected AssetManager createAssetManager(@NonNull ResourcesKey key) {
            return new AssetManager();
        }

        @Override
        protected DisplayMetrics getDisplayMetrics(int displayId, DisplayAdjustments daj) {
            return mDisplayMetrics;
        }
    };
}
Also used : ResourcesManager(android.app.ResourcesManager) DisplayAdjustments(android.view.DisplayAdjustments) DisplayMetrics(android.util.DisplayMetrics)

Example 4 with ResourcesManager

use of android.app.ResourcesManager in project android_frameworks_base by AOSPA.

the class ResourcesManagerTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mDisplayMetrics = new DisplayMetrics();
    mDisplayMetrics.setToDefaults();
    // Override defaults (which take device specific properties).
    mDisplayMetrics.density = 1.0f;
    mDisplayMetrics.densityDpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.xdpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.ydpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.noncompatDensity = mDisplayMetrics.density;
    mDisplayMetrics.noncompatDensityDpi = mDisplayMetrics.densityDpi;
    mDisplayMetrics.noncompatXdpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.noncompatYdpi = DisplayMetrics.DENSITY_DEFAULT;
    mResourcesManager = new ResourcesManager() {

        @Override
        protected AssetManager createAssetManager(@NonNull ResourcesKey key) {
            return new AssetManager();
        }

        @Override
        protected DisplayMetrics getDisplayMetrics(int displayId, DisplayAdjustments daj) {
            return mDisplayMetrics;
        }
    };
}
Also used : ResourcesManager(android.app.ResourcesManager) DisplayAdjustments(android.view.DisplayAdjustments) DisplayMetrics(android.util.DisplayMetrics)

Example 5 with ResourcesManager

use of android.app.ResourcesManager in project android_frameworks_base by crdroidandroid.

the class ResourcesManagerTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mDisplayMetrics = new DisplayMetrics();
    mDisplayMetrics.setToDefaults();
    // Override defaults (which take device specific properties).
    mDisplayMetrics.density = 1.0f;
    mDisplayMetrics.densityDpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.xdpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.ydpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.noncompatDensity = mDisplayMetrics.density;
    mDisplayMetrics.noncompatDensityDpi = mDisplayMetrics.densityDpi;
    mDisplayMetrics.noncompatXdpi = DisplayMetrics.DENSITY_DEFAULT;
    mDisplayMetrics.noncompatYdpi = DisplayMetrics.DENSITY_DEFAULT;
    mResourcesManager = new ResourcesManager() {

        @Override
        protected AssetManager createAssetManager(@NonNull ResourcesKey key) {
            return new AssetManager();
        }

        @Override
        protected DisplayMetrics getDisplayMetrics(int displayId, DisplayAdjustments daj) {
            return mDisplayMetrics;
        }
    };
}
Also used : ResourcesManager(android.app.ResourcesManager) DisplayAdjustments(android.view.DisplayAdjustments) DisplayMetrics(android.util.DisplayMetrics)

Aggregations

ResourcesManager (android.app.ResourcesManager)5 DisplayMetrics (android.util.DisplayMetrics)5 DisplayAdjustments (android.view.DisplayAdjustments)5