-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat-plan-recruitment
# Conflicts: # app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanViewModel.kt # app/src/main/res/layout/item_plan_location.xml # app/src/main/res/values/strings.xml
- Loading branch information
Showing
28 changed files
with
605 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
app/src/main/java/org/sopt/pingle/presentation/mapper/CategoryTypeMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.sopt.pingle.presentation.mapper | ||
|
||
import org.sopt.pingle.presentation.type.CategoryType | ||
import org.sopt.pingle.presentation.ui.main.home.map.MapFragment | ||
|
||
fun CategoryType.toMarkerIcon(isSelected: Boolean) = | ||
when (this) { | ||
CategoryType.PLAY -> if (isSelected) MapFragment.OVERLAY_IMAGE_PLAY_BIG else MapFragment.OVERLAY_IMAGE_PLAY_SMALL | ||
CategoryType.STUDY -> if (isSelected) MapFragment.OVERLAY_IMAGE_STUDY_BIG else MapFragment.OVERLAY_IMAGE_STUDY_SMALL | ||
CategoryType.MULTI -> if (isSelected) MapFragment.OVERLAY_IMAGE_MULTI_BIG else MapFragment.OVERLAY_IMAGE_MULTI_SMALL | ||
CategoryType.OTHERS -> if (isSelected) MapFragment.OVERLAY_IMAGE_OTHER_BIG else MapFragment.OVERLAY_IMAGE_OTHER_SMALL | ||
} |
32 changes: 21 additions & 11 deletions
32
app/src/main/java/org/sopt/pingle/presentation/mapper/PinMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,31 @@ | ||
package org.sopt.pingle.presentation.mapper | ||
|
||
import androidx.databinding.Observable | ||
import com.naver.maps.geometry.LatLng | ||
import com.naver.maps.map.overlay.Marker | ||
import com.naver.maps.map.overlay.OverlayImage | ||
import org.sopt.pingle.R | ||
import org.sopt.pingle.domain.model.PinEntity | ||
import org.sopt.pingle.presentation.model.MarkerModel | ||
import org.sopt.pingle.presentation.type.CategoryType | ||
|
||
fun PinEntity.toMarker(): Marker = Marker().apply { | ||
position = LatLng(y, x) | ||
isHideCollidedMarkers = true | ||
icon = OverlayImage.fromResource( | ||
when (category) { | ||
CategoryType.PLAY.toString() -> R.drawable.ic_map_marker_play_small | ||
CategoryType.STUDY.toString() -> R.drawable.ic_map_marker_study_small | ||
CategoryType.MULTI.toString() -> R.drawable.ic_map_marker_multi_small | ||
else -> R.drawable.ic_map_marker_other_small | ||
fun PinEntity.toMarkerModel(): MarkerModel { | ||
val markerModel = MarkerModel( | ||
Marker().apply { | ||
position = LatLng(y, x) | ||
isHideCollidedMarkers = true | ||
icon = CategoryType.fromString(category).toMarkerIcon(false) | ||
} | ||
) | ||
|
||
markerModel.isSelected.addOnPropertyChangedCallback( | ||
object : | ||
Observable.OnPropertyChangedCallback() { | ||
override fun onPropertyChanged(sender: Observable?, propertyId: Int) { | ||
with(markerModel.marker) { | ||
icon = CategoryType.fromString(category).toMarkerIcon(markerModel.isSelected.get()) | ||
} | ||
} | ||
} | ||
) | ||
|
||
return markerModel | ||
} |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/org/sopt/pingle/presentation/model/MarkerModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.sopt.pingle.presentation.model | ||
|
||
import androidx.databinding.ObservableBoolean | ||
import com.naver.maps.map.overlay.Marker | ||
|
||
data class MarkerModel( | ||
val marker: Marker, | ||
var isSelected: ObservableBoolean = ObservableBoolean(false) | ||
) |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/org/sopt/pingle/presentation/ui/main/home/mainlist/MainListFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.sopt.pingle.presentation.ui.main.home.mainlist | ||
|
||
import android.os.Bundle | ||
import android.view.View | ||
import org.sopt.pingle.R | ||
import org.sopt.pingle.databinding.FragmentMainListBinding | ||
import org.sopt.pingle.presentation.ui.main.home.map.MapFragment | ||
import org.sopt.pingle.util.base.BindingFragment | ||
import org.sopt.pingle.util.fragment.navigateToFragment | ||
|
||
class MainListFragment : BindingFragment<FragmentMainListBinding>(R.layout.fragment_main_list) { | ||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
|
||
addListeners() | ||
} | ||
|
||
private fun addListeners() { | ||
binding.fabMainListMap.setOnClickListener { | ||
navigateToFragment<MapFragment>() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.