Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Create PropertyIconDeterminationActivity.kt #1392

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

moritzzzzz
Copy link

Translated PropertyIconDeterminationActivity.java into Kotlin

Translated PropertyIconDeterminationActivity.java into Kotlin
@knov knov removed their assignment Jan 15, 2021
added import R. Other than that, LGTM!
Copy link

@ZiZasaurus ZiZasaurus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just added import R. Other than that looks great!

import com.mapbox.mapboxsdk.style.sources.GeoJsonSource


class PropertyIconDeterminationActivity : AppCompatActivity(), MapboxMap.OnMapClickListener {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add class level documentation that explains what this example is doing

Comment on lines +28 to +32
private val SOURCE_ID = "SOURCE_ID"
private val RED_ICON_ID = "RED_ICON_ID"
private val YELLOW_ICON_ID = "YELLOW_ICON_ID"
private val LAYER_ID = "LAYER_ID"
private val ICON_PROPERTY = "ICON_PROPERTY"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constants should be put into the companion object

private val YELLOW_ICON_ID = "YELLOW_ICON_ID"
private val LAYER_ID = "LAYER_ID"
private val ICON_PROPERTY = "ICON_PROPERTY"
private var mapView: MapView? = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don';t need to rely on nullable views and using findViewById is you use android-kotlin-extensions: https://antonioleiva.com/kotlin-android-extensions/

Copy link

@alishari alishari Jan 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


override fun onResume() {
super.onResume()
mapView!!.onResume()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid using !! (with updating remark above, this won't be needed anymore)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants