Tweak Wallet creation screen (#22498)
This commit is contained in:
+33
-2
@@ -5,9 +5,15 @@
|
||||
|
||||
package org.chromium.chrome.browser.crypto_wallet.fragments.onboarding;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatButton;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatButton;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.crypto_wallet.fragments.BaseWalletNextPageFragment;
|
||||
|
||||
/**
|
||||
@@ -28,6 +34,8 @@ public abstract class BaseOnboardingWalletFragment extends BaseWalletNextPageFra
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nullable private AnimationDrawable mAnimationDrawable;
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
@@ -37,6 +45,29 @@ public abstract class BaseOnboardingWalletFragment extends BaseWalletNextPageFra
|
||||
// Show or hide back icon depending on the fragment configuration.
|
||||
mOnNextPage.showBackButton(canNavigateBack());
|
||||
}
|
||||
if (mAnimationDrawable != null) {
|
||||
mAnimationDrawable.start();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
if (mAnimationDrawable != null) {
|
||||
mAnimationDrawable.stop();
|
||||
}
|
||||
}
|
||||
|
||||
protected void setAnimatedBackground(@NonNull final View rootView) {
|
||||
mAnimationDrawable =
|
||||
(AnimationDrawable)
|
||||
ContextCompat.getDrawable(
|
||||
requireContext(), R.drawable.onboarding_gradient_animation);
|
||||
if (mAnimationDrawable != null) {
|
||||
rootView.setBackground(mAnimationDrawable);
|
||||
mAnimationDrawable.setEnterFadeDuration(10);
|
||||
mAnimationDrawable.setExitFadeDuration(5000);
|
||||
}
|
||||
}
|
||||
|
||||
protected void enable(@NonNull final AppCompatButton button, final boolean enable) {
|
||||
|
||||
+1
@@ -35,6 +35,7 @@ public class OnboardingCreatingWalletFragment extends BaseOnboardingWalletFragme
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
setAnimatedBackground(view.findViewById(R.id.creating_wallet_root));
|
||||
mOnboardingViewModel =
|
||||
new ViewModelProvider((ViewModelStoreOwner) requireActivity())
|
||||
.get(OnboardingViewModel.class);
|
||||
|
||||
+1
-17
@@ -6,7 +6,6 @@
|
||||
package org.chromium.chrome.browser.crypto_wallet.fragments.onboarding;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -16,7 +15,6 @@ import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import org.chromium.base.Log;
|
||||
@@ -37,7 +35,6 @@ public class OnboardingInitWalletFragment extends BaseOnboardingWalletFragment {
|
||||
private boolean mRestartSetupAction;
|
||||
private boolean mRestartRestoreAction;
|
||||
private boolean mButtonClicked;
|
||||
private AnimationDrawable mAnimationDrawable;
|
||||
|
||||
public OnboardingInitWalletFragment(boolean restartSetupAction, boolean restartRestoreAction) {
|
||||
mRestartSetupAction = restartSetupAction;
|
||||
@@ -63,13 +60,7 @@ public class OnboardingInitWalletFragment extends BaseOnboardingWalletFragment {
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mAnimationDrawable =
|
||||
(AnimationDrawable)
|
||||
ContextCompat.getDrawable(
|
||||
requireContext(), R.drawable.onboarding_gradient_animation);
|
||||
view.findViewById(R.id.setup_wallet_root).setBackground(mAnimationDrawable);
|
||||
mAnimationDrawable.setEnterFadeDuration(10);
|
||||
mAnimationDrawable.setExitFadeDuration(5000);
|
||||
setAnimatedBackground(view.findViewById(R.id.setup_wallet_root));
|
||||
|
||||
CardView newWallet = view.findViewById(R.id.new_wallet_card_view);
|
||||
newWallet.setOnClickListener(
|
||||
@@ -121,13 +112,6 @@ public class OnboardingInitWalletFragment extends BaseOnboardingWalletFragment {
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mButtonClicked = false;
|
||||
mAnimationDrawable.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mAnimationDrawable.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,13 +2,11 @@
|
||||
<androidx.core.widget.NestedScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/creating_wallet_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
android:fadeScrollbars="false"
|
||||
android:background="@color/wallet_bg"
|
||||
android:fillViewport="true"
|
||||
android:theme="@style/BraveWalletOnboarding">
|
||||
android:scrollbars="none"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -18,23 +16,33 @@
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/btn_loading"
|
||||
style="?android:progressBarStyleLarge"
|
||||
style="Widget.ProgressBar.Large"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:indeterminateTint="@color/brave_action_color"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<TextView
|
||||
style="@style/BraveWalletTextViewTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/creating_wallet_onboarding_text"
|
||||
android:textColor="@color/wallet_text_color"
|
||||
android:lineSpacingExtra="2sp"
|
||||
android:textSize="22sp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="@string/creating_wallet_onboarding_text"
|
||||
android:textColor="@color/wallet_text_color"
|
||||
android:textSize="32sp"/>
|
||||
android:text="@string/creating_wallet_subtitle_text"
|
||||
android:textColor="@color/wallet_onboarding_secondary_text_color"
|
||||
android:lineSpacingExtra="4sp"
|
||||
android:textSize="14sp"/>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
android:fadeScrollbars="false"
|
||||
android:fillViewport="true"
|
||||
android:theme="@style/BraveWalletOnboarding">
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user