Skip to content

Commit 2ec3841

Browse files
committed
[IDLE-000] fontScale에 따라 강제 업데이트 다이얼로그 높이가 바뀌도록 변경
1 parent d13b6d5 commit 2ec3841

3 files changed

Lines changed: 71 additions & 53 deletions

File tree

presentation/src/main/java/com/idle/presentation/MainActivity.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import com.idle.analytics.businessmetric.AnalyticsHelper
2929
import com.idle.auth.AuthFragmentDirections
3030
import com.idle.binding.MainEvent
3131
import com.idle.binding.ShareJobPostingInfo
32+
import com.idle.binding.ToastType
3233
import com.idle.binding.repeatOnStarted
3334
import com.idle.designsystem.binding.component.dismissToast
3435
import com.idle.designsystem.binding.component.showToast
@@ -205,7 +206,7 @@ class MainActivity : AppCompatActivity() {
205206

206207
private fun showForceUpdateDialog(info: ForceUpdate) {
207208
val currentVersion = packageManager.getPackageInfo(packageName, 0).versionName
208-
if (checkShouldUpdate(currentVersion, info.minVersion)) {
209+
if (!checkShouldUpdate(currentVersion, info.minVersion)) {
209210
forceUpdateFragment = ForceUpdateFragment(info).apply { isCancelable = false }
210211
forceUpdateFragment.show(supportFragmentManager, forceUpdateFragment.tag)
211212
}
@@ -254,8 +255,16 @@ class MainActivity : AppCompatActivity() {
254255

255256
private fun handleDeepLink(deepLink: DeepLink) {
256257
try {
257-
val sharedJobPostingId = deepLink.getStringValue("deep_link_value")
258+
val sharedJobPostingId = deepLink.deepLinkValue
258259
val sharedJobPostingType = deepLink.getStringValue("deep_link_sub1")
260+
261+
showToast(
262+
this,
263+
"sharedJobPostingId: $sharedJobPostingId, sharedJobPostingTpye : $sharedJobPostingType",
264+
toastType = ToastType.SUCCESS,
265+
paddingBottom = 50
266+
)
267+
259268
viewModel.setSharedJobPostingInfo(
260269
SharedJobPostingInfo(
261270
jobPostingId = sharedJobPostingId ?: return,

presentation/src/main/java/com/idle/presentation/forceupdate/ForceUpdateFragment.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ class ForceUpdateFragment(private val forceUpdate: ForceUpdate) : DialogFragment
6464

6565
override fun onStart() {
6666
super.onStart()
67-
resizeDialog(1f, 0.25f)
67+
val fontScale = resources.configuration.fontScale
68+
resizeDialog(1f, 0.4f * fontScale)
6869
}
6970

7071
private fun resizeDialog(width: Float, height: Float) {

presentation/src/main/res/layout/fragment_force_update.xml

Lines changed: 58 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -8,62 +8,70 @@
88
type="com.idle.presentation.forceupdate.ForceUpdateViewModel" />
99
</data>
1010

11-
<LinearLayout
11+
<ScrollView
1212
android:layout_width="match_parent"
13-
android:layout_height="wrap_content"
14-
android:background="@drawable/shape_dialog"
15-
android:gravity="center"
16-
android:orientation="vertical"
17-
android:paddingHorizontal="12dp"
18-
android:paddingTop="20dp"
19-
android:paddingBottom="12dp">
20-
21-
<TextView
22-
style="@style/Subtitle1"
23-
android:layout_width="wrap_content"
24-
android:layout_height="wrap_content"
25-
android:layout_marginBottom="8dp"
26-
android:text="@string/app_update_title"
27-
android:textAlignment="center"
28-
android:textColor="@color/gray_900" />
29-
30-
<TextView
31-
style="@style/Body3"
32-
android:layout_width="wrap_content"
33-
android:layout_height="wrap_content"
34-
android:layout_marginBottom="24dp"
35-
android:text="@{viewModel.forceUpdate.noticeMsg}"
36-
android:textAlignment="center"
37-
android:textColor="@color/gray_500" />
13+
android:layout_height="wrap_content">
3814

3915
<LinearLayout
4016
android:layout_width="match_parent"
4117
android:layout_height="wrap_content"
42-
android:orientation="horizontal">
18+
android:background="@drawable/shape_dialog"
19+
android:gravity="center"
20+
android:orientation="vertical"
21+
android:paddingHorizontal="12dp"
22+
android:paddingTop="20dp"
23+
android:paddingBottom="12dp">
24+
25+
<TextView
26+
style="@style/Subtitle1"
27+
android:layout_width="wrap_content"
28+
android:layout_height="wrap_content"
29+
android:layout_marginBottom="8dp"
30+
android:text="@string/app_update_title"
31+
android:textAlignment="center"
32+
android:textColor="@color/gray_900" />
33+
34+
<TextView
35+
style="@style/Body3"
36+
android:layout_width="wrap_content"
37+
android:layout_height="wrap_content"
38+
android:layout_marginBottom="24dp"
39+
android:text="유저분들의 의견을 반영해 앱을 더 발전시켰어요.\n
40+
보다 좋은 서비스를 만나기 위해, 업데이트해주세요."
41+
android:textAlignment="center"
42+
android:maxLines="4"
43+
android:ellipsize="end"
44+
android:textColor="@color/gray_500" />
45+
46+
<LinearLayout
47+
android:layout_width="match_parent"
48+
android:layout_height="wrap_content"
49+
android:orientation="horizontal">
4350

44-
<Button
45-
android:id="@+id/dialog_left_BTN"
46-
style="@style/Heading4"
47-
android:layout_width="0dp"
48-
android:layout_height="52dp"
49-
android:layout_marginEnd="8dp"
50-
android:layout_weight="1"
51-
android:background="@drawable/shape_button_white"
52-
android:onClick="@{()->viewModel.dismiss()}"
53-
android:text="@string/end_short"
54-
android:textColor="@color/gray_300" />
51+
<Button
52+
android:id="@+id/dialog_left_BTN"
53+
style="@style/Heading4"
54+
android:layout_width="0dp"
55+
android:layout_height="52dp"
56+
android:layout_marginEnd="8dp"
57+
android:layout_weight="1"
58+
android:background="@drawable/shape_button_white"
59+
android:onClick="@{()->viewModel.dismiss()}"
60+
android:text="@string/end_short"
61+
android:textColor="@color/gray_300" />
5562

56-
<Button
57-
android:id="@+id/dialog_right_BTN"
58-
style="@style/Heading4"
59-
android:layout_width="0dp"
60-
android:layout_height="52dp"
61-
android:layout_weight="1"
62-
android:background="@drawable/shape_button_red"
63-
android:backgroundTint="@color/orange_500"
64-
android:onClick="@{()->viewModel.update()}"
65-
android:text="@string/app_update"
66-
android:textColor="@color/white" />
63+
<Button
64+
android:id="@+id/dialog_right_BTN"
65+
style="@style/Heading4"
66+
android:layout_width="0dp"
67+
android:layout_height="52dp"
68+
android:layout_weight="1"
69+
android:background="@drawable/shape_button_red"
70+
android:backgroundTint="@color/orange_500"
71+
android:onClick="@{()->viewModel.update()}"
72+
android:text="@string/app_update"
73+
android:textColor="@color/white" />
74+
</LinearLayout>
6775
</LinearLayout>
68-
</LinearLayout>
76+
</ScrollView>
6977
</layout>

0 commit comments

Comments
 (0)