-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[TIMOB-25855] Android: TextArea lines and maxLines support #9927
Changes from 1 commit
0cafdb1
a3c5eb4
b6b677c
4f97535
a84b3f5
00b0ebf
7ce8fb1
9c02130
daf9cb8
ae515ae
e58a6ef
df8c3a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -248,6 +248,15 @@ public void processProperties(KrollDict d) | |
tv.setImeOptions(EditorInfo.IME_FLAG_NO_FULLSCREEN); | ||
} | ||
} | ||
|
||
if (d.containsKey(TiC.PROPERTY_LINES)) { | ||
if (!field) tv.setLines(TiConvert.toInt(d, TiC.PROPERTY_LINES)); | ||
} | ||
|
||
if (d.containsKey(TiC.PROPERTY_MAX_LINES)) { | ||
if (!field) tv.setMaxLines(TiConvert.toInt(d, TiC.PROPERTY_MAX_LINES)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From looking at Google's I believe we might have a similar issue with Android's So, if the I think the best thing to do is to apply There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah nice, I'll copy the parts over to the UIText! |
||
} | ||
|
||
disableChangeEvent = false; | ||
} | ||
|
||
|
@@ -367,6 +376,10 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP | |
if (!TiConvert.toBoolean(newValue, true)) { | ||
tv.setImeOptions(EditorInfo.IME_FLAG_NO_FULLSCREEN); | ||
} | ||
} else if (key.equals(TiC.PROPERTY_LINES)) { | ||
if (!field) tv.setLines(TiConvert.toInt(newValue)); | ||
} else if (key.equals(TiC.PROPERTY_MAX_LINES)) { | ||
if (!field) tv.setMaxLines(TiConvert.toInt(newValue)); | ||
} else { | ||
super.propertyChanged(key, oldValue, newValue, proxy); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -366,6 +366,14 @@ properties: | |
default: <Titanium.UI.KEYBOARD_DEFAULT> | ||
platforms: [android, iphone, ipad] | ||
|
||
- name: lines | ||
summary: Line count of text field input. | ||
description: Sets the initial size of lines that the field will have at start. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's make it clear that How about the following...
|
||
default: 1 | ||
type: Number | ||
since: {android: "7.2.0"} | ||
platforms: [android] | ||
|
||
- name: maxLength | ||
summary: Maximum length of text field input. | ||
description: Any attempt to input text beyond this length (including pasting a string | ||
|
@@ -376,6 +384,14 @@ properties: | |
since: {android: "3.0.0", iphone: "3.0.0", ipad: "3.0.0"} | ||
platforms: [android, iphone, ipad] | ||
|
||
- name: maxLines | ||
summary: Maximum line count of text field input. | ||
description: Sets the maximum of lines that the field will be extended to when pressing `Return`. | ||
default: -1 | ||
type: Number | ||
since: {android: "7.2.0"} | ||
platforms: [android] | ||
|
||
- name: padding | ||
summary: Sets the left and right padding of this TextArea. The text will always be vertically centered. | ||
type: TextAreaPadding | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
lines
should default to -1.For backward compatibility, we should respect the TextArea's
height
property. Thelines
property is used to set the height of the TextArea by line height instead (definitely a good feature) but the developer should opt-in to it.