2020-10-20 21:17:28 +02:00
|
|
|
package info.nightscout.androidaps.skins
|
|
|
|
|
2020-11-22 20:48:36 +01:00
|
|
|
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
|
2021-04-14 18:42:12 +02:00
|
|
|
import info.nightscout.androidaps.interfaces.Config
|
2020-10-20 21:17:28 +02:00
|
|
|
import info.nightscout.androidaps.R
|
|
|
|
import javax.inject.Inject
|
|
|
|
import javax.inject.Singleton
|
|
|
|
|
|
|
|
@Singleton
|
2020-11-22 20:48:36 +01:00
|
|
|
class SkinLowRes @Inject constructor(private val config: Config) : SkinInterface {
|
2020-10-20 21:17:28 +02:00
|
|
|
|
|
|
|
override val description: Int get() = R.string.lowres_description
|
|
|
|
override val mainGraphHeight: Int get() = 200
|
|
|
|
override val secondaryGraphHeight: Int get() = 100
|
|
|
|
|
2020-11-22 20:48:36 +01:00
|
|
|
override fun actionsLayout(isLandscape: Boolean, isSmallWidth: Boolean): Int =
|
2020-10-26 22:55:22 +01:00
|
|
|
when {
|
2020-11-29 15:31:45 +01:00
|
|
|
isLandscape -> R.layout.actions_fragment
|
2020-10-26 22:55:22 +01:00
|
|
|
else -> R.layout.actions_fragment_lowres
|
|
|
|
}
|
2020-11-22 20:48:36 +01:00
|
|
|
|
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)
|
|
|
|
}
|
2020-11-29 15:31:45 +01:00
|
|
|
}
|