Remove unused defaultThemePaddingStart|End|Top|Bottom from AndroidTextInputState (#48161)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48161

[Changelog] [Internal] -  Remove unused defaultThemePaddingStart|End|Top|Bottom from AndroidTextInputState

This data is set, but never read

Reviewed By: javache

Differential Revision: D66904641

fbshipit-source-id: 4db1cd49e9ec63b62f75070b478d2006ea101f8c
This commit is contained in:
Christoph Purrer
2024-12-09 11:22:57 -08:00
committed by Facebook GitHub Bot
parent aef13d1f43
commit 7ea5deb802
4 changed files with 7 additions and 48 deletions
@@ -70,8 +70,8 @@ class AndroidTextInputComponentDescriptor final
}
return std::make_shared<AndroidTextInputShadowNode::ConcreteState>(
std::make_shared<const AndroidTextInputState>(AndroidTextInputState(
0, {}, {}, {}, theme.start, theme.end, theme.top, theme.bottom)),
std::make_shared<const AndroidTextInputState>(
AndroidTextInputState(0, {}, {}, {})),
family);
}
@@ -141,11 +141,7 @@ void AndroidTextInputShadowNode::updateStateIfNeeded() {
newEventCount,
newAttributedString,
reactTreeAttributedString,
getConcreteProps().paragraphAttributes,
state.defaultThemePaddingStart,
state.defaultThemePaddingEnd,
state.defaultThemePaddingTop,
state.defaultThemePaddingBottom});
getConcreteProps().paragraphAttributes});
}
#pragma mark - LayoutableShadowNode
@@ -20,19 +20,11 @@ AndroidTextInputState::AndroidTextInputState(
int64_t mostRecentEventCount,
AttributedString attributedString,
AttributedString reactTreeAttributedString,
ParagraphAttributes paragraphAttributes,
float defaultThemePaddingStart,
float defaultThemePaddingEnd,
float defaultThemePaddingTop,
float defaultThemePaddingBottom)
ParagraphAttributes paragraphAttributes)
: mostRecentEventCount(mostRecentEventCount),
attributedString(std::move(attributedString)),
reactTreeAttributedString(std::move(reactTreeAttributedString)),
paragraphAttributes(std::move(paragraphAttributes)),
defaultThemePaddingStart(defaultThemePaddingStart),
defaultThemePaddingEnd(defaultThemePaddingEnd),
defaultThemePaddingTop(defaultThemePaddingTop),
defaultThemePaddingBottom(defaultThemePaddingBottom) {}
paragraphAttributes(std::move(paragraphAttributes)) {}
AndroidTextInputState::AndroidTextInputState(
const AndroidTextInputState& previousState,
@@ -47,23 +39,7 @@ AndroidTextInputState::AndroidTextInputState(
.getInt()),
attributedString(previousState.attributedString),
reactTreeAttributedString(previousState.reactTreeAttributedString),
paragraphAttributes(previousState.paragraphAttributes),
defaultThemePaddingStart(data.getDefault(
"themePaddingStart",
previousState.defaultThemePaddingStart)
.getDouble()),
defaultThemePaddingEnd(data.getDefault(
"themePaddingEnd",
previousState.defaultThemePaddingEnd)
.getDouble()),
defaultThemePaddingTop(data.getDefault(
"themePaddingTop",
previousState.defaultThemePaddingTop)
.getDouble()),
defaultThemePaddingBottom(data.getDefault(
"themePaddingBottom",
previousState.defaultThemePaddingBottom)
.getDouble()){};
paragraphAttributes(previousState.paragraphAttributes){};
folly::dynamic AndroidTextInputState::getDynamic() const {
LOG(FATAL) << "Android TextInput state should only be read using MapBuffer";
@@ -50,24 +50,11 @@ class AndroidTextInputState final {
*/
ParagraphAttributes paragraphAttributes{};
/**
* Communicates Android theme padding back to the ShadowNode / Component
* Descriptor for layout.
*/
float defaultThemePaddingStart{NAN};
float defaultThemePaddingEnd{NAN};
float defaultThemePaddingTop{NAN};
float defaultThemePaddingBottom{NAN};
AndroidTextInputState(
int64_t mostRecentEventCount,
AttributedString attributedString,
AttributedString reactTreeAttributedString,
ParagraphAttributes paragraphAttributes,
float defaultThemePaddingStart,
float defaultThemePaddingEnd,
float defaultThemePaddingTop,
float defaultThemePaddingBottom);
ParagraphAttributes paragraphAttributes);
AndroidTextInputState() = default;
AndroidTextInputState(