-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from Next-Room/feature/NextRoom-Android-89
#89 feat: 구독 기능 구현
- Loading branch information
Showing
37 changed files
with
934 additions
and
758 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
24 changes: 15 additions & 9 deletions
24
data/src/main/java/com/nextroom/nextroom/data/network/response/MypageDto.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,20 +1,26 @@ | ||
package com.nextroom.nextroom.data.network.response | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import com.nextroom.nextroom.domain.model.SubscribeItem | ||
import com.nextroom.nextroom.domain.model.UserSubscription | ||
import com.nextroom.nextroom.domain.model.Mypage | ||
import com.nextroom.nextroom.domain.model.SubscribeStatus | ||
|
||
// TODO JH: 이름 변경 고려해보기 | ||
data class MypageDto( | ||
@SerializedName("id") val id: String, | ||
@SerializedName("subStatus") val subsName: String, // LARGE | ||
@SerializedName("createdAt") val createdAt: String, // 2023-10-24 02:29:57 | ||
@SerializedName("expiryDate") val expiryDate: String, // 2023-11-23 | ||
@SerializedName("name") val name: String, // xx이스케이프 xx점 | ||
@SerializedName("status") val status: String, // FREE or SUBSCRIPTION | ||
@SerializedName("startDate") val startDate: String?, // 2023-10-24 02:29:57 | ||
@SerializedName("expiryDate") val expiryDate: String?, // 2023-11-23 | ||
@SerializedName("createdAt") val createdAt: String, // 2023-11-23 | ||
) { | ||
fun toDomain(): UserSubscription { | ||
return UserSubscription( | ||
type = SubscribeItem(id = id, name = subsName), | ||
createdAt = createdAt, | ||
fun toDomain(): Mypage { | ||
return Mypage( | ||
id = id, | ||
name = name, | ||
status = SubscribeStatus.ofValue(status), | ||
startDate = startDate, | ||
expiryDate = expiryDate, | ||
createdAt = createdAt, | ||
) | ||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
domain/src/main/java/com/nextroom/nextroom/domain/model/Mypage.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.nextroom.nextroom.domain.model | ||
|
||
data class Mypage( | ||
val id: String, | ||
val name: String, | ||
val status: SubscribeStatus, | ||
val startDate: String?, | ||
val expiryDate: String?, | ||
val createdAt: String, | ||
) |
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
45 changes: 45 additions & 0 deletions
45
presentation/src/main/java/com/nextroom/nextroom/presentation/common/NRLoading.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,45 @@ | ||
package com.nextroom.nextroom.presentation.common | ||
|
||
import android.content.Context | ||
import android.util.AttributeSet | ||
import android.view.ViewGroup | ||
import android.widget.FrameLayout | ||
import android.widget.ProgressBar | ||
import androidx.core.content.ContextCompat | ||
|
||
class NRLoading @JvmOverloads constructor( | ||
context: Context, | ||
attrs: AttributeSet? = null, | ||
defStyleAttr: Int = 0, | ||
) : FrameLayout(context, attrs, defStyleAttr) { | ||
|
||
init { | ||
// 레이아웃의 크기를 부모의 크기로 설정 | ||
layoutParams = ViewGroup.LayoutParams( | ||
ViewGroup.LayoutParams.MATCH_PARENT, | ||
ViewGroup.LayoutParams.MATCH_PARENT, | ||
) | ||
|
||
// 배경을 투명하게 설정 | ||
setBackgroundColor(ContextCompat.getColor(context, android.R.color.transparent)) | ||
|
||
// ProgressBar를 가운데에 배치 | ||
val progressBar = ProgressBar(context).apply { | ||
layoutParams = LayoutParams( | ||
LayoutParams.WRAP_CONTENT, | ||
LayoutParams.WRAP_CONTENT, | ||
).apply { | ||
// 가운데 정렬 | ||
gravity = android.view.Gravity.CENTER | ||
} | ||
} | ||
|
||
// 로딩중에 하위 뷰 터치 막기 | ||
setOnTouchListener { _, _ -> | ||
true | ||
} | ||
|
||
// ProgressBar를 이 뷰에 추가 | ||
addView(progressBar) | ||
} | ||
} |
4 changes: 1 addition & 3 deletions
4
presentation/src/main/java/com/nextroom/nextroom/presentation/ui/Constants.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,7 +1,5 @@ | ||
package com.nextroom.nextroom.presentation.ui | ||
|
||
object Constants { | ||
const val MINI_PRODUCT = "mini_subscription" | ||
const val MEDIUM_PRODUCT = "medium_subscription" | ||
const val LARGE_PRODUCT = "large_subscription" | ||
const val MEMBERSHIP_PRODUCT = "membership_subscription" | ||
} |
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.