Skip to content

Commit

Permalink
Getting rid of Toast in Dev Loading View post Native Module is releas…
Browse files Browse the repository at this point in the history
…ed (#35888)

Summary:
Pull Request resolved: #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
  • Loading branch information
arushikesarwani94 authored and facebook-github-bot committed Jan 20, 2023
1 parent 9cf35bf commit 208f559
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions Libraries/Utilities/LoadingView.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@
* @flow strict-local
*/

import ToastAndroid from '../Components/ToastAndroid/ToastAndroid';
import processColor from '../StyleSheet/processColor';
import Appearance from './Appearance';
import NativeDevLoadingView from './NativeDevLoadingView';

const TOAST_SHORT_DELAY = 2000;
let isVisible = false;

module.exports = {
showMessage(message: string, type: 'load' | 'refresh') {
if (NativeDevLoadingView) {
Expand All @@ -40,12 +36,6 @@ module.exports = {
typeof textColor === 'number' ? textColor : null,
typeof backgroundColor === 'number' ? backgroundColor : null,
);
} else if (!isVisible) {
ToastAndroid.show(message, ToastAndroid.SHORT);
isVisible = true;
setTimeout(() => {
isVisible = false;
}, TOAST_SHORT_DELAY);
}
},
hide() {
Expand Down

0 comments on commit 208f559

Please sign in to comment.