Bruce Xia
11/10/2020, 7:53 PMclass LayoutConfigResolver @Inject constructor(private val context: Context, private val deviceInfo: DeviceInfo) {
fun currentConfig() = when {
deviceInfo.isTv -> TV
else -> if (context.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) PHONE_PORTRAIT else PHONE_LAND
}
}