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

Refactor : 권한 다이어로그 수정 #241

Merged
merged 13 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ class PermissionDialog(
dialog?.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))

// 제목, 내용 설정
binding.customTvTitle.text = title
binding.customTvContent.text = content
binding.tvDialogPermissionTitle.text = title
binding.tvDialogPermissionContent.text = content

// 취소 버튼
binding.customTvBtn1.setOnClickListener {
binding.tvDialogPermissionCancel.setOnClickListener {
cancelListener?.invoke()
dismiss()
}

// 확인 버튼
binding.customTvBtn2.setOnClickListener {
binding.tvDialogPermissionComplete.setOnClickListener {
val intent =
Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).setData(Uri.parse("package:$pacakageName"))
startActivity(intent)
Expand Down
24 changes: 11 additions & 13 deletions app/src/main/res/layout/dialog_permission.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,55 @@
android:background="@drawable/bg_stroke_gray300_radius_2dp">

<TextView
android:id="@+id/customTvTitle"
android:id="@+id/tv_dialog_permission_title"
style="@style/PretendardBold20"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="24dp"
android:text="제목"
android:hint="@string/dialog_permission_early_title"
android:textColor="@color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/customTvContent"
android:id="@+id/tv_dialog_permission_content"
style="@style/PretendardMedium16"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="20dp"
android:text="내용"
android:hint="@string/dialog_permission_early_content"
android:textAlignment="center"
android:textColor="@color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/customTvTitle" />
app:layout_constraintTop_toBottomOf="@+id/tv_dialog_permission_title" />

<TextView
android:id="@+id/customTvBtn1"
android:id="@+id/tv_dialog_permission_cancel"
style="@style/PretendardSemiBold16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginEnd="28dp"
android:layout_marginBottom="20dp"
android:text="취소"
android:hint="@string/dialog_permission_early_cancel"
android:textColor="@color/blue300"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/customTvBtn2"
app:layout_constraintTop_toBottomOf="@+id/customTvContent" />
app:layout_constraintEnd_toStartOf="@+id/tv_dialog_permission_complete"
app:layout_constraintTop_toBottomOf="@+id/tv_dialog_permission_content" />

<TextView
android:id="@+id/customTvBtn2"
android:id="@+id/tv_dialog_permission_complete"
style="@style/PretendardSemiBold16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="30dp"
android:layout_marginBottom="20dp"
android:text="설정 화면 이동"
android:hint="@string/dialog_permission_early_complete"
android:textColor="@color/blue300"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />


</androidx.constraintlayout.widget.ConstraintLayout>
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,8 @@
<!-- permission dialog -->
<string name="dialog_permission_title">기기 알림이 꺼져있습니다.</string>
<string name="dialog_permission_content"><![CDATA[알림 설정(DMforU 설정 > 개인정보 보호 > 알림)을 활성화해야 공지 사항에 대한 키워드를 받을 수 있습니다.]]></string>
<string name="dialog_permission_early_title">제목</string>
<string name="dialog_permission_early_content">내용</string>
<string name="dialog_permission_early_cancel">취소</string>
<string name="dialog_permission_early_complete">설정 화면 이동</string>
</resources>
Loading