From 2e5f383991270d3b3b22f5fa39efe04438e3948a Mon Sep 17 00:00:00 2001 From: Choisehyeon <50761690+Choisehyeon@users.noreply.github.com> Date: Mon, 16 Oct 2023 00:05:54 +0900 Subject: [PATCH 1/4] =?UTF-8?q?refactor:=20=EA=B8=88=EC=95=A1=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=EC=8B=9C=20=EB=8B=A8=EC=9C=84=EA=B0=80=20=EB=B3=B4?= =?UTF-8?q?=EC=9D=BC=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=EA=B8=88=EC=95=A1=20=EC=B4=88=EA=B3=BC?= =?UTF-8?q?=20=EC=9E=85=EB=A0=A5=20=EC=8B=9C=EC=97=90=20=EA=B8=88=EC=95=A1?= =?UTF-8?q?=20=EC=A0=84=EC=B2=B4=EA=B0=80=20=EC=82=AC=EB=9D=BC=EC=A7=80?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EA=B3=A0=20=EC=9E=85=EB=A0=A5=EA=B0=92?= =?UTF-8?q?=EC=9D=B4=20=EB=B0=98=EC=98=81=EC=9D=B4=20=EC=95=88=EB=90=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/posteditor/PostEditorActivity.kt | 46 ++++++++++++++++++- .../ui/posteditor/PostEditorViewModel.kt | 4 +- .../main/res/layout/activity_post_editor.xml | 1 - 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/java/com/app/edonymyeon/presentation/ui/posteditor/PostEditorActivity.kt b/android/app/src/main/java/com/app/edonymyeon/presentation/ui/posteditor/PostEditorActivity.kt index de7ba0cfa..7d4ec0792 100644 --- a/android/app/src/main/java/com/app/edonymyeon/presentation/ui/posteditor/PostEditorActivity.kt +++ b/android/app/src/main/java/com/app/edonymyeon/presentation/ui/posteditor/PostEditorActivity.kt @@ -10,6 +10,9 @@ import android.net.Uri import android.os.Build import android.os.Bundle import android.provider.MediaStore +import android.text.Editable +import android.text.TextUtils +import android.text.TextWatcher import android.view.LayoutInflater import android.view.Menu import android.view.MenuItem @@ -29,6 +32,7 @@ import com.app.edonymyeon.presentation.util.makeSnackbar import com.app.edonymyeon.presentation.util.makeSnackbarWithEvent import com.domain.edonymyeon.model.PostEditor import dagger.hilt.android.AndroidEntryPoint +import java.text.DecimalFormat import java.time.LocalDateTime @AndroidEntryPoint @@ -83,6 +87,28 @@ class PostEditorActivity : BaseActivity if (!isValid) { binding.root.makeSnackbar(this.getString(R.string.dialog_input_price_error_message)) - binding.etPostPrice.setText("") + binding.etPostPrice.removeTextChangedListener(textWatcher) + binding.etPostPrice.setText(price) + binding.etPostPrice.setSelection(binding.etPostPrice.text.length) + binding.etPostPrice.addTextChangedListener(textWatcher) + } else { + price = + makeCommaNumber(binding.etPostPrice.text.toString().replace(",", "").toInt()) + binding.etPostPrice.setText(price) + binding.etPostPrice.setSelection(price.length) } } viewModel.isUpdateAble.observe(this) { isAble -> @@ -299,6 +334,15 @@ class PostEditorActivity : BaseActivity Date: Mon, 16 Oct 2023 21:34:15 +0900 Subject: [PATCH 2/4] =?UTF-8?q?refactor:=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/ui/posteditor/PostEditorActivity.kt | 11 ++++------- .../presentation/ui/posteditor/PostEditorViewModel.kt | 1 - 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/android/app/src/main/java/com/app/edonymyeon/presentation/ui/posteditor/PostEditorActivity.kt b/android/app/src/main/java/com/app/edonymyeon/presentation/ui/posteditor/PostEditorActivity.kt index f3cc1576d..f692e1b8c 100644 --- a/android/app/src/main/java/com/app/edonymyeon/presentation/ui/posteditor/PostEditorActivity.kt +++ b/android/app/src/main/java/com/app/edonymyeon/presentation/ui/posteditor/PostEditorActivity.kt @@ -31,7 +31,6 @@ import com.app.edonymyeon.presentation.util.makeSnackbarWithEvent import com.domain.edonymyeon.model.PostEditor import dagger.hilt.android.AndroidEntryPoint import java.io.File -import java.text.DecimalFormat @AndroidEntryPoint class PostEditorActivity : BaseActivity( @@ -174,7 +173,10 @@ class PostEditorActivity : BaseActivity Date: Mon, 16 Oct 2023 21:38:27 +0900 Subject: [PATCH 3/4] =?UTF-8?q?refactor:=20=EC=9E=85=EB=A0=A5=20=EA=B8=88?= =?UTF-8?q?=EC=95=A1=20=EC=98=A4=EB=A5=B8=EC=AA=BD=20=EC=A0=95=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/src/main/res/layout/activity_post_editor.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/android/app/src/main/res/layout/activity_post_editor.xml b/android/app/src/main/res/layout/activity_post_editor.xml index 00964b957..4369004ba 100644 --- a/android/app/src/main/res/layout/activity_post_editor.xml +++ b/android/app/src/main/res/layout/activity_post_editor.xml @@ -96,6 +96,7 @@ android:hint="@string/post_editor_price_hint" android:inputType="number" android:text="@{viewModel.postEditor.price}" + android:textAlignment="textEnd" android:textColor="@color/gray_434343" android:textColorHint="@color/gray_615f5f" android:textSize="14sp" From 223df05b6884ede8db4c84e969e253147a95be86 Mon Sep 17 00:00:00 2001 From: Choisehyeon <50761690+Choisehyeon@users.noreply.github.com> Date: Mon, 16 Oct 2023 21:41:15 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=EA=B8=80=20=EB=93=B1=EB=A1=9D?= =?UTF-8?q?=EC=8B=9C=20=EC=95=B1=EC=9D=B4=20=ED=84=B0=EC=A7=80=EB=8A=94=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edonymyeon/presentation/ui/posteditor/PostEditorActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/app/edonymyeon/presentation/ui/posteditor/PostEditorActivity.kt b/android/app/src/main/java/com/app/edonymyeon/presentation/ui/posteditor/PostEditorActivity.kt index f692e1b8c..19fc53634 100644 --- a/android/app/src/main/java/com/app/edonymyeon/presentation/ui/posteditor/PostEditorActivity.kt +++ b/android/app/src/main/java/com/app/edonymyeon/presentation/ui/posteditor/PostEditorActivity.kt @@ -245,7 +245,7 @@ class PostEditorActivity : BaseActivity viewModel.savePost(this, postEditor)