diff --git a/android/app/src/main/java/com/happy/friendogly/presentation/ui/playground/util/PlaygroundBindingAdapter.kt b/android/app/src/main/java/com/happy/friendogly/presentation/ui/playground/util/PlaygroundBindingAdapter.kt index b175f0da3..906851755 100644 --- a/android/app/src/main/java/com/happy/friendogly/presentation/ui/playground/util/PlaygroundBindingAdapter.kt +++ b/android/app/src/main/java/com/happy/friendogly/presentation/ui/playground/util/PlaygroundBindingAdapter.kt @@ -1,7 +1,5 @@ package com.happy.friendogly.presentation.ui.playground.util -import android.content.res.Resources -import android.util.TypedValue import android.view.View import android.widget.FrameLayout import android.widget.ImageButton @@ -22,9 +20,6 @@ import kotlinx.datetime.LocalDate import kotlinx.datetime.toJavaLocalDate import java.time.Period -private const val MARGIN_BOTTOM_DEFAULT = 26 -private const val MARGIN_BOTTOM_PLAYING = 106 - @BindingAdapter("petAge") fun TextView.bindPetAge(petBirthDate: LocalDate?) { if (petBirthDate != null) { @@ -147,22 +142,16 @@ fun TextView.bindRegisterPlaygroundBtnClickable(uiState: PlaygroundUiState?) { @BindingAdapter("btnMargin") fun View.bindBtnMargin(playStatus: PlayStatus?) { - fun Int.dp(): Int { - val metrics = Resources.getSystem().displayMetrics - return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, this.toFloat(), metrics) - .toInt() - } - val marginBottom = if (playStatus != PlayStatus.NO_PLAYGROUND) { - MARGIN_BOTTOM_PLAYING + resources.getDimension(R.dimen.location_btn_margin_bottom_playing) } else { - MARGIN_BOTTOM_DEFAULT + resources.getDimension(R.dimen.location_btn_margin_bottom_default) } val layoutParams = this.layoutParams as ConstraintLayout.LayoutParams layoutParams.apply { - bottomMargin = marginBottom.dp() + bottomMargin = marginBottom.toInt() } this.layoutParams = layoutParams diff --git a/android/app/src/main/res/layout-sw600dp/fragment_playground.xml b/android/app/src/main/res/layout-sw600dp/fragment_playground.xml new file mode 100644 index 000000000..b017973cf --- /dev/null +++ b/android/app/src/main/res/layout-sw600dp/fragment_playground.xml @@ -0,0 +1,460 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/values-sw600dp/dimens.xml b/android/app/src/main/res/values-sw600dp/dimens.xml new file mode 100644 index 000000000..2d0af932c --- /dev/null +++ b/android/app/src/main/res/values-sw600dp/dimens.xml @@ -0,0 +1,5 @@ + + + 66dp + 196dp + \ No newline at end of file diff --git a/android/app/src/main/res/values/dimens.xml b/android/app/src/main/res/values/dimens.xml new file mode 100644 index 000000000..cf339529f --- /dev/null +++ b/android/app/src/main/res/values/dimens.xml @@ -0,0 +1,5 @@ + + + 26dp + 106dp + \ No newline at end of file