Skip to content
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

Splash icon doesn't line up in the middle and goes up on android #748

Closed
tkddbf7348 opened this issue Nov 8, 2024 · 6 comments
Closed

Comments

@tkddbf7348
Copy link

tkddbf7348 commented Nov 8, 2024

Attention: If you open a bug report without sufficient details, it will be closed. Is your question
related to Android 12? Please check the notes on Android 12 first (https://pub.dev/packages/flutter_native_splash#android-12-support).

Describe the bug

The splash icon keeps going up on Android.
I tested android_gravity and it was the same.

My icon is size 940*940,

I also tested the 512 and 1152 sizes.

Configuration

flutter_native_splash:
  color: "#000000"
  image: assets/images/app_icon_dark_splash.png
  color_dark: "#000000"
  image_dark: assets/images/app_icon_dark_splash.png

  android_12:
    image: assets/images/app_icon_dark_splash.png
    color: "#000000"
    image_dark: assets/images/app_icon_dark_splash.png
    color_dark: "#000000"

  android_gravity: center_vertical
  ios_content_mode: center

Device (please complete the following information):

  • Device: Samsung Galuxy S 21
  • OS: Android 14, One UI 6.1

To Reproduce
Steps to reproduce the behavior, using the example app:

  1. Set the config on the example app to '...'
  2. Run in an emulator configured with '...'
  3. See error

Screenshots
removed FlutterNativeSplash.remove() for test.

https://github.com/user-attachments/assets/7cef5d54-78de-4f77-9557-9416e10814d1
image
image
app_icon_dark_splash

Additional context
flutter_native_splash: ^2.4.1

image

@jonbhanson
Copy link
Owner

Can you add a video of the splash screen? I don't understand what is happening.

@tkddbf7348
Copy link
Author

tkddbf7348 commented Nov 25, 2024

I already added it.( it is showing by URL ..! )

Screen_Recording_20241108_113939_One.UI.Home.mp4

FlutterNativeSplash.remove() is commented to test.

@jonbhanson
Copy link
Owner

I think you may need to follow these instructions:

https://docs.flutter.dev/release/breaking-changes/splash-screen-migration

@tkddbf7348
Copy link
Author

I read all the documents, but there was nothing relevant.

I don't know why not.. 🥲

Thank you for your help.

@tkddbf7348
Copy link
Author

tkddbf7348 commented Nov 26, 2024

From what I can see, it seems to be an issue due to an error that does not stop on the splash screen despite calling the function FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding).

Is there a particular case where the preserve() function doesn't work?

here is my code.


void main() {
  _init();
}

_init() async {
  final WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
  FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
  print('preserve');

  if (!(await InternetConnectionChecker().hasConnection)) {
    //인터넷연결페이지
    runApp(const InternetCheckMain());
    return;
  }

  if ((await ApiCheckService.instance.apiCheck()) == 0) {
    runApp(const ApiCheckMain());
    return;
  }

  await _initSharedPreferences();
  ....... setting ....... 
  await ....
  await ...

  FlutterNativeSplash.remove();
  print('remove');

  runApp(const MainApp());
}

@tkddbf7348
Copy link
Author

tkddbf7348 commented Dec 1, 2024

Problem is in MainActivity.kt .

I just comment this line.

class MainActivity: FlutterActivity() {
    // override fun onCreate(savedInstanceState: Bundle?) {
    //     intent.putExtra("background_mode", "transparent")
    //     super.onCreate(savedInstanceState)
    // }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants