diff --git a/Libraries/Utilities/LoadingView.android.js b/Libraries/Utilities/LoadingView.android.js index 0acf7c39bc68d7..03dd42d7907fb7 100644 --- a/Libraries/Utilities/LoadingView.android.js +++ b/Libraries/Utilities/LoadingView.android.js @@ -8,43 +8,20 @@ * @flow strict-local */ -import processColor from '../StyleSheet/processColor'; -import Appearance from './Appearance'; -import NativeDevLoadingView from './NativeDevLoadingView'; +import ToastAndroid from '../Components/ToastAndroid/ToastAndroid'; + +const TOAST_SHORT_DELAY = 2000; +let isVisible = false; module.exports = { showMessage(message: string, type: 'load' | 'refresh') { - if (NativeDevLoadingView) { - if (type === 'refresh') { - const backgroundColor = processColor('#2584e8'); - const textColor = processColor('#ffffff'); - - NativeDevLoadingView.showMessage( - message, - typeof textColor === 'number' ? textColor : null, - typeof backgroundColor === 'number' ? backgroundColor : null, - ); - } else if (type === 'load') { - let backgroundColor; - let textColor; - - if (Appearance.getColorScheme() === 'dark') { - backgroundColor = processColor('#fafafa'); - textColor = processColor('#242526'); - } else { - backgroundColor = processColor('#404040'); - textColor = processColor('#ffffff'); - } - - NativeDevLoadingView.showMessage( - message, - typeof textColor === 'number' ? textColor : null, - typeof backgroundColor === 'number' ? backgroundColor : null, - ); - } + if (!isVisible) { + ToastAndroid.show(message, ToastAndroid.SHORT); + isVisible = true; + setTimeout(() => { + isVisible = false; + }, TOAST_SHORT_DELAY); } }, - hide() { - NativeDevLoadingView && NativeDevLoadingView.hide(); - }, + hide() {}, };