1 line
3.7 KiB
Plaintext
1 line
3.7 KiB
Plaintext
![]() |
{"version":3,"file":"SplashScreen.js","sourceRoot":"","sources":["../../src/android/SplashScreen.ts"],"names":[],"mappings":";;;;;;;;;AACA,2EAIuC;AAGvC,0DAA2D;AAC3D,qEAAuD;AAE1C,QAAA,gBAAgB,GAAiB,MAAM,CAAC,EAAE;IACrD,OAAO,+BAAgB,CAAC,MAAM,EAAE;QAC9B,SAAS;QACT,KAAK,EAAC,MAAM,EAAC,EAAE;YACb,MAAM,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;YAClE,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,SAAgB,qBAAqB,CAAC,MAAkB;;IACtD,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,QAAC,MAAM,CAAC,OAAO,0CAAE,MAAM,CAAA,EAAE;QAC7C,OAAO;KACR;IAED,MAAM,MAAM,GAA8B;QACxC,eAAe,0BACb,MAAM,CAAC,OAAO,0CAAE,MAAM,0CAAE,UAAU,yCAClC,MAAM,CAAC,MAAM,0CAAE,UAAU,mCACzB,qDAA2B,CAAC,OAAO;QACrC,eAAe,0BACb,MAAM,CAAC,OAAO,0CAAE,MAAM,0CAAE,eAAe,yCAAI,MAAM,CAAC,MAAM,0CAAE,eAAe,mCAAI,SAAS;QACxF,KAAK,4CACH,MAAM,CAAC,OAAO,0CAAE,MAAM,0CAAE,OAAO,+CAC/B,MAAM,CAAC,OAAO,0CAAE,MAAM,0CAAE,MAAM,+CAC9B,MAAM,CAAC,OAAO,0CAAE,MAAM,0CAAE,KAAK,+CAC7B,MAAM,CAAC,OAAO,0CAAE,MAAM,0CAAE,IAAI,+CAC5B,MAAM,CAAC,OAAO,0CAAE,MAAM,0CAAE,IAAI,yCAC5B,MAAM,CAAC,MAAM,0CAAE,KAAK;KACvB,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAtBD,sDAsBC;AAEM,KAAK,UAAU,oBAAoB,CAAC,MAAkB,EAAE,WAAmB;IAChF,MAAM,uBAAuB,GAC3B,MAAM,CAAC,UAAU,KAAK,QAAQ,IAAI,MAAM,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;IACzF,IAAI,CAAC,uBAAuB,EAAE;QAC5B,iBAAiB,CAAC,iBAAiB,CACjC,QAAQ,EACR,2LAA2L,CAC5L,CAAC;QAEF,OAAO;KACR;IAED,MAAM,YAAY,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACnD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,IAAI;QACF,MAAM,sDAA4B,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;KAC/D;IAAC,OAAO,CAAC,EAAE;QACV,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;KAClD;AACH,CAAC;AAtBD,oDAsBC","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport {\n AndroidSplashScreenConfig,\n configureAndroidSplashScreen,\n SplashScreenImageResizeMode,\n} from '@expo/configure-splash-screen';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withDangerousMod } from '../plugins/core-plugins';\nimport * as WarningAggregator from '../utils/warnings';\n\nexport const withSplashScreen: ConfigPlugin = config => {\n return withDangerousMod(config, [\n 'android',\n async config => {\n await setSplashScreenAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\nexport function getSplashScreenConfig(config: ExpoConfig): AndroidSplashScreenConfig | undefined {\n if (!config.splash && !config.android?.splash) {\n return;\n }\n\n const result: AndroidSplashScreenConfig = {\n imageResizeMode:\n config.android?.splash?.resizeMode ??\n config.splash?.resizeMode ??\n SplashScreenImageResizeMode.CONTAIN,\n backgroundColor:\n config.android?.splash?.backgroundColor ?? config.splash?.backgroundColor ?? '#FFFFFF', // white\n image:\n config.android?.splash?.xxxhdpi ??\n config.android?.splash?.xxhdpi ??\n config.android?.splash?.xhdpi ??\n config.android?.splash?.hdpi ??\n config.android?.splash?.mdpi ??\n config.splash?.image,\n };\n\n return result;\n}\n\nexport async function setSplashScreenAsync(config: ExpoConfig, projectRoot: string) {\n const splashScreenIsSupported =\n config.sdkVersion === '39.0.0' || config.sdkVersion === '40.0.0' || !config.sdkVersion;\n if (!splashScreenIsSupported) {\n WarningAggregator.addWarningAndroid(\n 'splash',\n 'Unable to automatically configure splash screen. Please refer to the expo-splash-screen README for more information: https://github.com/expo/expo/tree/master/packages/expo-splash-screen'\n );\n\n return;\n }\n\n const splashConfig = getSplashScreenConfig(config);\n if (!splashConfig) {\n return;\n }\n\n try {\n await configureAndroidSplashScreen(projectRoot, splashConfig);\n } catch (e) {\n WarningAggregator.addWarningAndroid('splash', e);\n }\n}\n"]}
|