From 811753f37a734b3be27a1327e608045bff39fa11 Mon Sep 17 00:00:00 2001 From: krrong Date: Mon, 2 Oct 2023 18:39:37 +0900 Subject: [PATCH 01/11] =?UTF-8?q?refactor:=20=EC=97=85=EB=A1=9C=EB=93=9C?= =?UTF-8?q?=20=EB=B7=B0=20=EB=94=94=EC=9E=90=EC=9D=B8=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/upload/UploadActivity.kt | 15 +- .../src/main/res/layout/activity_upload.xml | 152 +++++++----------- android/app/src/main/res/values/strings.xml | 7 +- android/app/src/main/res/values/themes.xml | 1 + .../UploadViewModelTestWithRobolectric.kt | 2 +- 5 files changed, 61 insertions(+), 116 deletions(-) diff --git a/android/app/src/main/java/com/now/naaga/presentation/upload/UploadActivity.kt b/android/app/src/main/java/com/now/naaga/presentation/upload/UploadActivity.kt index 57320dc7d..0f22fb812 100644 --- a/android/app/src/main/java/com/now/naaga/presentation/upload/UploadActivity.kt +++ b/android/app/src/main/java/com/now/naaga/presentation/upload/UploadActivity.kt @@ -25,7 +25,6 @@ import com.now.naaga.R import com.now.naaga.data.firebase.analytics.AnalyticsDelegate import com.now.naaga.data.firebase.analytics.DefaultAnalyticsDelegate import com.now.naaga.data.firebase.analytics.UPLOAD_OPEN_CAMERA -import com.now.naaga.data.firebase.analytics.UPLOAD_SET_COORDINATE import com.now.naaga.data.throwable.DataThrowable import com.now.naaga.databinding.ActivityUploadBinding import com.now.naaga.presentation.beginadventure.LocationPermissionDialog @@ -140,11 +139,7 @@ class UploadActivity : AppCompatActivity(), AnalyticsDelegate by DefaultAnalytic val fusedLocationClient = LocationServices.getFusedLocationProviderClient(this) fusedLocationClient.getCurrentLocation(PRIORITY_HIGH_ACCURACY, createCancellationToken()) .addOnSuccessListener { location -> - if (location != null) { - val coordinate = getCoordinate(location) - binding.tvUploadPhotoCoordinate.text = coordinate.toText() - viewModel.setCoordinate(coordinate) - } + location.let { viewModel.setCoordinate(getCoordinate(location)) } } .addOnFailureListener { } } @@ -178,18 +173,10 @@ class UploadActivity : AppCompatActivity(), AnalyticsDelegate by DefaultAnalytic logClickEvent(getViewEntryName(it), UPLOAD_OPEN_CAMERA) checkCameraPermission() } - binding.ivUploadPhoto.setOnClickListener { logClickEvent(getViewEntryName(it), UPLOAD_OPEN_CAMERA) checkCameraPermission() } - binding.ivUploadPhotoCoordinate.setOnClickListener { - logClickEvent(getViewEntryName(it), UPLOAD_SET_COORDINATE) - checkLocationPermission() - } - binding.ivUploadClose.setOnClickListener { - finish() - } binding.btnUploadSubmit.setOnClickListener { if (isFormValid().not()) { shortToast(getString(R.string.upload_error_insufficient_info_message)) diff --git a/android/app/src/main/res/layout/activity_upload.xml b/android/app/src/main/res/layout/activity_upload.xml index e391422c7..129f2ad09 100644 --- a/android/app/src/main/res/layout/activity_upload.xml +++ b/android/app/src/main/res/layout/activity_upload.xml @@ -33,17 +33,40 @@ app:lottie_loop="true" app:lottie_rawRes="@raw/simple_loading" /> + + + + + app:layout_constraintTop_toBottomOf="@id/tv_upload_activity_title" /> - - - - - + app:layout_constraintTop_toBottomOf="@id/iv_upload_photo" /> - - + android:layout_marginHorizontal="@dimen/space_default_large" + android:layout_marginTop="@dimen/space_default_medium" + android:background="@color/white" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/tv_upload_title" /> - - + android:maxLines="1" + android:text="@={viewModel.name}" + android:textAlignment="textEnd" + android:textColor="@color/white" + android:textSize="28sp" + app:layout_constraintEnd_toEndOf="@id/v_upload_divide_line_1" + app:layout_constraintStart_toStartOf="@id/v_upload_divide_line_1" + app:layout_constraintTop_toBottomOf="@id/tv_upload_title" + tools:text="선정릉 돌담길" />