Skip to content

Commit

Permalink
Merge branch 'develop' into design/#25
Browse files Browse the repository at this point in the history
  • Loading branch information
yeoncheong authored Jul 10, 2023
2 parents b3e23fa + c562932 commit b8a6c4a
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.sopt.umbba_android.presentation.qna

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import androidx.fragment.app.DialogFragment
import com.sopt.umbba_android.databinding.FragmentConfirmAnswerDialogBinding

class BackAnswerDialogFragment : DialogFragment() {

private var _binding: FragmentConfirmAnswerDialogBinding? = null
private val binding get() = requireNotNull(_binding) { "BackAnswerDialogFragment is null" }

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View {
_binding = FragmentConfirmAnswerDialogBinding.inflate(inflater, container, false)
return binding.root
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

}

override fun onResume() {
super.onResume()
dialog?.window?.setLayout(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.WRAP_CONTENT
)
}

override fun onDestroy() {
super.onDestroy()
_binding = null
}
}
63 changes: 63 additions & 0 deletions app/src/main/res/layout/fragment_back_answer_dialog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?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">

<data>

</data>

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

<TextView
android:id="@+id/tv_confirm"
style="@style/AndroidBody1_2Regular16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="24dp"
android:gravity="center"
android:text="@string/back_confirm"
android:textColor="@color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="33dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="23dp"
app:layout_constraintTop_toBottomOf="@id/tv_confirm"
app:layout_constraintBottom_toBottomOf="parent">

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_cancel"
style="@style/AndroidBody1_2Regular16"
android:layout_width="124dp"
android:layout_height="48dp"
android:background="@drawable/shape_grey_btn_r50_stroke_rect"
android:text="@string/cancel"
android:textColor="@color/grey_btn_text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_save"
style="@style/AndroidBody1_2Regular16"
android:layout_width="124dp"
android:layout_height="48dp"
android:layout_marginStart="13dp"
android:background="@drawable/shape_grey74_btn_r50_rect"
android:text="@string/confirm"
android:textColor="@color/white"
app:layout_constraintStart_toEndOf="@id/btn_cancel"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
5 changes: 5 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,9 @@
<string name="list">리스트</string>
<string name="question_number">#%d</string>

<!-- back answer dialog fragment-->
<string name="back_confirm">답변 작성을 취소하시겠습니까?\n 작성 중인 답변은 저장되지 않습니다.</string>
<string name="cancel">취소</string>
<string name="confirm">확인</string>

</resources>

0 comments on commit b8a6c4a

Please sign in to comment.