59 lines
No EOL
1.6 KiB
Kotlin
59 lines
No EOL
1.6 KiB
Kotlin
package eu.ztsh.garmin
|
|
|
|
import android.content.res.Resources
|
|
import com.mapbox.maps.EdgeInsets
|
|
import eu.ztsh.garmin.databinding.ActivityMainBinding
|
|
|
|
class UI(b: ActivityMainBinding) {
|
|
|
|
companion object {
|
|
|
|
const val BUTTON_ANIMATION_DURATION = 1500L
|
|
|
|
private val pixelDensity = Resources.getSystem().displayMetrics.density
|
|
val overviewPadding: EdgeInsets by lazy {
|
|
EdgeInsets(
|
|
140.0 * pixelDensity,
|
|
40.0 * pixelDensity,
|
|
120.0 * pixelDensity,
|
|
40.0 * pixelDensity
|
|
)
|
|
}
|
|
val landscapeOverviewPadding: EdgeInsets by lazy {
|
|
EdgeInsets(
|
|
30.0 * pixelDensity,
|
|
380.0 * pixelDensity,
|
|
110.0 * pixelDensity,
|
|
20.0 * pixelDensity
|
|
)
|
|
}
|
|
val followingPadding: EdgeInsets by lazy {
|
|
EdgeInsets(
|
|
180.0 * pixelDensity,
|
|
40.0 * pixelDensity,
|
|
150.0 * pixelDensity,
|
|
40.0 * pixelDensity
|
|
)
|
|
}
|
|
val landscapeFollowingPadding: EdgeInsets by lazy {
|
|
EdgeInsets(
|
|
30.0 * pixelDensity,
|
|
380.0 * pixelDensity,
|
|
110.0 * pixelDensity,
|
|
40.0 * pixelDensity
|
|
)
|
|
}
|
|
|
|
}
|
|
|
|
val mapView = b.mapView
|
|
val maneuverView = b.maneuverView
|
|
val tripProgressView = b.tripProgressView
|
|
val tripProgressCard = b.tripProgressCard
|
|
|
|
val recenter = b.recenter
|
|
val soundButton = b.soundButton
|
|
val routeOverview = b.routeOverview
|
|
val stop = b.stop
|
|
|
|
} |