Skip to content

Commit

Permalink
Merge pull request #76 from TeamPINGLE/feat-setting-view
Browse files Browse the repository at this point in the history
[feat] 더보기 뷰 구현
  • Loading branch information
Dan2dani authored Jan 9, 2024
2 parents 1536046 + 9fda8b9 commit 7e295ad
Show file tree
Hide file tree
Showing 5 changed files with 233 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.fragment.app.commit
import androidx.fragment.app.replace
import dagger.hilt.android.AndroidEntryPoint
import org.sopt.pingle.R
import org.sopt.pingle.databinding.ActivityMainBinding
import org.sopt.pingle.presentation.ui.main.commend.CommendFragment
Expand All @@ -14,6 +15,7 @@ import org.sopt.pingle.presentation.ui.main.plan.PlanActivity
import org.sopt.pingle.presentation.ui.main.setting.SettingFragment
import org.sopt.pingle.util.base.BindingActivity

@AndroidEntryPoint
class MainActivity : BindingActivity<ActivityMainBinding>(R.layout.activity_main) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,65 @@ package org.sopt.pingle.presentation.ui.main.setting

import android.os.Bundle
import android.view.View
import dagger.hilt.android.AndroidEntryPoint
import org.sopt.pingle.BuildConfig
import org.sopt.pingle.R
import org.sopt.pingle.databinding.FragmentSettingBinding
import org.sopt.pingle.util.base.BindingFragment
import org.sopt.pingle.util.component.AllModalDialogFragment

@AndroidEntryPoint
class SettingFragment : BindingFragment<FragmentSettingBinding>(R.layout.fragment_setting) {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

initLayout()
addListeners()
}

private fun initLayout() {
binding.tvSettingVersionContent.text = BuildConfig.VERSION_NAME.toString()
}

private fun addListeners() {
binding.tvSettingLogoutTitle.setOnClickListener {
showLogoutDialogFragment()
}
binding.tvSettingWithdrawTitle.setOnClickListener {
showWithDrawLogoutDialogFragment()
}
}

private fun showLogoutDialogFragment() {
AllModalDialogFragment(
title = getString(R.string.setting_logout_modal_title),
detail = getString(R.string.setting_logout_modal_detail),
buttonText = getString(R.string.setting_modal_back),
textButtonText = getString(R.string.setting_logout_modal_btn_text),
clickBtn = {},
clickTextBtn = {
// TODO 로그아웃 서버통신
},
onDialogClosed = {}
).show(parentFragmentManager, LOGOUT_MODAL)
}

private fun showWithDrawLogoutDialogFragment() {
AllModalDialogFragment(
title = getString(R.string.setting_withdraw_modal_title),
detail = getString(R.string.setting_withdraw_modal_detail),
buttonText = getString(R.string.setting_modal_back),
textButtonText = getString(R.string.setting_withdraw_modal_btn_text),
clickBtn = { },
clickTextBtn = {
// TODO 회원탈퇴 서버통신
},
onDialogClosed = {}
).show(parentFragmentManager, WITHDRAW_MODAL)
}

companion object {
private const val LOGOUT_MODAL = "logoutModal"
private const val WITHDRAW_MODAL = "withModal"
}
}
4 changes: 0 additions & 4 deletions app/src/main/res/layout/activity_plan_announcement.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
android:layout_height="wrap_content"
android:layout_marginStart="21dp"
android:layout_marginTop="48dp"
android:text="@string/plan_announcement_title"
android:textAppearance="@style/TextAppearance.Pingle.Title.Semi.24"
android:textColor="@color/white"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -39,7 +38,6 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="21dp"
android:text="@string/plan_announcement_detail_top"
android:textAppearance="@style/TextAppearance.Pingle.Body.Med.16"
android:textColor="@color/g_04"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -51,7 +49,6 @@
android:layout_height="wrap_content"
android:layout_marginStart="21dp"
android:layout_marginTop="@dimen/spacing4"
android:text="@string/plan_announcement_detail_bottom"
android:textAppearance="@style/TextAppearance.Pingle.Body.Med.16"
android:textColor="@color/g_04"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -76,7 +73,6 @@
android:layout_marginTop="@dimen/spacing28"
android:layout_marginBottom="54dp"
android:backgroundTint="@color/g_01"
android:text="@string/plan_announcement_button"
android:textColor="@color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
168 changes: 161 additions & 7 deletions app/src/main/res/layout/fragment_setting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,173 @@

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".presentation.ui.main.setting.SettingFragment">
android:layout_height="match_parent">

