add textview's gravity for inflater

This commit is contained in:
houzh 2022-02-26 10:31:56 +00:00
parent e3c262124b
commit 9e0a5777fc

View File

@ -273,6 +273,7 @@ TextView::TextView(Context*ctx,const AttributeSet& attrs)
setMinWidth(attrs.getDimensionPixelSize("minWidth", INT_MIN));
setMaxWidth(attrs.getDimensionPixelSize("maxWidth", INT_MAX));
setSingleLine(attrs.getBoolean("singleLine",mSingleLine));
setGravity(attrs.getGravity("gravity",Gravity::NO_GRAVITY));
TextAppearanceAttributes attributes;
const std::string appearance=attrs.getString("textAppearance");
@ -285,7 +286,6 @@ TextView::TextView(Context*ctx,const AttributeSet& attrs)
attributes.readTextAppearance(ctx,attrs);
}
applyTextAppearance(&attributes);
setMarqueeRepeatLimit(attrs.getInt("marqueeRepeatLimit",mMarqueeRepeatLimit));
setEllipsize(attrs.getInt("ellipsize",std::map<const std::string,int>{
{"start",Layout::ELLIPSIS_START},{"middle",Layout::ELLIPSIS_MIDDLE},