Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge: develop to release-v1.2.0 #630

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ android {
applicationId = "com.zzang.chongdae"
minSdk = 26
targetSdk = 34
versionCode = 6
versionName = "1.1.4"
versionCode = 7
versionName = "1.2.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments["runnerBuilder"] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ class ChongdaeFirebaseMessagingService : FirebaseMessagingService() {
when (notificationType) {
NotificationType.COMMENT_DETAIL -> {
intent = Intent(this, CommentDetailActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
intent.putExtra(EXTRA_OFFERING_ID_KEY, parsedOfferingId)
}

NotificationType.OFFERING_DETAIL -> {
intent = Intent(this, MainActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
intent.putExtra(NOTIFICATION_OFFERING_ID_KEY, parsedOfferingId)
intent.putExtra(NOTIFICATION_FLAG_KEY, true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ class CommentDetailViewModel
private val _event = MutableLiveData<Event<CommentDetailEvent>>()
val event: LiveData<Event<CommentDetailEvent>> get() = _event

private val _exitLoading: MutableLiveData<Boolean> = MutableLiveData(false)
val exitLoading: LiveData<Boolean> get() = _exitLoading

init {
startPolling()
updateCommentInfo()
Expand Down Expand Up @@ -207,6 +210,7 @@ class CommentDetailViewModel
}

private fun exitOffering() {
_exitLoading.value = true
viewModelScope.launch {
when (val result = participantRepository.deleteParticipations(offeringId)) {
is Result.Success -> {
Expand Down Expand Up @@ -237,6 +241,7 @@ class CommentDetailViewModel
}
}
}
_exitLoading.value = false
}
}

Expand All @@ -249,6 +254,7 @@ class CommentDetailViewModel
}

override fun onClickConfirm() {
_event.value = Event(CommentDetailEvent.AlertCancelled)
exitOffering()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ class OfferingWriteViewModel
private val _writeUIState = MutableLiveData<WriteUIState>(WriteUIState.Initial)
val writeUIState: LiveData<WriteUIState> get() = _writeUIState

val isLoading: LiveData<Boolean> = _writeUIState.map { it is WriteUIState.Loading }
val isImageUpLoading: LiveData<Boolean> = _writeUIState.map { it is WriteUIState.Loading }

private val _isSubmitLoading: MutableLiveData<Boolean> = MutableLiveData(false)
val isSubmitLoading: LiveData<Boolean> get() = _isSubmitLoading

init {
_essentialSubmitButtonEnabled.apply {
Expand Down Expand Up @@ -267,6 +270,7 @@ class OfferingWriteViewModel
}

fun postOffering() {
_isSubmitLoading.value = true
val title = title.value ?: return
val totalCount = totalCount.value ?: return
val totalPrice = totalPrice.value ?: return
Expand Down Expand Up @@ -308,7 +312,10 @@ class OfferingWriteViewModel
),
)
) {
is Result.Success -> makeSubmitOfferingEvent()
is Result.Success -> {
makeSubmitOfferingEvent()
_isSubmitLoading.value = false
}

is Result.Error -> {
Log.e("error", "postOffering: ${result.error}")
Expand All @@ -325,6 +332,7 @@ class OfferingWriteViewModel
WriteUIState.Error(R.string.write_error_writing, "${result.error}")
}
}
_isSubmitLoading.value = false
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions android/app/src/main/res/layout/activity_comment_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,20 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/horizon_line" />

<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminateTint="@color/main_color"
app:isVisible="@{vm.exitLoading}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.drawerlayout.widget.DrawerLayout>
</layout>

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="@dimen/size_80"
android:layout_height="@dimen/size_80"
android:indeterminateTint="@color/main_color"
app:isVisible="@{vm.isSubmitLoading}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<ScrollView
android:id="@+id/sv_main_write_optional"
android:layout_width="match_parent"
Expand Down Expand Up @@ -64,8 +75,8 @@
android:layout_width="@dimen/icon_size_20"
android:layout_height="@dimen/icon_size_20"
android:layout_marginEnd="@dimen/size_5"
app:debouncedOnClick="@{() -> vm.clearProductUrl()}"
android:src="@drawable/btn_offering_write_clear"
app:debouncedOnClick="@{() -> vm.clearProductUrl()}"
app:layout_constraintBottom_toBottomOf="@+id/et_purchase_link"
app:layout_constraintEnd_toEndOf="@+id/et_purchase_link"
app:layout_constraintTop_toTopOf="@+id/et_purchase_link" />
Expand All @@ -76,10 +87,10 @@
android:layout_height="@dimen/size_44"
android:background="@drawable/btn_background_selector"
android:enabled="@{vm.extractButtonEnabled}"
app:debouncedOnClick="@{() -> vm.postProductImageOg()}"
app:debounceTime="@{800L}"
android:text="@string/write_extract_image"
android:textColor="@color/white"
app:debounceTime="@{800L}"
app:debouncedOnClick="@{() -> vm.postProductImageOg()}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/et_purchase_link" />

Expand All @@ -97,10 +108,10 @@
android:layout_marginTop="@dimen/size_9"
android:background="@drawable/bg_radius_10dp"
android:clipToOutline="true"
app:debouncedOnClick="@{() -> vm.onUploadPhotoClick()}"
app:debounceTime="@{800L}"
android:scaleType="centerCrop"
android:src="@drawable/btn_upload_photo"
app:debounceTime="@{800L}"
app:debouncedOnClick="@{() -> vm.onUploadPhotoClick()}"
app:importProductImageUrl="@{vm.thumbnailUrl}"
app:layout_constraintStart_toStartOf="@id/tv_information_message_optional"
app:layout_constraintTop_toBottomOf="@id/tv_photo" />
Expand All @@ -109,7 +120,7 @@
android:id="@+id/progressBar"
android:layout_width="@dimen/size_20"
android:layout_height="@dimen/size_20"
app:isVisible="@{vm.isLoading}"
app:isVisible="@{vm.isImageUpLoading}"
app:layout_constraintBottom_toBottomOf="@+id/iv_upload_photo"
app:layout_constraintEnd_toEndOf="@+id/iv_upload_photo"
app:layout_constraintStart_toStartOf="@+id/iv_upload_photo"
Expand All @@ -119,8 +130,8 @@
android:id="@+id/iv_delete_image"
android:layout_width="@dimen/icon_size_30"
android:layout_height="@dimen/icon_size_30"
app:debouncedOnClick="@{() -> vm.clearProductImage()}"
android:src="@drawable/btn_offering_write_delete_image"
app:debouncedOnClick="@{() -> vm.clearProductImage()}"
app:isVisible="@{vm.deleteImageVisible}"
app:layout_constraintBottom_toTopOf="@+id/iv_upload_photo"
app:layout_constraintEnd_toEndOf="@+id/iv_upload_photo"
Expand Down Expand Up @@ -231,8 +242,8 @@
android:text="@{@string/write_current_description_count(vm.descriptionLength)}"
android:textColor="@color/main_color"
android:textSize="@dimen/font_size_12"
app:layout_constraintTop_toTopOf="@id/tv_total_description_count"
app:layout_constraintEnd_toStartOf="@id/tv_total_description_count"
app:layout_constraintTop_toTopOf="@id/tv_total_description_count"
tools:text="10자" />

<TextView
Expand Down Expand Up @@ -270,16 +281,17 @@
android:layout_marginBottom="@dimen/size_34"
android:background="@drawable/btn_background_selector"
android:fontFamily="@font/suit_medium"
app:debouncedOnClick="@{() -> vm.postOffering()}"
app:debounceTime="@{1200L}"
android:text="@string/write_start_offering"
android:textColor="@color/white"
android:textSize="@dimen/size_16"
app:debounceTime="@{1200L}"
app:debouncedOnClick="@{() -> vm.postOffering()}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="공동구매 시작하기!" />

</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
Expand Down
Loading