Getting rid of Toast in Dev Loading View post Native Module is released (#35888)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/35888 Changelog: [Android][Removed] - For supporting Dev Loading View across multiple platforms, changed the Loading View of Android to rely on the native implementation instead of Toast. Getting rid of the JS changes relying on Toast for Dev Loading View now that the native module is released. Reviewed By: rshest Differential Revision: D42599220 fbshipit-source-id: ec7098b508c766c07384d48d3bffed075b092b72
This commit is contained in:
Родитель
9cf35bfcc4
Коммит
208f559505
|
@ -8,14 +8,10 @@
|
||||||
* @flow strict-local
|
* @flow strict-local
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import ToastAndroid from '../Components/ToastAndroid/ToastAndroid';
|
|
||||||
import processColor from '../StyleSheet/processColor';
|
import processColor from '../StyleSheet/processColor';
|
||||||
import Appearance from './Appearance';
|
import Appearance from './Appearance';
|
||||||
import NativeDevLoadingView from './NativeDevLoadingView';
|
import NativeDevLoadingView from './NativeDevLoadingView';
|
||||||
|
|
||||||
const TOAST_SHORT_DELAY = 2000;
|
|
||||||
let isVisible = false;
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
showMessage(message: string, type: 'load' | 'refresh') {
|
showMessage(message: string, type: 'load' | 'refresh') {
|
||||||
if (NativeDevLoadingView) {
|
if (NativeDevLoadingView) {
|
||||||
|
@ -40,12 +36,6 @@ module.exports = {
|
||||||
typeof textColor === 'number' ? textColor : null,
|
typeof textColor === 'number' ? textColor : null,
|
||||||
typeof backgroundColor === 'number' ? backgroundColor : null,
|
typeof backgroundColor === 'number' ? backgroundColor : null,
|
||||||
);
|
);
|
||||||
} else if (!isVisible) {
|
|
||||||
ToastAndroid.show(message, ToastAndroid.SHORT);
|
|
||||||
isVisible = true;
|
|
||||||
setTimeout(() => {
|
|
||||||
isVisible = false;
|
|
||||||
}, TOAST_SHORT_DELAY);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hide() {
|
hide() {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче