-
Notifications
You must be signed in to change notification settings - Fork 18
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
PWN-9014 - striga. kyc pending bottom sheet #1865
Merged
eduardmaximovich
merged 1 commit into
develop
from
feature/PWN-9014-striga-kyc-pending-bottomsheet
Jun 22, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 9 additions & 0 deletions
9
app/src/main/java/org/p2p/wallet/striga/finish/StrigaSignupFinishContract.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,9 @@ | ||
package org.p2p.wallet.striga.finish | ||
|
||
import org.p2p.wallet.common.mvp.MvpPresenter | ||
import org.p2p.wallet.common.mvp.MvpView | ||
|
||
interface StrigaSignupFinishContract { | ||
|
||
interface Presenter : MvpPresenter<MvpView> | ||
} |
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
21 changes: 21 additions & 0 deletions
21
app/src/main/java/org/p2p/wallet/striga/finish/StrigaSignupFinishPresenter.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,21 @@ | ||
package org.p2p.wallet.striga.finish | ||
|
||
import kotlinx.coroutines.launch | ||
import org.p2p.wallet.common.di.AppScope | ||
import org.p2p.wallet.common.mvp.BasePresenter | ||
import org.p2p.wallet.common.mvp.MvpView | ||
import org.p2p.wallet.infrastructure.dispatchers.CoroutineDispatchers | ||
import org.p2p.wallet.striga.user.interactor.StrigaUserInteractor | ||
|
||
class StrigaSignupFinishPresenter( | ||
private val strigaUserInteractor: StrigaUserInteractor, | ||
appScope: AppScope, | ||
dispatchers: CoroutineDispatchers, | ||
) : BasePresenter<MvpView>(dispatchers.ui), StrigaSignupFinishContract.Presenter { | ||
|
||
init { | ||
appScope.launch(dispatchers.io) { | ||
strigaUserInteractor.loadAndSaveUserStatusData() | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
app/src/main/java/org/p2p/wallet/striga/ui/StrigaKycPendingBottomSheet.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,37 @@ | ||
package org.p2p.wallet.striga.ui | ||
|
||
import androidx.fragment.app.FragmentManager | ||
import android.os.Bundle | ||
import android.view.View | ||
import org.p2p.wallet.R | ||
import org.p2p.wallet.common.mvp.BaseMvpBottomSheet | ||
import org.p2p.wallet.common.mvp.MvpView | ||
import org.p2p.wallet.common.mvp.NoOpPresenter | ||
import org.p2p.wallet.databinding.DialogStrigaKycPendingBinding | ||
import org.p2p.wallet.utils.viewbinding.viewBinding | ||
|
||
class StrigaKycPendingBottomSheet : | ||
BaseMvpBottomSheet<MvpView, NoOpPresenter<MvpView>>(R.layout.dialog_striga_kyc_pending) { | ||
|
||
companion object { | ||
fun show(fm: FragmentManager) { | ||
val tag = StrigaKycPendingBottomSheet::javaClass.name | ||
if (fm.findFragmentByTag(tag) != null) return | ||
StrigaKycPendingBottomSheet().show(fm, tag) | ||
} | ||
} | ||
|
||
override val presenter: NoOpPresenter<MvpView> = NoOpPresenter() | ||
|
||
private val binding: DialogStrigaKycPendingBinding by viewBinding() | ||
|
||
override fun getTheme(): Int = R.style.WalletTheme_BottomSheet_RoundedSnow | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
|
||
binding.buttonDone.setOnClickListener { | ||
dismiss() | ||
} | ||
} | ||
} |
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,80 @@ | ||
<?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" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="bottom" | ||
android:background="@drawable/bg_snow_rounded_16" | ||
android:backgroundTint="@color/bg_smoke"> | ||
|
||
<View | ||
android:id="@+id/viewPointer" | ||
android:layout_width="32dp" | ||
android:layout_height="4dp" | ||
android:layout_marginTop="6dp" | ||
android:background="@drawable/shape_bottomsheet_pointer" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<ImageView | ||
android:id="@+id/imageViewMain" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="32dp" | ||
android:src="@drawable/ic_clock" | ||
app:layout_constraintBottom_toTopOf="@id/textViewTitle" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/viewPointer" /> | ||
|
||
<TextView | ||
android:id="@+id/textViewTitle" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="24dp" | ||
android:paddingHorizontal="20dp" | ||
android:text="@string/striga_dialog_kyc_pending_title" | ||
android:textAlignment="center" | ||
android:textAppearance="@style/UiKit.TextAppearance.SemiBold.Title2" | ||
app:layout_constraintBottom_toTopOf="@id/textViewSubtitle" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/imageViewMain" /> | ||
|
||
<TextView | ||
android:id="@+id/textViewSubtitle" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="24dp" | ||
android:paddingHorizontal="20dp" | ||
android:text="@string/striga_dialog_kyc_pending_subtitle" | ||
android:textAlignment="center" | ||
android:textAppearance="@style/UiKit.TextAppearance.Regular.Text3" | ||
app:layout_constraintBottom_toTopOf="@id/buttonDone" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/textViewTitle" /> | ||
|
||
<org.p2p.uikit.components.UiKitButton | ||
android:id="@+id/buttonDone" | ||
style="@style/UiKit.Components.Button.Large" | ||
android:layout_width="match_parent" | ||
android:layout_height="@dimen/ui_kit_button_large_height" | ||
android:layout_marginHorizontal="16dp" | ||
android:layout_marginTop="64dp" | ||
android:backgroundTint="@color/night" | ||
android:text="@string/common_got_it" | ||
android:textColor="@color/lime" | ||
app:iconTint="@color/night" | ||
app:layout_constraintBottom_toTopOf="@id/space" | ||
app:layout_constraintTop_toBottomOf="@id/textViewSubtitle" /> | ||
|
||
<Space | ||
android:id="@+id/space" | ||
android:layout_width="0dp" | ||
android:layout_height="16dp" | ||
app:layout_constraintBottom_toBottomOf="parent" /> | ||
|
||
</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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe lifecycleScope.launch would be ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's safer to launch in a global context, who knows how quickly the response will arrive