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;
}
};
}
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;
}
};
}
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;
}
};
}
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;
}
};
}
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;
}
};
}
Aggregations