Skip to content

Commit

Permalink
* [android] fix textarea content vertical gravity
Browse files Browse the repository at this point in the history
  • Loading branch information
sospartan committed Oct 24, 2016
1 parent 9c67f1f commit eecc32c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ public void onHostViewClick() {
});
}

protected int getVerticalGravity(){
return Gravity.CENTER_VERTICAL;
}

/**
* Process view after created.
*
Expand All @@ -282,7 +286,7 @@ protected void appleStyleAfterCreated(WXEditText editText) {
if (textAlign <= 0) {
textAlign = Gravity.LEFT;
}
editText.setGravity(textAlign | Gravity.CENTER_VERTICAL);
editText.setGravity(textAlign | getVerticalGravity());
int colorInt = WXResourceUtils.getColor("#999999");
if (colorInt != Integer.MIN_VALUE) {
editText.setHintTextColor(colorInt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@
package com.taobao.weex.ui.component;

import android.text.TextUtils;
import android.view.Gravity;

import com.taobao.weex.WXSDKInstance;
import com.taobao.weex.common.Constants;
import com.taobao.weex.dom.TextAreaEditTextDomObject;
Expand Down Expand Up @@ -239,6 +241,11 @@ protected void appleStyleAfterCreated(WXEditText editText) {
editText.setMinLines(rows);
}

@Override
protected int getVerticalGravity() {
return Gravity.TOP;
}

@Override
protected boolean setProperty(String key, Object param) {
switch (key) {
Expand Down

0 comments on commit eecc32c

Please sign in to comment.