Skip to content

Commit

Permalink
chore: remove animation and add new splash screen (#11148)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This PR aims to replace metamask animation for a static native splash
screen.


## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**
All the recordings were using the same device:
Huawei P30 pro Android 10 (EMUI 12)

### **Before**
No account imported (Measured with QA APK - 5.52 seconds)

https://github.com/user-attachments/assets/207c7c19-dd05-4ae4-b215-5800014c2bc9

Account imported  (Measured with QA APK - ~5.85 seconds)

https://github.com/user-attachments/assets/257599a1-bece-47af-bd3a-afdc6a5bb461



### **After**
No account imported (Measured with QA APK - ~3 seconds)

https://github.com/user-attachments/assets/1d7b1df5-fbb9-460c-8068-ca5964134258


Account imported (Measured with QA APK - ~3 seconds)

https://github.com/user-attachments/assets/82610139-7317-40c8-9e14-12982e638f5b

Dark Mode:

https://github.com/user-attachments/assets/cebbbbf5-1254-47b4-a204-573e3e4ab934

Light Mode:

https://github.com/user-attachments/assets/dc68e6bb-fa37-426d-ac2a-65f361fa325c



## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: Cal-L <[email protected]>
  • Loading branch information
tommasini and Cal-L authored Sep 19, 2024
1 parent 726ca82 commit 0eb8076
Show file tree
Hide file tree
Showing 59 changed files with 552 additions and 444 deletions.
4 changes: 0 additions & 4 deletions android/app/src/main/java/io/metamask/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
import io.branch.rnbranch.*;
import android.content.Intent;
import android.os.Bundle;

import org.devio.rn.splashscreen.SplashScreen;

import java.util.ArrayList;
import java.util.Arrays;

Expand All @@ -37,7 +34,6 @@ protected void onStart() {

@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this);
super.onCreate(null);
}

Expand Down
9 changes: 9 additions & 0 deletions android/app/src/main/res/drawable-night/app_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/theme" />
<item>
<bitmap
android:src="@drawable/fox"
android:gravity="center"
android:tileMode="disabled" />
</item>
</layer-list>
Binary file removed android/app/src/main/res/drawable-night/diamond.png
Binary file not shown.
Binary file added android/app/src/main/res/drawable-night/fox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions android/app/src/main/res/drawable/app_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/theme" />
<item>
<bitmap
android:src="@drawable/fox"
android:gravity="center"
android:tileMode="disabled" />
</item>
</layer-list>
13 changes: 0 additions & 13 deletions android/app/src/main/res/drawable/background_splash.xml

This file was deleted.

Binary file removed android/app/src/main/res/drawable/diamond.png
Binary file not shown.
Binary file added android/app/src/main/res/drawable/fox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed android/app/src/main/res/drawable/screen.png
Binary file not shown.
6 changes: 6 additions & 0 deletions android/app/src/main/res/layout-night/launch_screen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent" android:background="@color/theme">
<ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/fox" android:scaleType="center" />
</RelativeLayout>
2 changes: 1 addition & 1 deletion android/app/src/main/res/layout/launch_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent" android:background="@color/theme">
<ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/diamond" android:scaleType="center" />
<ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/fox" android:scaleType="center" />
</RelativeLayout>
3 changes: 3 additions & 0 deletions android/app/src/main/res/values-night/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">MetaMask</string>
</resources>
23 changes: 23 additions & 0 deletions android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowDisablePreview">true</item>
<!-- Customize your theme here. -->
<item name="android:windowBackground">@drawable/app_background</item>
<item name="android:statusBarColor">@color/theme</item>
<item name="android:navigationBarColor">@color/navBar</item>
<item name="android:windowLightStatusBar">@bool/useLightStatusBar</item>
<item name="android:textColor">@color/themeInverse</item>
</style>

<style name="SplashTheme" parent="Theme.AppCompat.Light">
<item name="android:windowDisablePreview">true</item>
<item name="android:windowBackground">@drawable/app_background</item>
<item name="android:statusBarColor">@color/theme</item>
<item name="android:navigationBarColor">@color/navBar</item>
<item name="android:windowLightStatusBar">@bool/useLightStatusBar</item>
<item name="android:textColor">@color/themeInverse</item>
</style>

</resources>
6 changes: 4 additions & 2 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowDisablePreview">true</item>
<!-- Customize your theme here. -->
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
<item name="android:windowBackground">@color/theme</item>
<item name="android:windowBackground">@drawable/app_background</item>
<item name="android:statusBarColor">@color/theme</item>
<item name="android:navigationBarColor">@color/navBar</item>
<item name="android:windowLightStatusBar">@bool/useLightStatusBar</item>
<item name="android:textColor">@color/themeInverse</item>
</style>