<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="@dimen/spacing16" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_end="@dimen/spacing16" />

<TextView
android:id="@+id/tv_setting_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="설정"
android:textAppearance="@style/TextAppearance.Pingle.Title.Semi.32"
android:layout_marginTop="31dp"
android:text="@string/setting_title"
android:textAppearance="@font/suit_semibold"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:textSize="18dp"
app:layout_constraintStart_toEndOf="@id/gl_start"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_setting_nickName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:textAppearance="@style/TextAppearance.Pingle.Sub.Semi.18"
android:textColor="@color/white"
app:layout_constraintStart_toStartOf="@+id/tv_setting_title"
app:layout_constraintTop_toBottomOf="@+id/tv_setting_title"
tools:text="김핑글" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_setting_my_group"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing20"
android:background="@drawable/shape_border_radius_12"
android:backgroundTint="#252930"
android:paddingVertical="@dimen/spacing14"
android:paddingStart="@dimen/spacing14"
app:layout_constraintEnd_toStartOf="@+id/gl_end"
app:layout_constraintStart_toStartOf="@+id/gl_start"
app:layout_constraintTop_toBottomOf="@id/tv_setting_nickName">

<TextView
android:id="@+id/tv_setting_my_group_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/setting_my_group"
android:textAppearance="@style/TextAppearance.Pingle.Cap.Med.12"
android:textColor="@color/g_03"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_setting_my_group_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textAppearance="@style/TextAppearance.Pingle.Sub.Bold.18"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_setting_my_group_title"
tools:text="SOPT" />

<ImageView
android:id="@+id/iv_setting_move_to_my_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing10"
android:src="@drawable/ic_all_arrow_right_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

<TextView
android:id="@+id/tv_setting_contact_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:paddingVertical="@dimen/spacing14"
android:paddingStart="4dp"
android:text="@string/setting_contact_title"
android:textAppearance="@style/TextAppearance.Pingle.Body.Med.16"
android:textColor="@color/white"
app:layout_constraintEnd_toStartOf="@+id/gl_end"
app:layout_constraintStart_toStartOf="@+id/gl_start"
app:layout_constraintTop_toBottomOf="@id/layout_setting_my_group" />

<TextView
android:id="@+id/tv_setting_notice_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingVertical="@dimen/spacing14"
android:paddingStart="4dp"
android:text="@string/setting_notice_title"
android:textAppearance="@style/TextAppearance.Pingle.Body.Med.16"
android:textColor="@color/white"
app:layout_constraintEnd_toStartOf="@+id/gl_end"
app:layout_constraintStart_toStartOf="@+id/gl_start"
app:layout_constraintTop_toBottomOf="@id/tv_setting_contact_title" />

<TextView
android:id="@+id/tv_setting_version_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="@dimen/spacing14"
android:paddingStart="4dp"
android:text="@string/setting_version_title"
android:textAppearance="@style/TextAppearance.Pingle.Body.Med.16"
android:textColor="@color/white"
app:layout_constraintStart_toStartOf="@+id/gl_start"
app:layout_constraintTop_toBottomOf="@+id/tv_setting_notice_title" />

<TextView
android:id="@+id/tv_setting_version_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:textColor="@color/g_03"
app:layout_constraintBottom_toBottomOf="@+id/tv_setting_version_title"
app:layout_constraintEnd_toStartOf="@+id/gl_end"
app:layout_constraintTop_toTopOf="@+id/tv_setting_version_title"
tools:text="0.0.0" />

