Skip to content

Commit def32e0

Browse files
[feat]
1. 하이픈 사용 설정 여부 제거(하이픈은 한국 번호의 경우, 기본으로 붙이도록 지정)
1 parent 010d8f3 commit def32e0

File tree

5 files changed

+2
-66
lines changed

5 files changed

+2
-66
lines changed

app/src/main/java/ch/lock/mobile/android/deviceinfo/data/local/datastore/setting/SettingDataStore.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ val Context.dataStore by preferencesDataStore(
1616
)
1717

1818
data class SettingPref(
19-
/**
20-
* 전화번호에 하이픈 표시 여부
21-
*/
22-
val isUseHyphen: Boolean,
23-
2419
/**
2520
* 화면 캡쳐 차단 여부
2621
*/
@@ -36,7 +31,6 @@ class SettingPrefRepository(
3631
}
3732

3833
object PrefKeys {
39-
val IS_USE_HYPHEN = booleanPreferencesKey("IS_USE_HYPHEN")
4034
val IS_CAPTURE_BLOCK = booleanPreferencesKey("IS_CAPTURE_BLOCK")
4135
}
4236

@@ -45,23 +39,16 @@ class SettingPrefRepository(
4539
mapSettingPreferences(pref)
4640
}
4741

48-
suspend fun updateIsUseHyphen(isUseHyphen: Boolean) = dataStore.edit { pref ->
49-
pref[PrefKeys.IS_USE_HYPHEN] = isUseHyphen
50-
}
51-
5242
suspend fun updateIsCaptureBlock(isCaptureBlock: Boolean) = dataStore.edit { pref ->
5343
pref[PrefKeys.IS_CAPTURE_BLOCK] = isCaptureBlock
5444
}
5545

5646
private fun mapSettingPreferences(preferences: Preferences): SettingPref {
57-
// 하이픈 사용 여부
58-
val isUseHyphen: Boolean = preferences[PrefKeys.IS_USE_HYPHEN] ?: false
5947

6048
// 화면 캡쳐 차단 여부
6149
val isCaptureBlock: Boolean = preferences[PrefKeys.IS_CAPTURE_BLOCK] ?: true
6250

6351
return SettingPref(
64-
isUseHyphen = isUseHyphen,
6552
isCaptureBlock = isCaptureBlock
6653
)
6754
}

app/src/main/java/ch/lock/mobile/android/deviceinfo/ui/setting/SettingViewModel.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ class SettingViewModel(
1414
const val TAG: String = "SettingViewModel"
1515
}
1616

17-
/**
18-
* 하이픈 사용 여부 설정
19-
*/
20-
val isUseHyphen: MutableLiveData<Boolean> =
21-
(settingPrefRepository.settingPrefFlow.map {
22-
it.isUseHyphen
23-
}.asLiveData() as MutableLiveData<Boolean>)
24-
2517
/**
2618
* 캡쳐 방지 여부 설정
2719
*/
@@ -32,11 +24,6 @@ class SettingViewModel(
3224

3325
init {
3426
viewModelScope.launch {
35-
launch {
36-
isUseHyphen.asFlow().collect {
37-
settingPrefRepository.updateIsUseHyphen(it)
38-
}
39-
}
4027
launch {
4128
isCaptureBlock.asFlow().collect {
4229
settingPrefRepository.updateIsCaptureBlock(it)

app/src/main/java/ch/lock/mobile/android/deviceinfo/utils/FormatUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ open class FormatUtils {
1313
*/
1414
open fun toLocalPhoneNumber(
1515
internationalNumber: String?,
16-
includeHyphen: Boolean
16+
includeHyphen: Boolean = true
1717
): String {
1818
if (internationalNumber.isNullOrEmpty()) return "유심을 장착 혹은 정상적으로 인식되지 않아 확인 불가"
1919

app/src/main/java/ch/lock/mobile/android/deviceinfo/utils/SimUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ open class SimUtils(
5656
*/
5757
open val phoneNumber: String
5858
get() = try {
59-
formatUtils.toLocalPhoneNumber(globalPhoneNumber, true)
59+
formatUtils.toLocalPhoneNumber(globalPhoneNumber)
6060
} catch (e: Exception) {
6161
""
6262
}

app/src/main/res/layout/activity_setting.xml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -26,44 +26,6 @@
2626
app:header_type="2"
2727
app:layout_constraintTop_toTopOf="parent" />
2828

29-
<!-- 전화번호 표시 시 하이픈 사용 여부 설정 레이아웃 -->
30-
<androidx.constraintlayout.widget.ConstraintLayout
31-
android:id="@+id/layout_hyphen_setting"
32-
android:layout_width="match_parent"
33-
android:layout_height="wrap_content"
34-
android:layout_marginTop="1dp"
35-
android:background="@color/white"
36-
android:focusableInTouchMode="false">
37-
38-
<TextView
39-
android:id="@+id/TextView_is_use_hyphen"
40-
android:layout_width="wrap_content"
41-
android:layout_height="wrap_content"
42-
android:layout_marginStart="15dp"
43-
android:layout_marginTop="15dp"
44-
android:layout_marginBottom="15dp"
45-
android:focusable="false"
46-
android:text="@string/is_use_hyphen"
47-
android:textColor="@color/black"
48-
android:textSize="16sp"
49-
app:layout_constraintBottom_toBottomOf="parent"
50-
app:layout_constraintStart_toStartOf="parent"
51-
app:layout_constraintTop_toTopOf="parent" />
52-
53-
<androidx.appcompat.widget.SwitchCompat
54-
android:id="@+id/switch_is_use_hyphen_setting"
55-
android:layout_width="wrap_content"
56-
android:layout_height="wrap_content"
57-
android:layout_marginTop="15dp"
58-
android:layout_marginEnd="15dp"
59-
android:checked="@={viewModel.isUseHyphen()}"
60-
android:focusable="false"
61-
app:layout_constraintBottom_toBottomOf="@id/TextView_is_use_hyphen"
62-
app:layout_constraintEnd_toEndOf="parent"
63-
app:layout_constraintTop_toTopOf="@id/TextView_is_use_hyphen" />
64-
65-
</androidx.constraintlayout.widget.ConstraintLayout>
66-
6729
<!-- 화면 캡쳐 차단 여부 설정 레이아웃 -->
6830
<androidx.constraintlayout.widget.ConstraintLayout
6931
android:id="@+id/layout_capture_block_setting"

0 commit comments

Comments
 (0)