diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/main/home/map/MapModalDialogFragment.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/main/home/map/MapModalDialogFragment.kt new file mode 100644 index 00000000..b2a628a2 --- /dev/null +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/main/home/map/MapModalDialogFragment.kt @@ -0,0 +1,40 @@ +package org.sopt.pingle.presentation.ui.main.home.map + +import android.os.Bundle +import android.view.View +import org.sopt.pingle.R +import org.sopt.pingle.databinding.DialogMapModalBinding +import org.sopt.pingle.presentation.type.CategoryType +import org.sopt.pingle.util.base.BindingDialogFragment +import org.sopt.pingle.util.fragment.colorOf + +class MapModalDialogFragment( + private val category: CategoryType, + private val name: String, + private val ownerName: String, + private val clickBtn: () -> Unit +) : BindingDialogFragment(R.layout.dialog_map_modal) { + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + initLayout() + addListeners() + } + + private fun initLayout() { + with(binding) { + badgeMapModalPingleInfoCategory.setBadgeCategoryType(category) + tvMapModalPingleInfoName.text = name + tvMapModalPingleInfoName.setTextColor(colorOf(category.textColor)) + tvMapModalPingleInfoOwnerName.text = ownerName + } + } + + private fun addListeners() { + binding.btnMapModal.setOnClickListener { + clickBtn() + dismiss() + } + } +} diff --git a/app/src/main/java/org/sopt/pingle/util/base/BindingDialogFragment.kt b/app/src/main/java/org/sopt/pingle/util/base/BindingDialogFragment.kt index 4c0a235a..9f974049 100644 --- a/app/src/main/java/org/sopt/pingle/util/base/BindingDialogFragment.kt +++ b/app/src/main/java/org/sopt/pingle/util/base/BindingDialogFragment.kt @@ -9,6 +9,7 @@ import androidx.annotation.LayoutRes import androidx.databinding.DataBindingUtil import androidx.databinding.ViewDataBinding import androidx.fragment.app.DialogFragment +import org.sopt.pingle.R abstract class BindingDialogFragment(@LayoutRes private val layoutResId: Int) : DialogFragment() { @@ -31,7 +32,7 @@ abstract class BindingDialogFragment(@LayoutRes private val WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT ) - dialog?.window?.setBackgroundDrawableResource(android.R.color.transparent) + dialog?.window?.setBackgroundDrawableResource(R.color.backdrop) dialog?.setCancelable(false) dialog?.setCanceledOnTouchOutside(true) } diff --git a/app/src/main/java/org/sopt/pingle/util/component/PingleBadge.kt b/app/src/main/java/org/sopt/pingle/util/component/PingleBadge.kt index 11742f6e..ccc55577 100644 --- a/app/src/main/java/org/sopt/pingle/util/component/PingleBadge.kt +++ b/app/src/main/java/org/sopt/pingle/util/component/PingleBadge.kt @@ -8,6 +8,8 @@ import android.view.LayoutInflater import androidx.constraintlayout.widget.ConstraintLayout import org.sopt.pingle.databinding.BadgePingleBinding import org.sopt.pingle.presentation.type.CategoryType +import org.sopt.pingle.util.view.colorOf +import org.sopt.pingle.util.view.stringOf @SuppressLint("CustomViewStyleable") class PingleBadge @JvmOverloads constructor( @@ -23,10 +25,10 @@ class PingleBadge @JvmOverloads constructor( fun setBadgeCategoryType(categoryType: CategoryType) { with(binding.tvBadgePingleText) { - text = context.getText(categoryType.categoryNameRes) - setTextColor(context.getColor(categoryType.textColor)) + text = stringOf(categoryType.categoryNameRes) + setTextColor(colorOf(categoryType.textColor)) backgroundTintList = - ColorStateList.valueOf(context.getColor(categoryType.backgroundBadgeColor)) + ColorStateList.valueOf(colorOf(categoryType.backgroundBadgeColor)) } } } diff --git a/app/src/main/java/org/sopt/pingle/util/component/PingleChip.kt b/app/src/main/java/org/sopt/pingle/util/component/PingleChip.kt index ed5a3fa1..3f2353ed 100644 --- a/app/src/main/java/org/sopt/pingle/util/component/PingleChip.kt +++ b/app/src/main/java/org/sopt/pingle/util/component/PingleChip.kt @@ -4,10 +4,11 @@ import android.annotation.SuppressLint import android.content.Context import android.content.res.ColorStateList import android.util.AttributeSet -import androidx.core.content.ContextCompat import com.google.android.material.chip.Chip import org.sopt.pingle.R import org.sopt.pingle.presentation.type.CategoryType +import org.sopt.pingle.util.view.colorOf +import org.sopt.pingle.util.view.stringOf @SuppressLint("CustomViewStyleable") class PingleChip @JvmOverloads constructor( @@ -29,8 +30,8 @@ class PingleChip @JvmOverloads constructor( intArrayOf(-android.R.attr.state_checked) ), intArrayOf( - ContextCompat.getColor(context, activatedColorRes), - ContextCompat.getColor(context, inactivatedColorRes) + colorOf(activatedColorRes), + colorOf(inactivatedColorRes) ) ) @@ -41,7 +42,7 @@ class PingleChip @JvmOverloads constructor( val inactivatedTextColor = R.color.g_03 val inactivatedChipColor = R.color.g_11 - text = context.getText(categoryType.categoryNameRes) + text = stringOf(categoryType.categoryNameRes) chipStrokeColor = setColorStateList( context = context, activatedColorRes = categoryType.activatedOutLinedColor, diff --git a/app/src/main/java/org/sopt/pingle/util/view/ViewExt.kt b/app/src/main/java/org/sopt/pingle/util/view/ViewExt.kt index dd73459c..3a70b93b 100644 --- a/app/src/main/java/org/sopt/pingle/util/view/ViewExt.kt +++ b/app/src/main/java/org/sopt/pingle/util/view/ViewExt.kt @@ -1,6 +1,11 @@ package org.sopt.pingle.util.view import android.view.View +import androidx.annotation.ColorRes +import androidx.annotation.DrawableRes +import androidx.annotation.StringRes +import androidx.core.content.ContextCompat +import androidx.core.content.ContextCompat.getString import androidx.recyclerview.widget.DiffUtil import com.google.android.material.snackbar.Snackbar @@ -25,6 +30,12 @@ fun View.showSnackBar(message: String, isShort: Boolean = true) { Snackbar.make(this, message, duration).show() } +fun View.stringOf(@StringRes resId: Int) = getString(context, resId) + +fun View.colorOf(@ColorRes resId: Int) = ContextCompat.getColor(context, resId) + +fun View.drawableOf(@DrawableRes resId: Int) = ContextCompat.getDrawable(context, resId) + class ItemDiffCallback( val onItemsTheSame: (T, T) -> Boolean, val onContentsTheSame: (T, T) -> Boolean diff --git a/app/src/main/res/layout/dialog_map_modal.xml b/app/src/main/res/layout/dialog_map_modal.xml new file mode 100644 index 00000000..83dba59b --- /dev/null +++ b/app/src/main/res/layout/dialog_map_modal.xml @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 1e0f5e48..920bb21f 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -33,16 +33,20 @@ 60dp - + 56dp 42dp 42dp 10dp - + 50dp - + 4dp + + + 24dp + 24dp \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d50e51b5..a7b931e2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -19,15 +19,21 @@ 기존 단체\n입장하기 신규 단체\n개설하기 + + 입장하기 + 단체 입장\n완료! + %s에서 + 핑글 여정을 함께해보세요! + 나중에 만드시겠어요? 나가기 다음으로 핑글 개최하기 - - 입장하기 - 단체 입장\n완료! - %s에서 - 핑글 여정을 함께해보세요! + + 참여하기 + + + 이 핑글에 참여할까요? \ No newline at end of file