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

28 lines
1 KiB
Kotlin
Raw Normal View History

package info.nightscout.androidaps.skins
import android.util.DisplayMetrics
2020-11-23 13:24:38 +01:00
import android.view.View
2021-01-26 15:44:56 +01:00
import android.widget.LinearLayout
import info.nightscout.androidaps.Config
import info.nightscout.androidaps.R
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
override fun actionsLayout(isLandscape: Boolean, isSmallWidth: Boolean): Int =
when {
isLandscape -> R.layout.actions_fragment
else -> R.layout.actions_fragment_lowres
}
2021-01-26 15:44:56 +01:00
override fun preProcessLandscapeOverviewLayout(dm: DisplayMetrics, view: View, isLandscape: Boolean, isTablet: Boolean, isSmallHeight: Boolean) {
if (!config.NSCLIENT && isLandscape) moveButtonsLayout(view as LinearLayout)
}
}