Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ class AttendeeFragment : Fragment() {
.observe(viewLifecycleOwner, Observer {
rootView.progressBarAttendee.isVisible = it
rootView.register.isEnabled = !it
rootView.register.text = if (!it) getString(R.string.register) else ""
rootView.register.backgroundTintList =
if (it) resources.getColorStateList(R.color.grey)
else resources.getColorStateList(R.color.colorAccent)
})

rootView.sameBuyerCheckBox.setOnCheckedChangeListener { buttonView, isChecked ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ class AttendeeViewModel(
.withDefaultSchedulers()
.doOnSubscribe {
mutableProgress.value = true
}.doFinally {
createAttendeeIterations++
if (createAttendeeIterations == totalAttendee)
mutableProgress.value = false
}.subscribe({
attendeesForOrder.add(it)
if (attendeesForOrder.size == totalAttendee) {
Expand Down Expand Up @@ -233,11 +229,7 @@ class AttendeeViewModel(
}
compositeDisposable += orderService.placeOrder(order)
.withDefaultSchedulers()
.doOnSubscribe {
mutableProgress.value = true
}.doFinally {
mutableProgress.value = false
}.subscribe({
.subscribe({
orderIdentifier = it.identifier.toString()
Timber.d("Success placing order!")
when (it.paymentMode) {
Expand All @@ -264,9 +256,7 @@ class AttendeeViewModel(
private fun confirmOrderStatus(identifier: String, order: ConfirmOrder) {
compositeDisposable += orderService.confirmOrder(identifier, order)
.withDefaultSchedulers()
.doOnSubscribe {
mutableProgress.value = true
}.doFinally {
.doFinally {
mutableProgress.value = false
}.subscribe({
mutableMessage.value = resource.getString(R.string.order_success_message)
Expand Down
45 changes: 26 additions & 19 deletions app/src/main/res/layout/fragment_attendee.xml
Original file line number Diff line number Diff line change
Expand Up @@ -585,28 +585,35 @@
android:layout_height="wrap_content" />
</LinearLayout>

<com.google.android.material.button.MaterialButton
android:id="@+id/register"
style="@style/AppTheme.MaterialButton.RoundedCorners"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="@dimen/details_margin_small"
android:layout_marginEnd="@dimen/details_margin_small"
android:layout_marginTop="@dimen/layout_margin_large"
android:layout_marginBottom="@dimen/layout_margin_large"
android:enabled="false"
android:text="@string/register"/>
</LinearLayout>
android:layout_gravity="center">

<ProgressBar
android:id="@+id/progressBarAttendee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:elevation="@dimen/card_elevation"
android:padding="@dimen/padding_small"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="@+id/register"
style="@style/AppTheme.MaterialButton.RoundedCorners"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/details_margin_small"
android:layout_marginEnd="@dimen/details_margin_small"
android:layout_marginTop="@dimen/layout_margin_large"
android:layout_marginBottom="@dimen/layout_margin_large"
android:enabled="false"
android:text="@string/register"/>

<ProgressBar
android:layout_centerInParent="true"
android:id="@+id/progressBarAttendee"
android:layout_width="@dimen/spinner_height"
android:layout_height="@dimen/spinner_width"
android:elevation="@dimen/card_elevation"
android:padding="@dimen/padding_small"
android:visibility="gone"
tools:visibility="visible"/>
</RelativeLayout>

</LinearLayout>
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.core.widget.NestedScrollView>