Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

마이페이지 리팩토링 #269

Merged
merged 46 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
fe97d29
뷰 XML 그리기
Apr 22, 2023
36edca2
Mypage 틀 생성
Apr 22, 2023
50a5ef4
얼럿 추가
Apr 22, 2023
e01de76
페이지 생성 및 연결 완료
Apr 22, 2023
6722483
탈퇴하기 뷰로 추가
Apr 22, 2023
469be92
로그아웃 얼럿 추가
Apr 22, 2023
7a280f4
alert 수정
Apr 23, 2023
c6b05ff
기타 수정
Apr 23, 2023
8601741
약관 관련 브라우저 보내기
Apr 23, 2023
ab56f1b
전체 뷰 xml 그리기
Apr 23, 2023
7dfa81c
api 콜 할 공간 만들기
Apr 23, 2023
3272a3c
기타 api 콜 만들기
Apr 23, 2023
02f8208
flag 제거
Apr 23, 2023
ba6ee29
뷰 디테일 수정
Apr 23, 2023
a95b5df
잘못들어간 enable 수정
Apr 23, 2023
46e0ef5
뷰 XML 그리기
Apr 22, 2023
0c0f818
Mypage 틀 생성
Apr 22, 2023
b347545
얼럿 추가
Apr 22, 2023
b31ea59
페이지 생성 및 연결 완료
Apr 22, 2023
36c37e5
탈퇴하기 뷰로 추가
Apr 22, 2023
431367d
로그아웃 얼럿 추가
Apr 22, 2023
ad70dfe
alert 수정
Apr 23, 2023
eca75f6
기타 수정
Apr 23, 2023
1ef3bad
약관 관련 브라우저 보내기
Apr 23, 2023
6e99118
전체 뷰 xml 그리기
Apr 23, 2023
433de53
api 콜 할 공간 만들기
Apr 23, 2023
a405181
기타 api 콜 만들기
Apr 23, 2023
a593d9b
flag 제거
Apr 23, 2023
93d9e40
뷰 디테일 수정
Apr 23, 2023
be4c7d5
잘못들어간 enable 수정
Apr 23, 2023
2a67a63
Merge branch 'feature/minjung/230422-mypage' of https://github.com/so…
Apr 24, 2023
4e1dc98
API 생성
Apr 24, 2023
7f0f627
API 연결
Apr 24, 2023
718f250
view - api 연결
Apr 24, 2023
6dbdf5a
gradle 추가
Jun 28, 2023
91c8fca
rx Extension 생성
Jun 28, 2023
8a65e9a
adjustSentence 리팩토링
Jun 28, 2023
6509d42
ChangeNickName 리팩토링
Jun 28, 2023
f904fd3
signOut 리팩토링
Jun 28, 2023
651e2a9
myPage 리팩토링
Jun 28, 2023
456b429
rx gradle 적용
Jun 28, 2023
20907f2
Gradle version fix
l2hyunwoo Jun 28, 2023
20e5245
behavior -> publish
Jul 3, 2023
44763eb
Merge branch 'develop' into feature/minjung/mypage-refactor
Jul 3, 2023
6870f89
ktlint format
l2hyunwoo Jul 21, 2023
78e0457
build error fix
l2hyunwoo Jul 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ dependencies {
implementation(libs.retrofit.kotlin.serialization.converter)
implementation(libs.timber)

implementation(libs.rxjava)
implementation(libs.rxandroid)
implementation(libs.rxkotlin)
implementation(libs.rxbinding)

implementation(libs.bundles.compose)

implementation(libs.bundles.mavericks)
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/org/sopt/official/base/BaseAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import org.sopt.official.util.DifferConfigCompat

abstract class BaseListAdapter<ItemType: BaseItemType, HolderType : BaseViewHolder<ItemType, *, *>>(
differ: DiffUtil.ItemCallback<ItemType> = DifferConfigCompat()
abstract class BaseListAdapter<ItemType : BaseItemType, HolderType : BaseViewHolder<ItemType, *, *>>(
differ: DiffUtil.ItemCallback<ItemType> = DifferConfigCompat()
) : ListAdapter<ItemType, HolderType>(differ) {

override fun onBindViewHolder(holder: HolderType, position: Int) {
Expand All @@ -18,6 +18,6 @@ abstract class BaseListAdapter<ItemType: BaseItemType, HolderType : BaseViewHold
}
}

abstract class BaseAdapter<ItemType: BaseItemType>(
abstract class BaseAdapter<ItemType : BaseItemType>(
differ: DiffUtil.ItemCallback<ItemType> = DifferConfigCompat()
) : BaseListAdapter<ItemType, BaseViewHolder<ItemType,*,*>>(differ)
) : BaseListAdapter<ItemType, BaseViewHolder<ItemType, *, *>>(differ)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class AuthInterceptor @Inject constructor(
return chain.proceed(authRequest)
}


private fun isAccessTokenUsed(originalRequest: Request) =
when {
originalRequest.url.encodedPath.contains("playground") -> false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ data class SoptEventResponse(
val endAtDateTime = endAt.toLocalDateTime()
if (startAtDateTime.date == endAtDateTime.date) {
"${startAtDateTime.monthNumber}월 ${startAtDateTime.dayOfMonth}일 ${
startAtDateTime.hour.toString().padStart(2, '0')
startAtDateTime.hour.toString().padStart(2, '0')
}:${startAtDateTime.minute.toString().padStart(2, '0')} - ${
endAtDateTime.hour.toString().padStart(2, '0')
endAtDateTime.hour.toString().padStart(2, '0')
}:${endAtDateTime.minute.toString().padStart(2, '0')}"
} else {
"${startAtDateTime.monthNumber}월 ${startAtDateTime.dayOfMonth}일 ${
startAtDateTime.hour.toString().padStart(2, '0')
startAtDateTime.hour.toString().padStart(2, '0')
}:${
startAtDateTime.minute.toString().padStart(2, '0')
startAtDateTime.minute.toString().padStart(2, '0')
} - ${endAtDateTime.monthNumber}월 ${endAtDateTime.dayOfMonth}일 ${
endAtDateTime.hour.toString().padStart(2, '0')
endAtDateTime.hour.toString().padStart(2, '0')
}:${endAtDateTime.minute.toString().padStart(2, '0')}"
}
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package org.sopt.official.data.repository

import org.sopt.official.data.model.request.AuthRequest
import org.sopt.official.data.model.request.RefreshRequest
import org.sopt.official.data.persistence.SoptDataStore
import org.sopt.official.data.service.AuthService
import org.sopt.official.domain.entity.auth.Auth
import org.sopt.official.domain.entity.auth.Token
import org.sopt.official.domain.entity.auth.UserStatus
import org.sopt.official.domain.repository.AuthRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import javax.inject.Inject

class MainViewRepositoryImpl @Inject constructor(
private val mainViewService: MainViewService,
): MainViewRepository {
) : MainViewRepository {
override suspend fun getMainView(): Result<MainViewResult> {
return runCatching {
mainViewService.getMainView().toEntity()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import org.sopt.official.data.model.attendance.*


class MockAttendanceService : AttendanceService {
override suspend fun getSoptEvent(): BaseAttendanceResponse<SoptEventResponse> {
return NOT_EVENT_DAY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import retrofit2.http.GET

interface MainViewService {
@GET("user/main")
suspend fun getMainView() : MainViewResponse
suspend fun getMainView(): MainViewResponse
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
package org.sopt.official.designsystem

import android.app.AlertDialog
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.KeyEvent
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.StringRes
import androidx.compose.ui.unit.dp
import androidx.constraintlayout.widget.ConstraintLayout
import org.sopt.official.R
import org.sopt.official.databinding.LayoutDialogNegativePositiveBinding
import org.sopt.official.feature.attendance.util.dpToPx
import org.sopt.official.stamp.util.toPx

class AlertDialogPositiveNegative(context: Context) : ConstraintLayout(context) {
private val builder: AlertDialog.Builder = AlertDialog.Builder(context)
Expand Down Expand Up @@ -81,9 +74,11 @@ class AlertDialogPositiveNegative(context: Context) : ConstraintLayout(context)
}

fun show() {
dialog?.window?.setBackgroundDrawable(context.getDrawable(R.drawable.rectangle_radius_10).apply {
this?.setTint(context.getColor(R.color.black_60))
})
dialog?.window?.setBackgroundDrawable(
context.getDrawable(R.drawable.rectangle_radius_10).apply {
this?.setTint(context.getColor(R.color.black_60))
}
)

dialog?.show()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class AttendanceActivity : AppCompatActivity() {
}

2 -> {
tvAttendanceProgress1.text = if(soptEvent.attendances[0].status == AttendanceStatus.ATTENDANCE) {
tvAttendanceProgress1.text = if (soptEvent.attendances[0].status == AttendanceStatus.ATTENDANCE) {
soptEvent.attendances[0].attendedAt
} else {
"결석"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.sopt.official.feature.attendance

import android.util.Log
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import org.sopt.official.util.stringOf
import org.sopt.official.util.ui.setVisible
import org.sopt.official.util.viewBinding
import org.sopt.official.util.wrapper.getOrEmpty
import timber.log.Timber
import java.io.Serializable

@AndroidEntryPoint
Expand Down Expand Up @@ -91,8 +90,11 @@ class MainActivity : AppCompatActivity() {
.onEach {
val userState = it.get() ?: UserState.UNAUTHENTICATED
binding.subtitle.text = getStringExt(
if (userState == UserState.UNAUTHENTICATED) R.string.main_subtitle_non_member
else R.string.main_subtitle_member
if (userState == UserState.UNAUTHENTICATED) {
R.string.main_subtitle_non_member
} else {
R.string.main_subtitle_member
}
)
binding.tagMemberState.isEnabled = userState == UserState.ACTIVE
val isClickable = userState != UserState.UNAUTHENTICATED
Expand Down Expand Up @@ -124,8 +126,10 @@ class MainActivity : AppCompatActivity() {
if (generationList.size >= 6) binding.memberGeneration.generation5.text = generationList[5].toString()
binding.memberGeneration.generationAddition.setVisible(generationList.size >= 7)
val additionalGeneration = (generationList.size - 5).toString()
if (generationList.size >= 7) binding.memberGeneration.generationAddition.text =
[email protected](R.string.main_additional_generation, additionalGeneration)
if (generationList.size >= 7) {
binding.memberGeneration.generationAddition.text =
[email protected](R.string.main_additional_generation, additionalGeneration)
}
}.launchIn(lifecycleScope)
}

Expand Down Expand Up @@ -261,7 +265,6 @@ class MainActivity : AppCompatActivity() {
companion object {
@JvmStatic
fun getIntent(context: Context, args: StartArgs) = Intent(context, MainActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
putExtra("args", args)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class MainViewModel @Inject constructor(
SOPT_PROJECT_URL(R.string.main_large_block_official_page, WebUrlConstant.SOPT_PROJECT_URL, R.drawable.ic_project),
SOPT_FAQ_URL(R.string.main_small_block_faq, WebUrlConstant.SOPT_FAQ_URL, R.drawable.ic_faq),

//playground
// playground
PLAYGROUNG_MEMBER_URL(R.string.main_small_block_member, WebUrlConstant.PLAYGROUNG_MEMBER_URL, R.drawable.ic_member),
PLAYGROUNG_PROJECT_URL(
R.string.main_small_block_playground_project,
Expand All @@ -190,7 +190,7 @@ class MainViewModel @Inject constructor(
),
PLAYGROUNG_CREW_URL(R.string.main_small_block_crew, WebUrlConstant.PLAYGROUNG_CREW_URL, R.drawable.ic_crew),

//others
// others
SOPT_OFFICIAL_YOUTUBE(R.string.main_small_block_youtube, WebUrlConstant.SOPT_OFFICIAL_YOUTUBE, R.drawable.ic_youtube);
}

Expand Down
Loading