diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index 16704f1c2eee7..6bbe76b177f91 100644 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -2326,7 +2326,6 @@ ORIGIN: ../../../flutter/shell/platform/android/io/flutter/app/FlutterApplicatio ORIGIN: ../../../flutter/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/app/FlutterPlayStoreSplitApplication.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/DrawableSplashScreen.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/ExclusiveAppComponent.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java + ../../../flutter/LICENSE @@ -2337,7 +2336,6 @@ ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/Flu ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragmentActivity.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterImageView.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterPlayStoreSplitApplication.java + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterSplashView.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterSurfaceView.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterTextureView.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterView.java + ../../../flutter/LICENSE @@ -2347,8 +2345,6 @@ ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/Key ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/KeyboardManager.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/KeyboardMap.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/RenderMode.java + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/SplashScreen.java + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/SplashScreenProvider.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/TransparencyMode.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/android/WindowInfoRepositoryCallbackAdapterWrapper.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java + ../../../flutter/LICENSE @@ -5024,7 +5020,6 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterFragmentActi FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterPlayStoreSplitApplication.java FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/AndroidTouchProcessor.java -FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/DrawableSplashScreen.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/ExclusiveAppComponent.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java @@ -5035,7 +5030,6 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/Flutt FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragmentActivity.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterImageView.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterPlayStoreSplitApplication.java -FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterSplashView.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterSurfaceView.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterTextureView.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterView.java @@ -5046,8 +5040,6 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/Keybo FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/KeyboardMap.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/MotionEventTracker.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/RenderMode.java -FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/SplashScreen.java -FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/SplashScreenProvider.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/TransparencyMode.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/WindowInfoRepositoryCallbackAdapterWrapper.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index 89871decbf6f5..80fd97c3991f6 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -180,7 +180,6 @@ android_java_sources = [ "io/flutter/app/FlutterPlayStoreSplitApplication.java", "io/flutter/app/FlutterPluginRegistry.java", "io/flutter/embedding/android/AndroidTouchProcessor.java", - "io/flutter/embedding/android/DrawableSplashScreen.java", "io/flutter/embedding/android/ExclusiveAppComponent.java", "io/flutter/embedding/android/FlutterActivity.java", "io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java", @@ -191,7 +190,6 @@ android_java_sources = [ "io/flutter/embedding/android/FlutterFragmentActivity.java", "io/flutter/embedding/android/FlutterImageView.java", "io/flutter/embedding/android/FlutterPlayStoreSplitApplication.java", - "io/flutter/embedding/android/FlutterSplashView.java", "io/flutter/embedding/android/FlutterSurfaceView.java", "io/flutter/embedding/android/FlutterTextureView.java", "io/flutter/embedding/android/FlutterView.java", @@ -202,8 +200,6 @@ android_java_sources = [ "io/flutter/embedding/android/KeyboardMap.java", "io/flutter/embedding/android/MotionEventTracker.java", "io/flutter/embedding/android/RenderMode.java", - "io/flutter/embedding/android/SplashScreen.java", - "io/flutter/embedding/android/SplashScreenProvider.java", "io/flutter/embedding/android/TransparencyMode.java", "io/flutter/embedding/android/WindowInfoRepositoryCallbackAdapterWrapper.java", "io/flutter/embedding/engine/FlutterEngine.java", diff --git a/shell/platform/android/io/flutter/embedding/android/DrawableSplashScreen.java b/shell/platform/android/io/flutter/embedding/android/DrawableSplashScreen.java deleted file mode 100644 index d943e653bccd6..0000000000000 --- a/shell/platform/android/io/flutter/embedding/android/DrawableSplashScreen.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.embedding.android; - -import android.animation.Animator; -import android.content.Context; -import android.graphics.drawable.Drawable; -import android.os.Bundle; -import android.util.AttributeSet; -import android.view.View; -import android.widget.ImageView; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -/** - * {@link SplashScreen} that displays a given {@link Drawable}, which then fades its alpha to zero - * when instructed to {@link #transitionToFlutter(Runnable)}. - * - *

Please use the new Splash screen API available on Android S. On lower versions of Android, - * it's no longer necessary to display a splash screen to wait for the Flutter first frame. - * - * @deprecated - */ -@Deprecated -public final class DrawableSplashScreen implements SplashScreen { - private final Drawable drawable; - private final ImageView.ScaleType scaleType; - private final long crossfadeDurationInMillis; - private DrawableSplashScreenView splashView; - - /** - * Constructs a {@code DrawableSplashScreen} that displays the given {@code drawable} and - * crossfades to Flutter content in 500 milliseconds. - * - * @param drawable A drawable to display on the Splash screen view. - */ - public DrawableSplashScreen(@NonNull Drawable drawable) { - this(drawable, ImageView.ScaleType.FIT_XY, 500); - } - - /** - * Constructs a {@code DrawableSplashScreen} that displays the given {@code drawable} and - * crossfades to Flutter content in the given {@code crossfadeDurationInMillis}. - * - * @param drawable The {@code Drawable} to be displayed as a splash screen. - * @param scaleType The {@link android.widget.ImageView.ScaleType} to be applied to the {@code - * Drawable} when the {@code Drawable} is displayed full-screen. - * @param crossfadeDurationInMillis Duration of the crossfade in milliseconds. - */ - public DrawableSplashScreen( - @NonNull Drawable drawable, - @NonNull ImageView.ScaleType scaleType, - long crossfadeDurationInMillis) { - this.drawable = drawable; - this.scaleType = scaleType; - this.crossfadeDurationInMillis = crossfadeDurationInMillis; - } - - @Nullable - @Override - public View createSplashView(@NonNull Context context, @Nullable Bundle savedInstanceState) { - splashView = new DrawableSplashScreenView(context); - splashView.setSplashDrawable(drawable, scaleType); - return splashView; - } - - @Override - public void transitionToFlutter(@NonNull Runnable onTransitionComplete) { - if (splashView == null) { - onTransitionComplete.run(); - return; - } - - splashView - .animate() - .alpha(0.0f) - .setDuration(crossfadeDurationInMillis) - .setListener( - new Animator.AnimatorListener() { - @Override - public void onAnimationStart(Animator animation) {} - - @Override - public void onAnimationEnd(Animator animation) { - onTransitionComplete.run(); - } - - @Override - public void onAnimationCancel(Animator animation) { - onTransitionComplete.run(); - } - - @Override - public void onAnimationRepeat(Animator animation) {} - }); - } - - // Public for Android OS requirements. This View should not be used by external developers. - public static class DrawableSplashScreenView extends ImageView { - public DrawableSplashScreenView(@NonNull Context context) { - this(context, null, 0); - } - - public DrawableSplashScreenView(@NonNull Context context, @Nullable AttributeSet attrs) { - this(context, attrs, 0); - } - - public DrawableSplashScreenView( - @NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - } - - public void setSplashDrawable(@Nullable Drawable drawable) { - setSplashDrawable(drawable, ImageView.ScaleType.FIT_XY); - } - - public void setSplashDrawable( - @Nullable Drawable drawable, @NonNull ImageView.ScaleType scaleType) { - setScaleType(scaleType); - setImageDrawable(drawable); - } - } -} diff --git a/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java b/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java index abbedeb4ddd18..5ec47c5831a09 100644 --- a/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java +++ b/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java @@ -20,7 +20,6 @@ import static io.flutter.embedding.android.FlutterActivityLaunchConfigs.HANDLE_DEEPLINKING_META_DATA_KEY; import static io.flutter.embedding.android.FlutterActivityLaunchConfigs.INITIAL_ROUTE_META_DATA_KEY; import static io.flutter.embedding.android.FlutterActivityLaunchConfigs.NORMAL_THEME_META_DATA_KEY; -import static io.flutter.embedding.android.FlutterActivityLaunchConfigs.SPLASH_SCREEN_META_DATA_KEY; import android.app.Activity; import android.content.Context; @@ -28,10 +27,8 @@ import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; -import android.content.res.Resources; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; -import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; import android.view.View; @@ -42,7 +39,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; -import androidx.core.content.res.ResourcesCompat; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.LifecycleOwner; import androidx.lifecycle.LifecycleRegistry; @@ -69,7 +65,6 @@ * *