use of com.android.systemui.recents.RecentsConfiguration in project android_frameworks_base by crdroidandroid.
the class TaskStackLayoutAlgorithm method getDimensionForDevice.
/**
* Retrieves resources that are constant regardless of the current configuration of the device.
*/
public static int getDimensionForDevice(Context ctx, int phonePortResId, int phoneLandResId, int tabletPortResId, int tabletLandResId, int xlargeTabletPortResId, int xlargeTabletLandResId, int gridLayoutResId) {
RecentsConfiguration config = Recents.getConfiguration();
Resources res = ctx.getResources();
boolean isLandscape = Utilities.getAppConfiguration(ctx).orientation == Configuration.ORIENTATION_LANDSCAPE;
if (config.isGridEnabled) {
return res.getDimensionPixelSize(gridLayoutResId);
} else if (config.isXLargeScreen) {
return res.getDimensionPixelSize(isLandscape ? xlargeTabletLandResId : xlargeTabletPortResId);
} else if (config.isLargeScreen) {
return res.getDimensionPixelSize(isLandscape ? tabletLandResId : tabletPortResId);
} else {
return res.getDimensionPixelSize(isLandscape ? phoneLandResId : phonePortResId);
}
}
Aggregations