Skip to content

Commit

Permalink
Clean logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jisungbin committed Feb 3, 2022
1 parent 4ca947a commit 94c667d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

package team.gdsc.shelper.activity.contact

import android.content.Intent
import android.net.Uri
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
Expand All @@ -25,6 +27,10 @@ class ContactAdpater : RecyclerView.Adapter<ContactAdpater.ContactViewHolder>()
RecyclerView.ViewHolder(binding.root) {
fun bind(contact: Contact) {
binding.contact = contact
binding.cvContact.setOnClickListener {
val intent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:${contact.name}"))
binding.root.context.startActivity(intent)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class MapActivity : AppCompatActivity(), OnMapReadyCallback {
map.uiSettings.isMyLocationButtonEnabled = true
moveCameraAndZoom(lastLocate)
vm.findPlace(type = PlaceType.FLOOD_DAMAGE, locate = lastLocate)
Locus.stopLocationUpdates()
}
}
result.error?.let { exception ->
Expand Down Expand Up @@ -220,9 +221,4 @@ class MapActivity : AppCompatActivity(), OnMapReadyCallback {
super.onBackPressed()
}
}

override fun onPause() {
Locus.stopLocationUpdates()
super.onPause()
}
}

0 comments on commit 94c667d

Please sign in to comment.