Skip to content

Commit

Permalink
feat(android): make TextInput default color same as iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
iPel committed Nov 24, 2023
1 parent bb9b7db commit dd9eebd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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);
}

@Override
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";
static final int DEFAULT_TEXT_COLOR = Color.BLACK;
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 @@ -366,12 +369,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

0 comments on commit dd9eebd

Please sign in to comment.