-
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
[REFACTOR/#129] 익스텐션 분리 및 전체적인 QA 후 수정 #136
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
a30d3ae
[refactor/#129] 이모지 글자 포함 글자 수 세는 함수 extention으로 변경
chattymin cffdd58
[refactor/#129] 온보딩 확장함수 적용
chattymin ba0927d
[refactor/#129] 온보딩 확장함수 적용
chattymin ee1ce81
Merge branch 'develop' into refactor/#129-convert-extention
chattymin 6391aed
[refactor/#129] profile spacer 추가
chattymin f12dfa0
[fix/#129] profile 재검사에서 뒤로 갈 경우 화면이 꺼지지 않던 기능 수정
chattymin b0f09db
[fix/#129] 뒤로가기 위치 수정
chattymin e6c9133
[fix/#129] 이미지 수정
chattymin c4469e2
[fix/#129] intent 수정 및 미사용 아이콘 삭제
chattymin f7af051
[fix/#129] setting 프로필 -> 여행 프로필 string 변경
chattymin 02819f9
[fix/#129] 완료 버튼 클릭시 대시보드로 이동
chattymin c697b73
[fix/#129] 설정 회원탈퇴버튼 bottom margin 수정 및 아이콘 위치 수정
chattymin 692e5c6
[refactor/#129] 이미지 다운로드 기능 확장함수로 분리
chattymin 4ade603
[refactor/#129] 이미지 다운로드 확장함수 적용 및 리스트 분리
chattymin d290035
[refactor/#129] OnBackPressedListener 익스텐션 분리
chattymin f6cb684
[refactor/#129] OnBackPressedListener 익스텐션 적용
chattymin 288fc74
[refactor/#129] statusBar color 설정
chattymin fa96dee
Merge branch 'develop' into refactor/#129-convert-extention
chattymin a83bd4f
[ADD/#129] 뒤로가기 버튼 추가 및 기능 연결
chattymin 989802b
[ADD/#129] 뒤로가기 버튼 추가 및 기능 연결
chattymin 94a0464
[FEAT/#129] BulletPoit 익스텐션 분리~
chattymin 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,30 @@ | ||
package com.going.ui.extension | ||
|
||
import android.text.SpannableString | ||
import android.text.Spanned | ||
import android.text.style.BulletSpan | ||
import java.text.BreakIterator | ||
|
||
fun String?.isJsonObject(): Boolean = this?.startsWith("{") == true && this.endsWith("}") | ||
|
||
fun String?.isJsonArray(): Boolean = this?.startsWith("[") == true && this.endsWith("]") | ||
|
||
fun String.getGraphemeLength(): Int { | ||
val breakIterator: BreakIterator = BreakIterator.getCharacterInstance() | ||
|
||
breakIterator.setText(this) | ||
|
||
var count = 0 | ||
while (breakIterator.next() != BreakIterator.DONE) { | ||
count++ | ||
} | ||
|
||
return count | ||
} | ||
|
||
fun String.setBulletPoint(): SpannableString { | ||
val string = SpannableString(this) | ||
string.setSpan(BulletSpan(10), 0, this.length - 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) | ||
|
||
return 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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ package com.going.presentation.entertrip.createtrip.choosedate | |
import androidx.lifecycle.MutableLiveData | ||
import androidx.lifecycle.ViewModel | ||
import com.going.domain.entity.NameState | ||
import java.text.BreakIterator | ||
import com.going.ui.extension.getGraphemeLength | ||
|
||
class CreateTripViewModel : ViewModel() { | ||
val name = MutableLiveData<String>() | ||
|
@@ -24,11 +24,10 @@ class CreateTripViewModel : ViewModel() { | |
val isTripAvailable = MutableLiveData(false) | ||
var isCheckTripAvailable = MutableLiveData(false) | ||
|
||
|
||
fun getMaxNameLen() = MAX_TRIP_LEN | ||
|
||
fun checkNameAvailable() { | ||
nameLength.value = getGraphemeLength(name.value) | ||
nameLength.value = name.value?.getGraphemeLength() | ||
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. 수정 감샤합니다 꾸벅 |
||
|
||
isNameAvailable.value = when { | ||
nameLength.value == 0 -> NameState.Empty | ||
|
@@ -42,18 +41,6 @@ class CreateTripViewModel : ViewModel() { | |
(isNameAvailable.value == NameState.Success) && isInfoAvailable | ||
|
||
checkTripAvailable() | ||
|
||
} | ||
|
||
private fun getGraphemeLength(value: String?): Int { | ||
BREAK_ITERATOR.setText(value) | ||
|
||
var count = 0 | ||
while (BREAK_ITERATOR.next() != BreakIterator.DONE) { | ||
count++ | ||
} | ||
|
||
return count | ||
} | ||
|
||
fun checkStartDateAvailable() { | ||
|
@@ -79,11 +66,7 @@ class CreateTripViewModel : ViewModel() { | |
(isTripAvailable.value == true && isStartDateAvailable.value == true && isEndDateAvailable.value == true) | ||
} | ||
|
||
|
||
companion object { | ||
val BREAK_ITERATOR: BreakIterator = BreakIterator.getCharacterInstance() | ||
const val MAX_TRIP_LEN = 15 | ||
} | ||
} | ||
|
||
|
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.
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.
아~~~주 깔~~~~~~~꼼해졌ㄴ네요~~~~~~~~~~~