<View
android:id="@+id/view_setting_divider"
android:layout_width="0dp"
android:layout_height="1dp"
android:background="@color/g_08"
app:layout_constraintEnd_toStartOf="@id/gl_end"
app:layout_constraintStart_toEndOf="@id/gl_start"
app:layout_constraintTop_toBottomOf="@+id/tv_setting_version_title" />

<TextView
android:id="@+id/tv_setting_logout_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingVertical="@dimen/spacing14"
android:paddingStart="4dp"
android:text="@string/setting_logout_title"
android:textAppearance="@style/TextAppearance.Pingle.Body.Med.16"
android:textColor="@color/white"
app:layout_constraintEnd_toStartOf="@+id/gl_end"
app:layout_constraintStart_toStartOf="@+id/gl_start"
app:layout_constraintTop_toBottomOf="@+id/view_setting_divider" />

<TextView
android:id="@+id/tv_setting_withdraw_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="4dp"
android:paddingVertical="@dimen/spacing14"
android:text="@string/setting_withdraw_title"
android:textAppearance="@style/TextAppearance.Pingle.Cap.Semi.12"
android:textColor="@color/g_06"
app:layout_constraintEnd_toStartOf="@+id/gl_end"
app:layout_constraintTop_toBottomOf="@+id/tv_setting_logout_title" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
24 changes: 17 additions & 7 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<string name="plan_open_chatting_title">오픈채팅방 링크를\n추가해주세요!</string>
<string name="plan_open_chatting_hint">링크를 입력해주세요</string>
<string name="plan_open_chatting_text_title">채팅방 링크</string>
<string name="plan_announcement_detail_top">%s과 %s의 합성어로,</string>

<!-- plan modal -->
<string name="plan_exit_modal_dialog_title">잠깐! 나가실건가요?</string>
Expand Down Expand Up @@ -123,18 +124,27 @@
<string name="plan_summary_confirmation_location">장소</string>
<string name="plan_summary_confirmation_recruitment">모집인원</string>
<string name="plan_summary_confirmation_recruitment_number">%s명</string>
]
]
<!-- plan recruitment -->
<string name="plan_recruitment_title">몇 명의 친구들과\n만날까요?</string>
<string name="plan_recruitment_description">본인을 포함하여,\n최소 1명부터 참여 인원을 선택해주세요</string>
<string name="plan_recruitment_minus">-</string>
<string name="plan_recruitment_plus">+</string>
<string name="plan_recruitment_snackbar">최대 선택 가능 인원은 99명이에요!</string>

<!-- plan announcement -->
<string name="plan_announcement_title">What is\nPINGLE?</string>
<string name="plan_announcement_detail_top">%s과 %s의 합성어로,</string>
<string name="plan_announcement_detail_bottom">원하는 장소에서 사람들과 갖는 모임을 뜻해요</string>
<string name="plan_announcement_description">핑글에 함께할 사람들, @@들을 만나러 가볼까요?</string>
<string name="plan_announcement_button">핑글 개최하러 가기</string>
<!-- setting -->
<string name="setting_contact_title">문의하기</string>
<string name="setting_notice_title">공지사항</string>
<string name="setting_version_title">버전</string>
<string name="setting_logout_title">로그아웃</string>
<string name="setting_withdraw_title">탈퇴하기</string>
<string name="setting_title">더보기</string>
<string name="setting_my_group">나의 단체</string>
<string name="setting_logout_modal_title">정말로 로그아웃 하실건가요?</string>
<string name="setting_logout_modal_detail">카카오 계정을 로그아웃합니다</string>
<string name="setting_modal_back">돌아기기</string>
<string name="setting_logout_modal_btn_text">로그아웃</string>
<string name="setting_withdraw_modal_title">정말로 탈퇴하실건가요?</string>
<string name="setting_withdraw_modal_detail">탈퇴 시 계정은 삭제되며 복구할 수 없어요</string>
<string name="setting_withdraw_modal_btn_text">탈퇴하기</string>
</resources>

0 comments on commit 7e295ad

Please sign in to comment.