generated from ajou4095/template-android
-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Fix] 오류 & 최종 디자인 수정 #134
Merged
[Fix] 오류 & 최종 디자인 수정 #134
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d53319c
[fix]: 사용자 트랜드 수집 오류 수정
jinuemong ecfef8e
[fix]: 카카오톡 로그인 오류 수정
jinuemong 674840c
[fix]: 뒤로가기 토스트 수정
jinuemong 5b9395a
[fix]: 검색 오류 수정
jinuemong 47e5d27
[fix]: 관계 추가 시 이전 데이터 유지
jinuemong 4869b99
[feat]: 디자인 QA 적용
jinuemong 395816a
[feat]: 경사 종류 아이콘 교체
jinuemong f5241a5
[feat]: 경사 종류 아이콘 교체
jinuemong fbc9169
[feat]: 일정 스크린 스티키 적용
jinuemong cbc2931
[fix]: 일정 날짜 클릭 시 오늘로 이동
jinuemong ef99110
[fix]: 선택 캘린더 변경
jinuemong 0d90955
[fix]
jinuemong 202b9c9
[fix]
jinuemong 2912b50
[fix]
jinuemong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
51 changes: 51 additions & 0 deletions
51
presentation/src/main/kotlin/ac/dnd/mour/android/presentation/common/util/KakaoLoginUtil.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,51 @@ | ||
package ac.dnd.mour.android.presentation.common.util | ||
|
||
import android.content.Context | ||
import com.kakao.sdk.auth.model.OAuthToken | ||
import com.kakao.sdk.common.model.ClientError | ||
import com.kakao.sdk.common.model.ClientErrorCause | ||
import com.kakao.sdk.user.UserApiClient | ||
|
||
fun loginWithKakao( | ||
context: Context, | ||
onSuccess: (OAuthToken) -> Unit, | ||
onFailure: (Throwable) -> Unit | ||
) { | ||
loginWithKakaoTalk( | ||
context = context, | ||
onSuccess = onSuccess, | ||
onFailure = { exception -> | ||
if ((exception as? ClientError)?.reason == ClientErrorCause.NotSupported) { | ||
loginWithKakaoAccount( | ||
context = context, | ||
onSuccess = onSuccess, | ||
onFailure = onFailure | ||
) | ||
} else { | ||
onFailure(exception) | ||
} | ||
} | ||
) | ||
} | ||
|
||
fun loginWithKakaoTalk( | ||
context: Context, | ||
onSuccess: (OAuthToken) -> Unit, | ||
onFailure: (Throwable) -> Unit | ||
) { | ||
UserApiClient.instance.loginWithKakaoTalk(context) { token, error -> | ||
token?.let { onSuccess(it) } | ||
error?.let { onFailure(it) } | ||
} | ||
} | ||
|
||
fun loginWithKakaoAccount( | ||
context: Context, | ||
onSuccess: (OAuthToken) -> Unit, | ||
onFailure: (Throwable) -> Unit | ||
) { | ||
UserApiClient.instance.loginWithKakaoAccount(context) { token, error -> | ||
token?.let { onSuccess(it) } | ||
error?.let { onFailure(it) } | ||
} | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,7 @@ import androidx.compose.runtime.mutableStateListOf | |
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.rememberCoroutineScope | ||
import androidx.compose.runtime.saveable.rememberSaveable | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
|
@@ -107,23 +108,23 @@ fun HistoryRegistrationScreen( | |
val scope = rememberCoroutineScope() | ||
val focusManager = LocalFocusManager.current | ||
val scrollState = rememberScrollState() | ||
var isContinuousState by remember { mutableStateOf(false) } | ||
var historyTypeState by remember { mutableStateOf(HistoryRegistrationType.TAKE) } | ||
var priceText by remember { mutableStateOf("") } | ||
var userNameText by remember { mutableStateOf(name) } | ||
var relationId by remember { mutableLongStateOf(id) } | ||
var selectedYear by remember { mutableIntStateOf(calendarConfig.getCalendarYear()) } | ||
var selectedMonth by remember { mutableIntStateOf(calendarConfig.getCalendarMonth()) } | ||
var selectedDay by remember { mutableIntStateOf(calendarConfig.getCalendarDay()) } | ||
var eventTypeText by remember { mutableStateOf("") } | ||
var selectedEventId by remember { mutableLongStateOf(-1) } | ||
var memoText by remember { mutableStateOf("") } | ||
var isContinuousState by rememberSaveable { mutableStateOf(false) } | ||
var historyTypeState by rememberSaveable { mutableStateOf(HistoryRegistrationType.TAKE) } | ||
var priceText by rememberSaveable { mutableStateOf("") } | ||
var userNameText by rememberSaveable { mutableStateOf(name) } | ||
var relationId by rememberSaveable { mutableLongStateOf(id) } | ||
var selectedYear by rememberSaveable { mutableIntStateOf(calendarConfig.getCalendarYear()) } | ||
var selectedMonth by rememberSaveable { mutableIntStateOf(calendarConfig.getCalendarMonth()) } | ||
var selectedDay by rememberSaveable { mutableIntStateOf(calendarConfig.getCalendarDay()) } | ||
var eventTypeText by rememberSaveable { mutableStateOf("") } | ||
var selectedEventId by rememberSaveable { mutableLongStateOf(-1) } | ||
var memoText by rememberSaveable { mutableStateOf("") } | ||
val tagIdList = remember { mutableStateListOf<Long>() } | ||
|
||
var isCalendarShowingState by remember { mutableStateOf(false) } | ||
var isAddNameShowingState by remember { mutableStateOf(false) } | ||
var isCalendarShowingState by rememberSaveable { mutableStateOf(false) } | ||
var isAddNameShowingState by rememberSaveable { mutableStateOf(false) } | ||
|
||
var isViewUnRecordMessage by remember { mutableStateOf("") } | ||
var isViewUnRecordMessage by rememberSaveable { mutableStateOf("") } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 필요한 것만 saveable 하게 만들어주세요 |
||
|
||
val typePositionState = animateDpAsState( | ||
targetValue = if (historyTypeState == HistoryRegistrationType.TAKE) 0.dp else 106.dp, | ||
|
@@ -152,7 +153,7 @@ fun HistoryRegistrationScreen( | |
tagIdList.clear() | ||
} else { | ||
if (isHome) { | ||
appState.navController.navigate(HomeConstant.ROUTE) | ||
appState.navController.navigate(HomeConstant.ROUTE_STRUCTURE) | ||
} else { | ||
appState.navController.popBackStack() | ||
} | ||
|
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 enum 이라 bundle 에 못넣어요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HistoryRegistrationType요??
이거 잘 저장되는거 같은데 다른 문제가 있나요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
다시 찾아보니 enum 은 Serializable 이네요
https://developer.android.com/reference/kotlin/java/lang/Enum
문제 없을 것 같습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 LocalDate를 bundle에 넣으려면 년월일 나눠서 array로 저장하는게 최선인가요?