<style name="SplashTheme" parent="Theme.AppCompat.DayNight">
<item name="android:windowBackground">@drawable/background_splash</item>
<item name="android:windowDisablePreview">true</item>
<item name="android:windowBackground">@drawable/app_background</item>
<item name="android:statusBarColor">@color/theme</item>
<item name="android:navigationBarColor">@color/navBar</item>
<item name="android:windowLightStatusBar">@bool/useLightStatusBar</item>
Expand Down
9 changes: 9 additions & 0 deletions android/app/src/qa/res/drawable-night/app_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/theme" />
<item>
<bitmap
android:src="@drawable/fox"
android:gravity="center"
android:tileMode="disabled" />
</item>
</layer-list>
Binary file removed android/app/src/qa/res/drawable-night/diamond.png
Binary file not shown.
Binary file added android/app/src/qa/res/drawable-night/fox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions android/app/src/qa/res/drawable/app_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/theme" />
<item>
<bitmap
android:src="@drawable/fox"
android:gravity="center"
android:tileMode="disabled" />
</item>
</layer-list>
13 changes: 0 additions & 13 deletions android/app/src/qa/res/drawable/background_splash.xml

This file was deleted.

Binary file removed android/app/src/qa/res/drawable/diamond.png
Binary file not shown.
Binary file added android/app/src/qa/res/drawable/fox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions android/app/src/qa/res/drawable/rn_edit_text_material.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
android:insetTop="@dimen/abc_edit_text_inset_top_material"
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
<selector>
<!--
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
<item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
-->
<item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
<item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
</selector>
</inset>
Binary file removed android/app/src/qa/res/drawable/screen.png
Binary file not shown.
6 changes: 6 additions & 0 deletions android/app/src/qa/res/layout-night/launch_screen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent" android:background="@color/theme">
<ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/fox" android:scaleType="center" />
</RelativeLayout>
2 changes: 1 addition & 1 deletion android/app/src/qa/res/layout/launch_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent" android:background="@color/theme">
<ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/diamond" android:scaleType="center" />
<ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/fox" android:scaleType="center" />
</RelativeLayout>
3 changes: 3 additions & 0 deletions android/app/src/qa/res/values-night/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">MetaMask</string>
</resources>
23 changes: 23 additions & 0 deletions android/app/src/qa/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowDisablePreview">true</item>
<!-- Customize your theme here. -->
<item name="android:windowBackground">@drawable/app_background</item>
<item name="android:statusBarColor">@color/theme</item>
<item name="android:navigationBarColor">@color/navBar</item>
<item name="android:windowLightStatusBar">@bool/useLightStatusBar</item>
<item name="android:textColor">@color/themeInverse</item>
</style>

<style name="SplashTheme" parent="Theme.AppCompat.Light">
<item name="android:windowDisablePreview">true</item>
<item name="android:windowBackground">@drawable/app_background</item>
<item name="android:statusBarColor">@color/theme</item>
<item name="android:navigationBarColor">@color/navBar</item>
<item name="android:windowLightStatusBar">@bool/useLightStatusBar</item>
<item name="android:textColor">@color/themeInverse</item>
</style>

</resources>
2 changes: 1 addition & 1 deletion android/app/src/qa/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">MetaMask-QA</string>
<string name="app_name">MetaMask</string>
</resources>
7 changes: 5 additions & 2 deletions android/app/src/qa/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowDisablePreview">true</item>
<!-- Customize your theme here. -->
<item name="android:windowBackground">@color/theme</item>
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
<item name="android:windowBackground">@drawable/app_background</item>
<item name="android:statusBarColor">@color/theme</item>
<item name="android:navigationBarColor">@color/navBar</item>
<item name="android:windowLightStatusBar">@bool/useLightStatusBar</item>
<item name="android:textColor">@color/themeInverse</item>
</style>

<style name="SplashTheme" parent="Theme.AppCompat.DayNight">
<item name="android:windowBackground">@drawable/background_splash</item>
<item name="android:windowDisablePreview">true</item>
<item name="android:windowBackground">@drawable/app_background</item>
<item name="android:statusBarColor">@color/theme</item>
<item name="android:navigationBarColor">@color/navBar</item>
<item name="android:windowLightStatusBar">@bool/useLightStatusBar</item>
Expand Down
Loading

0 comments on commit 0eb8076

Please sign in to comment.