-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
30 changed files
with
1,804 additions
and
70 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
19 changes: 19 additions & 0 deletions
19
data/src/main/java/com/kkkk/data/dto/request/RecordRequestDto.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,19 @@ | ||
package com.kkkk.data.dto.request | ||
|
||
import com.kkkk.domain.entity.request.RecordRequestModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class RecordRequestDto( | ||
@SerialName("accuracy") | ||
val accuracy: Double, | ||
@SerialName("duration") | ||
val duration: Int, | ||
@SerialName("steps") | ||
val steps: Int, | ||
) { | ||
companion object { | ||
fun RecordRequestModel.toDto() = RecordRequestDto(accuracy, duration, steps) | ||
} | ||
} |
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
domain/src/main/kotlin/com/kkkk/domain/entity/request/RecordRequestModel.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.kkkk.domain.entity.request | ||
|
||
data class RecordRequestModel( | ||
val accuracy: Double, | ||
val duration: Int, | ||
val steps: Int, | ||
) |
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
47 changes: 47 additions & 0 deletions
47
presentation/src/main/java/com/kkkk/presentation/main/rhythm/RhythmSaveDialog.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,47 @@ | ||
package com.kkkk.presentation.main.rhythm | ||
|
||
import android.os.Bundle | ||
import android.view.View | ||
import android.view.WindowManager | ||
import androidx.fragment.app.activityViewModels | ||
import com.kkkk.core.base.BaseDialog | ||
import com.kkkk.core.extension.setOnSingleClickListener | ||
import kr.genti.presentation.R | ||
import kr.genti.presentation.databinding.DialogRhythmSaveBinding | ||
|
||
class RhythmSaveDialog : | ||
BaseDialog<DialogRhythmSaveBinding>(R.layout.dialog_rhythm_save) { | ||
private val viewModel by activityViewModels<RhythmViewModel>() | ||
|
||
override fun onStart() { | ||
super.onStart() | ||
dialog?.window?.apply { | ||
setLayout( | ||
WindowManager.LayoutParams.WRAP_CONTENT, | ||
WindowManager.LayoutParams.WRAP_CONTENT, | ||
) | ||
setBackgroundDrawableResource(R.color.transparent) | ||
} | ||
} | ||
|
||
override fun onViewCreated( | ||
view: View, | ||
savedInstanceState: Bundle?, | ||
) { | ||
super.onViewCreated(view, savedInstanceState) | ||
|
||
initPauseBtnListener() | ||
initSaveBtnListener() | ||
} | ||
|
||
private fun initPauseBtnListener() { | ||
binding.btnPause.setOnSingleClickListener { dismiss() } | ||
} | ||
|
||
private fun initSaveBtnListener() { | ||
binding.btnSave.setOnSingleClickListener { | ||
viewModel.posRhythmRecordToSave() | ||
dismiss() | ||
} | ||
} | ||
} |
Oops, something went wrong.