Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(android): make TextInput default color same as iOS #3613

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public HippyTextInput(Context context) {
ViewGroup.LayoutParams.MATCH_PARENT));
setPadding(0, 0, 0, 0);
setGravityVertical(Gravity.CENTER_VERTICAL);
setHintTextColor(HippyTextInputController.DEFAULT_PLACEHOLDER_TEXT_COLOR);
setTextColor(HippyTextInputController.DEFAULT_TEXT_COLOR);
setBackground(null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
public class HippyTextInputController extends HippyViewController<HippyTextInput> {

public static final String CLASS_NAME = "TextInput";
public static final int DEFAULT_TEXT_COLOR = Color.BLACK;
public static final int DEFAULT_PLACEHOLDER_TEXT_COLOR = Color.GRAY;
private static final String TAG = "HippyTextInputControlle";
private static final int INPUT_TYPE_KEYBOARD_NUMBERED =
InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL
Expand Down Expand Up @@ -324,7 +326,8 @@ public void placeHolder(HippyTextInput view, String placeholder) {
view.setHint(placeholder);
}

@HippyControllerProps(name = "placeholderTextColor", defaultType = HippyControllerProps.NUMBER, defaultNumber = Color.GRAY)
@HippyControllerProps(name = "placeholderTextColor", defaultType = HippyControllerProps.NUMBER, defaultNumber =
DEFAULT_PLACEHOLDER_TEXT_COLOR)
public void setTextHitColor(HippyTextInput input, int color) {
input.setHintTextColor(color);
}
Expand Down Expand Up @@ -360,12 +363,11 @@ public void setOnContentSizeChange(HippyTextInput hippyTextInput, boolean conten
}

@HippyControllerProps(name = NodeProps.COLOR, defaultType = HippyControllerProps.NUMBER, defaultNumber =
Color.BLACK)
DEFAULT_TEXT_COLOR)
public void setColor(HippyTextInput hippyTextInput, int change) {
hippyTextInput.setTextColor(change);
}


@HippyControllerProps(name = NodeProps.TEXT_ALIGN, defaultType = HippyControllerProps.STRING)
public void setTextAlign(HippyTextInput view, String textAlign) {
if (textAlign == null || "auto".equals(textAlign)) {
Expand Down
Loading