mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor(map): wrap Context functions with remember
This commit is contained in:
parent
c0955e7687
commit
d387c7bd04
1 changed files with 3 additions and 3 deletions
|
|
@ -137,12 +137,12 @@ fun MapView(
|
|||
var myLocationOverlay: MyLocationNewOverlay? by remember { mutableStateOf(null) }
|
||||
|
||||
val context = LocalContext.current
|
||||
val mPrefs = context.getSharedPreferences(prefsName, Context.MODE_PRIVATE)
|
||||
val mPrefs = remember { context.getSharedPreferences(prefsName, Context.MODE_PRIVATE) }
|
||||
|
||||
val haptic = LocalHapticFeedback.current
|
||||
fun performHapticFeedback() = haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
|
||||
val hasGps = context.hasGps()
|
||||
val hasGps = remember { context.hasGps() }
|
||||
|
||||
val map = rememberMapViewWithLifecycle(context)
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ fun MapView(
|
|||
var showEditWaypointDialog by remember { mutableStateOf<Waypoint?>(null) }
|
||||
var showCurrentCacheInfo by remember { mutableStateOf(false) }
|
||||
|
||||
val markerIcon by lazy {
|
||||
val markerIcon = remember {
|
||||
AppCompatResources.getDrawable(context, R.drawable.ic_baseline_location_on_24)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue