-
Notifications
You must be signed in to change notification settings - Fork 966
(Wallet) Tweak onboarding navigation controls #21673
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
Conversation
d1d241f
to
58588fc
Compare
[puLL-Merge] - brave/brave-core@21673 DescriptionThe pull request contains a set of changes aimed at restructuring the onboarding flow for the Brave Wallet feature within the Brave browser for Android. The changes suggest a refactor of fragment classes used during the crypto wallet setup, including renaming of classes and files also modifying the flow of user navigation through the onboarding process. Additionally, unused static variables from the Utils class have been removed. ChangesChangesChanges organized by filename: android/brave_java_sources.gni
BraveWalletActivity.java
CryptoWalletOnboardingPagerAdapter.java
RecoveryPhraseAdapter.java
BaseWalletNextPageFragment.java (New file)
UnlockWalletFragment.java
Onboarding Fragments (New files)
Utils.java
activity_brave_wallet.xml
brave_colors.xml (both day and night)
Security Hotspots
|
mCryptoWalletOnboardingViewPager.addOnPageChangeListener( | ||
new ViewPager.OnPageChangeListener() { | ||
@Override | ||
public void onPageScrolled( | ||
int position, float positionOffset, int positionOffsetPixels) {} | ||
|
||
@Override | ||
public void onPageSelected(int position) { | ||
if (position == 0 || position == 2) { | ||
onboardingBackButton.setVisibility(View.GONE); | ||
} else { | ||
onboardingBackButton.setVisibility(View.VISIBLE); | ||
} |
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.
This logic is not required anymore as now each fragment can be individually configured overriding the abstract methods canBeClosed
, canNavigateBack
.
@@ -281,7 +282,55 @@ private void setNavigationFragments(int type) { | |||
addRemoveSecureFlag(true); | |||
} | |||
|
|||
private void addRemoveSecureFlag(boolean add) { | |||
private void replaceNavigationFragments(@NonNull final WalletAction walletAction) { |
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.
This method has been moved below setNavigationFragments
but remains unchanged.
@@ -417,49 +417,71 @@ public boolean showBiometricPrompt() { | |||
} | |||
|
|||
@Override | |||
public void showBiometricPrompt(boolean show) { | |||
mShowBiometricPrompt = show; | |||
public void enableBiometricPrompt() { |
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.
Renamed showBiometricPrompt
to enableBiometricPrompt
.
Removed boolean from signature as always true
.
public static RestoreWalletFragment newInstance(boolean isOnboarding) { | ||
RestoreWalletFragment fragment = new RestoreWalletFragment(); | ||
Bundle args = new Bundle(); | ||
args.putBoolean(IS_ONBOARDING, isOnboarding); | ||
fragment.setArguments(args); | ||
return fragment; | ||
} |
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.
Removed arguments from RestoreWalletFragment
instance creation because unused.
|
||
import org.chromium.chrome.browser.crypto_wallet.listeners.OnNextPage; | ||
|
||
public class CryptoOnboardingFragment extends Fragment { |
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.
Fragment renamed to BaseOnboardingWalletFragment
.
return biometricManager.canAuthenticate() == BiometricManager.BIOMETRIC_SUCCESS; | ||
} else { | ||
// For API level < Q, we will use FingerprintManagerCompat to check enrolled | ||
// fingerprints. Note that for API level lower than 23, FingerprintManagerCompat behaves | ||
// like no fingerprint hardware and no enrolled fingerprints. | ||
FingerprintManagerCompat fingerprintManager = FingerprintManagerCompat.from(context); | ||
return fingerprintManager != null && fingerprintManager.isHardwareDetected() | ||
return fingerprintManager.isHardwareDetected() |
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.
Optimized check as fingerprintManager
is always not null.
android/java/org/chromium/chrome/browser/crypto_wallet/activities/BraveWalletActivity.java
Outdated
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/crypto_wallet/adapters/RecoveryPhraseAdapter.java
Outdated
Show resolved
Hide resolved
...chromium/chrome/browser/crypto_wallet/fragments/onboarding/BaseOnboardingWalletFragment.java
Outdated
Show resolved
Hide resolved
The security team is monitoring all repositories for certain keywords. This PR includes the word(s) "password" and so security team members have been added as reviewers to take a look. |
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.
++
Resolves brave/brave-browser#35488
OnNextPage
interface.BaseWalletNetPageFragment
.CryptoOnboardingFragment
.org.chromium.chrome.browser.crypto_wallet.fragments.onboarding_fragments
toorg.chromium.chrome.browser.crypto_wallet.fragments.onboarding
.Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run lint
,npm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
⚠ Note for QA: the goal of the plan is to verify close and back buttons. The onboarding flow may slightly differ when testing will happen.