Skip to content

Commit

Permalink
feat(android): make TextInput default color same as iOS (#3613)
Browse files Browse the repository at this point in the history
Co-authored-by: OpenHippy <124017524+open-hippy@users.noreply.github.com>
  • Loading branch information
iPel and open-hippy committed Dec 5, 2023
1 parent 3d5b2fd commit 24d11f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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
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

0 comments on commit 24d11f9

Please sign in to comment.