-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add success screen for transaction execution submission (#1944)
* Add success screen for transaction execution submission * Adjust navigation
- Loading branch information
1 parent
5618217
commit b6329c0
Showing
9 changed files
with
151 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
app/src/main/java/io/gnosis/safe/ui/transactions/execution/TxSuccessFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package io.gnosis.safe.ui.transactions.execution | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.activity.OnBackPressedCallback | ||
import androidx.navigation.fragment.findNavController | ||
import io.gnosis.safe.R | ||
import io.gnosis.safe.ScreenId | ||
import io.gnosis.safe.databinding.FragmentTxSuccessBinding | ||
import io.gnosis.safe.di.components.ViewComponent | ||
import io.gnosis.safe.ui.base.fragment.BaseViewBindingFragment | ||
|
||
class TxSuccessFragment: BaseViewBindingFragment<FragmentTxSuccessBinding>() { | ||
|
||
override fun screenId() = ScreenId.TRANSACTIONS_SUCCESS_SIGNER | ||
|
||
override fun inject(component: ViewComponent) { | ||
component.inject(this) | ||
} | ||
|
||
override fun inflateBinding( | ||
inflater: LayoutInflater, | ||
container: ViewGroup? | ||
): FragmentTxSuccessBinding = | ||
FragmentTxSuccessBinding.inflate(inflater, container, false) | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
// disable default back navigation | ||
requireActivity().onBackPressedDispatcher.addCallback( | ||
viewLifecycleOwner, | ||
object : OnBackPressedCallback(true) { | ||
override fun handleOnBackPressed() {} | ||
}) | ||
with(binding) { | ||
doneButton.setOnClickListener { | ||
findNavController().popBackStack(R.id.transactionDetailsFragment, false) | ||
} | ||
} | ||
} | ||
|
||
override fun onResume() { | ||
super.onResume() | ||
binding.lottieSuccess.playAnimation() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<com.airbnb.lottie.LottieAnimationView | ||
android:id="@+id/lottie_success" | ||
android:layout_width="112dp" | ||
android:layout_height="112dp" | ||
app:layout_constraintVertical_chainStyle="packed" | ||
app:layout_constraintBottom_toTopOf="@+id/title" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.5" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:lottie_rawRes="@raw/success" /> | ||
|
||
<TextView | ||
android:id="@+id/title" | ||
style="@style/H6Headline" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="32dp" | ||
android:text="@string/tx_submitted" | ||
android:textSize="17sp" | ||
app:layout_constraintBottom_toTopOf="@+id/description" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.5" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/lottie_success" | ||
app:layout_constraintVertical_chainStyle="packed" /> | ||
|
||
<TextView | ||
android:id="@+id/description" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="56dp" | ||
android:layout_marginTop="12dp" | ||
android:layout_marginEnd="56dp" | ||
android:gravity="center" | ||
android:text="@string/tx_submitted_desc" | ||
android:textSize="17sp" | ||
app:layout_constraintBottom_toTopOf="@+id/done_button" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/title" | ||
app:layout_constraintVertical_chainStyle="packed" /> | ||
|
||
<Button | ||
android:id="@+id/done_button" | ||
style="@style/PrimaryButton" | ||
android:layout_width="0dp" | ||
android:layout_marginStart="@dimen/default_margin" | ||
android:layout_marginTop="24dp" | ||
android:layout_marginEnd="@dimen/default_margin" | ||
android:text="@string/tx_submitted_done" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/description" | ||
app:layout_constraintVertical_chainStyle="packed" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters