Skip to content

Commit cb3321e

Browse files
RSNarafacebook-github-bot
authored andcommitted
Refactor: Inline AndroidTextInputViewConfig
Summary: Putting the static view config into its own file creates the uncertainty that n > 1 files import the static view config. This isn't true for AndroidTextViewConfig. So, let's just inline this static view config in the NativeComponent that uses it. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D33341776 fbshipit-source-id: 6fb710b8776d7b9276022c5226acefd7cf8395fb
1 parent ae6a84e commit cb3321e

File tree

1 file changed

+101
-2
lines changed

1 file changed

+101
-2
lines changed

Libraries/Components/TextInput/AndroidTextInputNativeComponent.js

Lines changed: 101 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import type {
2525
} from '../../StyleSheet/StyleSheet';
2626
import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
2727
import type {TextInputNativeCommands} from './TextInputNativeCommands';
28-
import AndroidTextInputViewConfig from './AndroidTextInputViewConfig';
2928
import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
3029

3130
export type KeyboardType =
@@ -596,7 +595,107 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
596595

597596
let AndroidTextInputNativeComponent = NativeComponentRegistry.get<NativeProps>(
598597
'AndroidTextInput',
599-
() => AndroidTextInputViewConfig,
598+
() => ({
599+
uiViewClassName: 'AndroidTextInput',
600+
bubblingEventTypes: {
601+
topBlur: {
602+
phasedRegistrationNames: {
603+
bubbled: 'onBlur',
604+
captured: 'onBlurCapture',
605+
},
606+
},
607+
topEndEditing: {
608+
phasedRegistrationNames: {
609+
bubbled: 'onEndEditing',
610+
captured: 'onEndEditingCapture',
611+
},
612+
},
613+
topFocus: {
614+
phasedRegistrationNames: {
615+
bubbled: 'onFocus',
616+
captured: 'onFocusCapture',
617+
},
618+
},
619+
topKeyPress: {
620+
phasedRegistrationNames: {
621+
bubbled: 'onKeyPress',
622+
captured: 'onKeyPressCapture',
623+
},
624+
},
625+
topSubmitEditing: {
626+
phasedRegistrationNames: {
627+
bubbled: 'onSubmitEditing',
628+
captured: 'onSubmitEditingCapture',
629+
},
630+
},
631+
topTextInput: {
632+
phasedRegistrationNames: {
633+
bubbled: 'onTextInput',
634+
captured: 'onTextInputCapture',
635+
},
636+
},
637+
},
638+
directEventTypes: {},
639+
validAttributes: {
640+
maxFontSizeMultiplier: true,
641+
adjustsFontSizeToFit: true,
642+
minimumFontScale: true,
643+
autoFocus: true,
644+
placeholder: true,
645+
inlineImagePadding: true,
646+
contextMenuHidden: true,
647+
textShadowColor: {process: require('../../StyleSheet/processColor')},
648+
maxLength: true,
649+
selectTextOnFocus: true,
650+
textShadowRadius: true,
651+
underlineColorAndroid: {
652+
process: require('../../StyleSheet/processColor'),
653+
},
654+
textDecorationLine: true,
655+
blurOnSubmit: true,
656+
textAlignVertical: true,
657+
fontStyle: true,
658+
textShadowOffset: true,
659+
selectionColor: {process: require('../../StyleSheet/processColor')},
660+
selection: true,
661+
placeholderTextColor: {process: require('../../StyleSheet/processColor')},
662+
importantForAutofill: true,
663+
lineHeight: true,
664+
textTransform: true,
665+
returnKeyType: true,
666+
keyboardType: true,
667+
multiline: true,
668+
color: {process: require('../../StyleSheet/processColor')},
669+
autoCompleteType: true,
670+
autoComplete: true,
671+
numberOfLines: true,
672+
letterSpacing: true,
673+
returnKeyLabel: true,
674+
fontSize: true,
675+
onKeyPress: true,
676+
cursorColor: {process: require('../../StyleSheet/processColor')},
677+
text: true,
678+
showSoftInputOnFocus: true,
679+
textAlign: true,
680+
autoCapitalize: true,
681+
autoCorrect: true,
682+
caretHidden: true,
683+
secureTextEntry: true,
684+
textBreakStrategy: true,
685+
onScroll: true,
686+
onContentSizeChange: true,
687+
disableFullscreenUI: true,
688+
includeFontPadding: true,
689+
fontWeight: true,
690+
fontFamily: true,
691+
allowFontScaling: true,
692+
onSelectionChange: true,
693+
mostRecentEventCount: true,
694+
inlineImageLeft: true,
695+
editable: true,
696+
fontVariant: true,
697+
},
698+
}),
600699
);
601700

602701
// flowlint-next-line unclear-type:off

0 commit comments

Comments
 (0)