Skip to content

Commit

Permalink
Remove unused defaultThemePaddingStart|End|Top|Bottom from AndroidTex…
Browse files Browse the repository at this point in the history
…tInputState (facebook#48161)

Summary:
Pull Request resolved: facebook#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
  • Loading branch information
christophpurrer authored and facebook-github-bot committed Dec 9, 2024
1 parent aef13d1 commit 7ea5deb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 7ea5deb

Please sign in to comment.