-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AN] 발자국 삭제, 산책 종료, 산책 타이머 기능 구현 (#522)
- Loading branch information
Showing
84 changed files
with
1,906 additions
and
781 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
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
11 changes: 11 additions & 0 deletions
11
...oid/app/src/main/java/com/happy/friendogly/data/mapper/FootprintRecentWalkStatusMapper.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 com.happy.friendogly.data.mapper | ||
|
||
import com.happy.friendogly.data.model.FootprintRecentWalkStatusDto | ||
import com.happy.friendogly.presentation.ui.woof.model.FootprintRecentWalkStatus | ||
|
||
fun FootprintRecentWalkStatusDto.toDomain(): FootprintRecentWalkStatus { | ||
return FootprintRecentWalkStatus( | ||
walkStatus = walkStatus.toDomain(), | ||
changedWalkStatusTime = changedWalkStatusTime, | ||
) | ||
} |
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
8 changes: 8 additions & 0 deletions
8
android/app/src/main/java/com/happy/friendogly/data/model/FootprintRecentWalkStatusDto.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,8 @@ | ||
package com.happy.friendogly.data.model | ||
|
||
import kotlinx.datetime.LocalDateTime | ||
|
||
data class FootprintRecentWalkStatusDto( | ||
val walkStatus: WalkStatusDto, | ||
val changedWalkStatusTime: LocalDateTime, | ||
) |
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
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
7 changes: 7 additions & 0 deletions
7
android/app/src/main/java/com/happy/friendogly/domain/usecase/DeleteFootprintUseCase.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,7 @@ | ||
package com.happy.friendogly.domain.usecase | ||
|
||
import com.happy.friendogly.domain.repository.WoofRepository | ||
|
||
class DeleteFootprintUseCase(private val repository: WoofRepository) { | ||
suspend operator fun invoke(footprintId: Long): Result<Unit> = repository.deleteFootprint(footprintId = footprintId) | ||
} |
11 changes: 11 additions & 0 deletions
11
...ain/java/com/happy/friendogly/domain/usecase/PatchFootprintRecentWalkStatusAutoUseCase.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 com.happy.friendogly.domain.usecase | ||
|
||
import com.happy.friendogly.domain.repository.WoofRepository | ||
import com.happy.friendogly.presentation.ui.woof.model.FootprintRecentWalkStatus | ||
|
||
class PatchFootprintRecentWalkStatusAutoUseCase(private val repository: WoofRepository) { | ||
suspend operator fun invoke( | ||
latitude: Double, | ||
longitude: Double, | ||
): Result<FootprintRecentWalkStatus> = repository.patchFootprintRecentWalkStatusAuto(latitude = latitude, longitude = longitude) | ||
} |
10 changes: 10 additions & 0 deletions
10
...n/java/com/happy/friendogly/domain/usecase/PatchFootprintRecentWalkStatusManualUseCase.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,10 @@ | ||
package com.happy.friendogly.domain.usecase | ||
|
||
import com.happy.friendogly.domain.repository.WoofRepository | ||
import com.happy.friendogly.presentation.ui.woof.model.FootprintRecentWalkStatus | ||
import com.happy.friendogly.presentation.ui.woof.model.WalkStatus | ||
|
||
class PatchFootprintRecentWalkStatusManualUseCase(private val repository: WoofRepository) { | ||
suspend operator fun invoke(walkStatus: WalkStatus): Result<FootprintRecentWalkStatus> = | ||
repository.patchFootprintRecentWalkStatusManual(walkStatus = walkStatus) | ||
} |
11 changes: 0 additions & 11 deletions
11
android/app/src/main/java/com/happy/friendogly/domain/usecase/PatchWalkStatusUseCase.kt
This file was deleted.
Oops, something went wrong.
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
29 changes: 29 additions & 0 deletions
29
android/app/src/main/java/com/happy/friendogly/presentation/ui/woof/WoofAlertActions.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,29 @@ | ||
package com.happy.friendogly.presentation.ui.woof | ||
|
||
sealed interface WoofAlertActions { | ||
data object AlertHasNotPetDialog : WoofAlertActions | ||
|
||
data class AlertMarkBtnClickBeforeTimeoutSnackbar( | ||
val remainingTime: Int, | ||
) : WoofAlertActions | ||
|
||
data object AlertMarkerRegisteredSnackbar : WoofAlertActions | ||
|
||
data object AlertDeleteMyFootprintMarkerSnackbar : WoofAlertActions | ||
|
||
data object AlertEndWalkSnackbar : WoofAlertActions | ||
|
||
data object AlertFailToLoadFootprintMarkBtnInfoSnackbar : WoofAlertActions | ||
|
||
data object AlertFailToLoadNearFootprintsSnackbar : WoofAlertActions | ||
|
||
data object AlertFailToRegisterFootprintSnackbar : WoofAlertActions | ||
|
||
data object AlertFailToLoadFootprintInfoSnackbar : WoofAlertActions | ||
|
||
data object AlertFailToUpdateFootprintWalkStatusSnackbar : WoofAlertActions | ||
|
||
data object AlertFailToEndWalkSnackbar : WoofAlertActions | ||
|
||
data object AlertFailToDeleteMyFootprintSnackbar : WoofAlertActions | ||
} |
48 changes: 48 additions & 0 deletions
48
android/app/src/main/java/com/happy/friendogly/presentation/ui/woof/WoofAnimation.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,48 @@ | ||
package com.happy.friendogly.presentation.ui.woof | ||
|
||
import android.animation.Animator | ||
import android.animation.AnimatorListenerAdapter | ||
import android.view.View | ||
import android.view.ViewTreeObserver | ||
import androidx.core.view.isVisible | ||
|
||
const val ANIMATE_DURATION_MILLIS = 300L | ||
|
||
fun View.showViewAnimation() { | ||
if (height == 0) { | ||
viewTreeObserver.addOnGlobalLayoutListener( | ||
object : ViewTreeObserver.OnGlobalLayoutListener { | ||
override fun onGlobalLayout() { | ||
animateView() | ||
if (height > 0) viewTreeObserver.removeOnGlobalLayoutListener(this) | ||
} | ||
}, | ||
) | ||
} else { | ||
animateView() | ||
} | ||
} | ||
|
||
private fun View.animateView() { | ||
translationY = height.toFloat() | ||
animate().translationY(0f).setDuration(ANIMATE_DURATION_MILLIS).setListener( | ||
object : AnimatorListenerAdapter() { | ||
override fun onAnimationStart(animation: Animator) { | ||
isVisible = true | ||
bringToFront() | ||
} | ||
}, | ||
) | ||
} | ||
|
||
fun View.hideViewAnimation() { | ||
animate().translationY(height.toFloat()).setDuration(ANIMATE_DURATION_MILLIS) | ||
.setListener( | ||
object : AnimatorListenerAdapter() { | ||
override fun onAnimationEnd(animation: Animator) { | ||
super.onAnimationEnd(animation) | ||
isVisible = false | ||
} | ||
}, | ||
) | ||
} |
Oops, something went wrong.