Skip to content

Commit

Permalink
Revert "fix(android): textfield padding (#13279)" (#13512)
Browse files Browse the repository at this point in the history
This reverts commit dcdfce5.
  • Loading branch information
hansemannn committed Jul 18, 2022
1 parent 31d8194 commit 918388a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ private void updateTextField()

private void setTextPadding(HashMap<String, Object> d)
{
int paddingLeft = tv.getPaddingLeft();
int paddingRight = tv.getPaddingRight();
int paddingTop = tv.getPaddingTop();
int paddingBottom = tv.getPaddingBottom();
int paddingLeft = textInputLayout.getPaddingLeft();
int paddingRight = textInputLayout.getPaddingRight();
int paddingTop = textInputLayout.getPaddingTop();
int paddingBottom = textInputLayout.getPaddingBottom();

if (d.containsKey(TiC.PROPERTY_LEFT)) {
paddingLeft = TiConvert.toInt(d.get(TiC.PROPERTY_LEFT), 0);
Expand All @@ -330,7 +330,8 @@ private void setTextPadding(HashMap<String, Object> d)
if (d.containsKey(TiC.PROPERTY_BOTTOM)) {
paddingBottom = TiConvert.toInt(d.get(TiC.PROPERTY_BOTTOM), 0);
}
tv.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom);

textInputLayout.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom);
}

@Override
Expand Down
Binary file not shown.
37 changes: 0 additions & 37 deletions tests/Resources/ti.ui.textfield.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,43 +144,6 @@ describe('Titanium.UI.TextField', () => {
win.open();
});

it.android('android padding (visual check)', function (finish) {
this.timeout(5000);
const textField = Ti.UI.createTextField({
value: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nec ullamcorper massa, eget tempor sapien. Phasellus nisi metus, tempus a magna nec, ultricies rutrum lacus. Aliquam sit amet augue suscipit, dignissim tellus eu, consectetur elit. Praesent ligula velit, blandit vel urna sit amet, suscipit euismod nunc.',
width: 100,
height: 40,
backgroundColor: 'white',
color: 'black',
padding: {
top: 10,
bottom: 10
}
});
const bgView = Ti.UI.createView({
width: 200,
height: 100,
backgroundColor: 'red'
});
win = Ti.UI.createWindow({
backgroundColor: '#eee'
});
bgView.add(textField);
win.add(bgView);

win.addEventListener('postlayout', function postlayout() { // FIXME: Support once!
win.removeEventListener('postlayout', postlayout); // only run once
try {
should(textField).matchImage('snapshots/textfieldPadding.png');
} catch (err) {
return finish(err);
}
finish();
});

win.open();
});

describe('.hintText', () => {
let textField;
beforeEach(() => {
Expand Down

0 comments on commit 918388a

Please sign in to comment.