Skip to content

Commit b60495d

Browse files
committed
final touch [#162]
1 parent bb9dce6 commit b60495d

File tree

21 files changed

+200
-165
lines changed

21 files changed

+200
-165
lines changed

domain/src/main/java/com/foke/together/domain/interactor/entity/CutFrameType.kt

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.foke.together.domain.interactor.entity
33
import androidx.annotation.DrawableRes
44
import androidx.compose.ui.graphics.Color
55
import androidx.compose.ui.text.font.FontWeight
6+
import androidx.compose.ui.text.style.TextAlign
67
import com.foke.together.domain.R
78

89
abstract class CutFrame(
@@ -47,9 +48,9 @@ sealed class DefaultCutFrameSet (
4748
PhotoPosition(159, 106, 16, 369),
4849
),
4950
emptyList(),
50-
datePosition = TextStickerPosition(139,541,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6),
51-
copyrightPosition = TextStickerPosition(122,547,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6),
52-
qrCodePosition = QrStickerPosition(25,16,530)
51+
datePosition = TextStickerPosition(80, 10, 91,541,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
52+
copyrightPosition = TextStickerPosition(80, 10, 91,547,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
53+
qrCodePosition = QrStickerPosition(30,16,530)
5354
)
5455

5556
data object FourCurDark: DefaultCutFrameSet(
@@ -64,9 +65,9 @@ data object FourCurDark: DefaultCutFrameSet(
6465
PhotoPosition(159, 106, 16, 369),
6566
),
6667
emptyList(),
67-
datePosition = TextStickerPosition(139,541,R.font.cascadia_mono, color = Color(170, 170, 170), fontWeight = FontWeight.ExtraBold, fontSize = 6),
68-
copyrightPosition = TextStickerPosition(122,547,R.font.cascadia_mono, color = Color(170, 170, 170), fontWeight = FontWeight.ExtraBold, fontSize = 6),
69-
qrCodePosition = QrStickerPosition(25,16,530)
68+
datePosition = TextStickerPosition(80, 10, 91,541,R.font.cascadia_mono, color = Color(170, 170, 170), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
69+
copyrightPosition = TextStickerPosition(80, 10, 91,547,R.font.cascadia_mono, color = Color(170, 170, 170), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
70+
qrCodePosition = QrStickerPosition(30,16,530)
7071
)
7172

7273
data object MakerFaire: DefaultCutFrameSet(
@@ -81,9 +82,9 @@ data object FourCurDark: DefaultCutFrameSet(
8182
PhotoPosition(159, 106, 16, 369),
8283
),
8384
emptyList(),
84-
datePosition = TextStickerPosition(139,541,R.font.cascadia_mono, color = Color(238, 238, 238), fontWeight = FontWeight.ExtraBold, fontSize = 6),
85-
copyrightPosition = TextStickerPosition(122,547,R.font.cascadia_mono, color = Color(238, 238, 238), fontWeight = FontWeight.ExtraBold, fontSize = 6),
86-
qrCodePosition = QrStickerPosition(25,16,530)
85+
datePosition = TextStickerPosition(80, 10, 91,541,R.font.cascadia_mono, color = Color(238, 238, 238), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
86+
copyrightPosition = TextStickerPosition(80, 10, 91,547,R.font.cascadia_mono, color = Color(238, 238, 238), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
87+
qrCodePosition = QrStickerPosition(30,16,530)
8788
)
8889

8990
data object MakerFaire25_1: DefaultCutFrameSet(
@@ -100,9 +101,9 @@ data object FourCurDark: DefaultCutFrameSet(
100101
listOf(
101102
R.drawable.maker_faire_frame_25_1
102103
),
103-
datePosition = TextStickerPosition(139,541,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6),
104-
copyrightPosition = TextStickerPosition(122,547,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6),
105-
qrCodePosition = QrStickerPosition(25,149,517)
104+
datePosition = TextStickerPosition(80, 10, 92,546,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
105+
copyrightPosition = TextStickerPosition(80, 10, 92,551,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
106+
qrCodePosition = QrStickerPosition(30,145,515)
106107
)
107108

108109
data object MakerFaire25_2: DefaultCutFrameSet(
@@ -119,9 +120,9 @@ data object FourCurDark: DefaultCutFrameSet(
119120
listOf(
120121
R.drawable.maker_faire_frame_25_2
121122
),
122-
datePosition = TextStickerPosition(139,541,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6),
123-
copyrightPosition = TextStickerPosition(122,547,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6),
124-
qrCodePosition = QrStickerPosition(25,149,517)
123+
datePosition = TextStickerPosition(80, 10, 92,546,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
124+
copyrightPosition = TextStickerPosition(80, 10, 92,551,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
125+
qrCodePosition = QrStickerPosition(30,145,515)
125126
)
126127

127128
data object MakerFaire25_3: DefaultCutFrameSet(
@@ -138,9 +139,9 @@ data object FourCurDark: DefaultCutFrameSet(
138139
listOf(
139140
R.drawable.maker_faire_frame_25_3
140141
),
141-
datePosition = TextStickerPosition(139,541,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6),
142-
copyrightPosition = TextStickerPosition(122,547,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6),
143-
qrCodePosition = QrStickerPosition(25,149,517)
142+
datePosition = TextStickerPosition(80, 10, 92,546,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
143+
copyrightPosition = TextStickerPosition(80, 10, 92,551,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
144+
qrCodePosition = QrStickerPosition(30,145,515)
144145
)
145146

146147
data object MakerFaire25_4: DefaultCutFrameSet(
@@ -157,9 +158,9 @@ data object FourCurDark: DefaultCutFrameSet(
157158
listOf(
158159
R.drawable.maker_faire_frame_25_4
159160
),
160-
datePosition = TextStickerPosition(139,541,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6),
161-
copyrightPosition = TextStickerPosition(122,547,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6),
162-
qrCodePosition = QrStickerPosition(25,149,517)
161+
datePosition = TextStickerPosition(80, 10, 92,546,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
162+
copyrightPosition = TextStickerPosition(80, 10, 92,551,R.font.cascadia_mono, color = Color(34, 34, 34), fontWeight = FontWeight.ExtraBold, fontSize = 6, textAlign = TextAlign.End),
163+
qrCodePosition = QrStickerPosition(30,145,515)
163164
)
164165

165166
companion object {

domain/src/main/java/com/foke/together/domain/interactor/entity/SessionData.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package com.foke.together.domain.interactor.entity
22

3+
import android.graphics.Bitmap
4+
35
data class SessionData (
46
val sessionId: SessionId,
57
val cutFrame: CutFrame? = null,
8+
val qrCodeBitmap: Bitmap? = null,
69
val status: Status
710
)
811

domain/src/main/java/com/foke/together/domain/interactor/entity/TextStickerPosition.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ package com.foke.together.domain.interactor.entity
33
import androidx.annotation.FontRes
44
import androidx.compose.ui.graphics.Color
55
import androidx.compose.ui.text.font.FontWeight
6+
import androidx.compose.ui.text.style.TextAlign
67

78
data class TextStickerPosition (
9+
val width: Int,
10+
val height: Int,
811
val x: Int,
912
val y: Int,
1013
@FontRes val font: Int,
1114
val color: Color,
1215
val backgroundColor: Color = Color(0,0,0,0),
1316
val fontWeight: FontWeight,
1417
val fontSize: Int,
15-
val rotation: Float = 0f
18+
val rotation: Float = 0f,
19+
val textAlign: TextAlign = TextAlign.Left,
1620
)

domain/src/main/java/com/foke/together/domain/interactor/session/UpdateSessionStatusUseCase.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.foke.together.domain.interactor.session
22

3+
import android.graphics.Bitmap
34
import com.foke.together.domain.interactor.entity.CutFrame
45
import com.foke.together.domain.interactor.entity.Status
56
import com.foke.together.domain.output.SessionRepositoryInterface
@@ -15,4 +16,8 @@ class UpdateSessionStatusUseCase @Inject constructor(
1516
operator fun invoke(cutFrame: CutFrame) {
1617
sessionRepository.updateSession(cutFrame)
1718
}
19+
20+
operator fun invoke(qrCodeBitmap: Bitmap) {
21+
sessionRepository.updateSession(qrCodeBitmap)
22+
}
1823
}

domain/src/main/java/com/foke/together/domain/interactor/web/UploadFileUseCase.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ class UploadFileUseCase @Inject constructor(
1515
.onSuccess { preSignedUrl ->
1616
AppLog.e(TAG, "invoke", "preSignedUrl: $preSignedUrl")
1717
remoteRepository.uploadFile(preSignedUrl, file)
18+
.onSuccess {
19+
return Result.success(Unit)
20+
}
1821
.onFailure {
1922
AppLog.e(TAG, "invoke", "upload failed")
2023
return Result.failure(Exception("cannot upload file: $it"))

domain/src/main/java/com/foke/together/domain/output/SessionRepositoryInterface.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.foke.together.domain.output
22

3+
import android.graphics.Bitmap
34
import com.foke.together.domain.interactor.entity.CutFrame
45
import com.foke.together.domain.interactor.entity.SessionData
56
import com.foke.together.domain.interactor.entity.Status
@@ -12,6 +13,7 @@ interface SessionRepositoryInterface {
1213
fun updateSession(cutFrame: CutFrame)
1314
fun updateSession(status: Status)
1415
fun updateSession(cutFrame: CutFrame, status: Status)
16+
fun updateSession(qrCodeBitmap: Bitmap)
1517

1618
fun clearSession()
1719
}
337 KB
Loading
5.24 MB
Loading
4.88 MB
Loading
5.21 MB
Loading

0 commit comments

Comments
 (0)