Skip to content

Commit

Permalink
#6 mypage_fragment/설정 화면 : 6 로그아웃 다이얼로그
Browse files Browse the repository at this point in the history
 - 로그아웃 다이얼로그 구현
  • Loading branch information
likppi10 committed Aug 27, 2022
1 parent ad86f6e commit 628db20
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 0 deletions.
37 changes: 37 additions & 0 deletions app/src/main/java/com/ftw/hometerview/ui/dialog/LogoutDialog.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.ftw.hometerview.ui.dialog

import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.DialogFragment
import com.ftw.hometerview.databinding.DialogLogoutBinding

class LogoutDialog(val logout: () -> Unit) : DialogFragment() {
private var _binding: DialogLogoutBinding? = null
private val binding get() = _binding!!

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
_binding = DialogLogoutBinding.inflate(inflater, container, false)
val view = binding.root
dialog?.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
binding.logoutSelect.setOnClickListener {
logout()
}
binding.logoutCancle.setOnClickListener {
dismiss()
}
return view
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
}
6 changes: 6 additions & 0 deletions app/src/main/res/drawable/round_background_white.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffffff"/>
<corners android:radius="16dp"/>
</shape>
83 changes: 83 additions & 0 deletions app/src/main/res/layout/dialog_logout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/round_background_white"
>

<View
android:id="@+id/divide_vertical_view"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_size_1"
android:background="@color/gray_300"
app:layout_constraintBottom_toTopOf="@+id/logout_cancle"
/>

<View
android:id="@+id/divide_horizontal_view"
android:layout_width="@dimen/dp_size_1"
android:layout_height="0dp"
android:background="@color/gray_300"
android:layout_marginHorizontal="@dimen/dp_size_1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/logout_select"
app:layout_constraintStart_toEndOf="@+id/logout_cancle"
app:layout_constraintTop_toBottomOf="@+id/divide_vertical_view"
/>

<TextView
android:id="@+id/logout_select"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/round_background_white"
android:fontFamily="@font/pretendard_semibold"
android:gravity="center"
android:paddingVertical="@dimen/dp_size_16"
android:text="@string/logout_select_text"
android:textColor="@color/blue_300"
android:textSize="@dimen/sp_size_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/divide_horizontal_view"
/>

<TextView
android:id="@+id/logout_cancle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:fontFamily="@font/pretendard_semibold"
android:gravity="center"
android:paddingVertical="@dimen/dp_size_16"
android:text="@string/logout_cancle_text"
android:textColor="@color/black"
android:textSize="@dimen/sp_size_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/divide_horizontal_view"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
/>

<TextView
android:id="@+id/logout_ask_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_size_48"
android:layout_marginBottom="@dimen/dp_size_48"
android:fontFamily="@font/pretendard_semibold"
android:text="@string/logout_ask_text"
android:textColor="@color/black"
android:textSize="@dimen/sp_size_16"
app:layout_constraintBottom_toTopOf="@+id/divide_vertical_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>

</androidx.constraintlayout.widget.ConstraintLayout>

</layout>
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,8 @@
<string name="withdrawal_second_check_text">회원 탈퇴 후 재가입하더라도 탈퇴 전의 회원 정보 및 서비스 이용 기록은 복구되지 않습니다.</string>
<string name="withdrawal_third_check_text">회원을 탈퇴하더라도 집터뷰 서비스에 기록한 리뷰, 댓글 등의 게시물은 삭제되지 않습니다. 회원을 퇄퇴하면, 개인정보가 삭제되며 게시물을 수정하거나 삭제할 수 없으니게시물 삭제가 필요한 회원은 게시물 삭제 후 탈퇴 신청하시기 바랍니다. </string>

<string name="logout_cancle_text">취소</string>
<string name="logout_ask_text">로그아웃 하시겠습니까?</string>
<string name="logout_select_text">확인</string>

</resources>

0 comments on commit 628db20

Please sign in to comment.