mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-04 22:23:47 -04:00
fix various lint warnings
This commit is contained in:
@@ -413,7 +413,7 @@ class MainActivity : AppCompatActivity(), Logging,
|
||||
// pager.offscreenPageLimit = 0 // Don't keep any offscreen pages around, because we want to make sure our bluetooth scanning stops
|
||||
TabLayoutMediator(binding.tabLayout, binding.pager) { tab, position ->
|
||||
// tab.text = tabInfos[position].text // I think it looks better with icons only
|
||||
tab.icon = getDrawable(tabInfos[position].icon)
|
||||
tab.icon = ContextCompat.getDrawable(this, tabInfos[position].icon)
|
||||
}.attach()
|
||||
|
||||
model.isConnected.observe(this, Observer { connected ->
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.Observer
|
||||
import com.geeksville.android.GeeksvilleApplication
|
||||
@@ -157,7 +158,7 @@ class MapFragment : ScreenFragment("Map"), Logging {
|
||||
if (view != null) { // it might have gone away by now
|
||||
// val markerIcon = BitmapFactory.decodeResource(context.resources, R.drawable.ic_twotone_person_pin_24)
|
||||
val markerIcon =
|
||||
requireActivity().getDrawable(R.drawable.ic_twotone_person_pin_24)!!
|
||||
ContextCompat.getDrawable(requireActivity(), R.drawable.ic_twotone_person_pin_24)!!
|
||||
|
||||
map.setStyle(Style.OUTDOORS) { style ->
|
||||
style.addSource(nodePositions)
|
||||
|
||||
@@ -107,7 +107,7 @@ private fun requestBonding(
|
||||
|
||||
class BTScanModel(app: Application) : AndroidViewModel(app), Logging {
|
||||
|
||||
private val context = getApplication<Application>().applicationContext
|
||||
private val context: Context get() = getApplication<Application>().applicationContext
|
||||
|
||||
init {
|
||||
debug("BTScanModel created")
|
||||
|
||||
Reference in New Issue
Block a user