AndroidAPS/app/src/main/java/info/nightscout/androidaps/skins/SkinLowRes.kt

44 lines
1.7 KiB
Kotlin
Raw Normal View History

package info.nightscout.androidaps.skins
import android.util.DisplayMetrics
2022-03-11 14:48:48 +01:00
import android.view.View.GONE
2021-04-14 18:42:12 +02:00
import info.nightscout.androidaps.interfaces.Config
import info.nightscout.androidaps.R
2022-03-11 14:48:48 +01:00
import info.nightscout.androidaps.databinding.ActionsFragmentBinding
import info.nightscout.androidaps.databinding.OverviewFragmentBinding
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class SkinLowRes @Inject constructor(private val config: Config) : SkinInterface {
override val description: Int get() = R.string.lowres_description
override val mainGraphHeight: Int get() = 200
override val secondaryGraphHeight: Int get() = 100
2022-03-11 14:48:48 +01:00
override fun preProcessLandscapeActionsLayout(dm: DisplayMetrics, binding: ActionsFragmentBinding) {
val screenWidth = dm.widthPixels
val screenHeight = dm.heightPixels
val isLandscape = screenHeight < screenWidth
if (!isLandscape) {
binding.stats.apply {
sensorAgeLabel.visibility = GONE
sensorAgeLabel.visibility = GONE
sensorLevelLabel.visibility = GONE
insulinAgeLabel.visibility = GONE
insulinLevelLabel.visibility = GONE
cannulaAgeLabel.visibility = GONE
cannulaPlaceholder.visibility = GONE
pbAgeLabel.visibility = GONE
pbLevelLabel.visibility = GONE
}
}
2022-03-11 14:48:48 +01:00
}
2022-03-11 14:48:48 +01:00
override fun preProcessLandscapeOverviewLayout(dm: DisplayMetrics, binding: OverviewFragmentBinding, isLandscape: Boolean, isTablet: Boolean, isSmallHeight: Boolean) {
if (!config.NSCLIENT && isLandscape) moveButtonsLayout(binding.root)
2021-01-26 15:44:56 +01:00
}
2022-03-11 14:48:48 +01:00
}