-
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-exit-dialog-and-progressbar
# Conflicts: # app/src/main/res/values/strings.xml
- Loading branch information
Showing
50 changed files
with
1,875 additions
and
102 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
app/src/main/java/org/sopt/pingle/domain/model/PingleEntity.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,16 @@ | ||
package org.sopt.pingle.domain.model | ||
|
||
data class PingleEntity( | ||
val id: Long, | ||
val category: String, | ||
val name: String, | ||
val ownerName: String, | ||
val location: String, | ||
val date: String, | ||
val startAt: String, | ||
val endAt: String, | ||
val maxParticipants: Int, | ||
val curParticipants: Int, | ||
val isParticipating: Boolean, | ||
val chatLink: String | ||
) |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/org/sopt/pingle/domain/model/PlanEntity.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,14 @@ | ||
package org.sopt.pingle.domain.model | ||
|
||
data class PlanEntity( | ||
val category: String, | ||
val name: String, | ||
val startAt: String, | ||
val endAt: String, | ||
val x: Double, | ||
val y: Double, | ||
val address: String, | ||
val location: String, | ||
val maxParticipants: Int, | ||
val chatLink: String | ||
) |
11 changes: 11 additions & 0 deletions
11
app/src/main/java/org/sopt/pingle/domain/model/PlanLocationEntity.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,11 @@ | ||
package org.sopt.pingle.domain.model | ||
|
||
import androidx.databinding.ObservableBoolean | ||
|
||
data class PlanLocationEntity( | ||
val location: String, | ||
val address: String, | ||
val x: Double, | ||
val y: Double, | ||
var isSelected: ObservableBoolean = ObservableBoolean(false) | ||
) |
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) | ||
) |
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
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>() | ||
} | ||
} | ||
} |
Oops, something went wrong.