Skip to content
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-6392] Android fix: Ti.UI.Button text values with too many dis… #9299

Merged
merged 6 commits into from
Nov 13, 2017
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.util.HashMap;

import android.text.TextUtils;
import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.common.Log;
Expand Down Expand Up @@ -51,6 +52,8 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto
};
btn.setGravity(Gravity.CENTER);
defaultColor = btn.getCurrentTextColor();
btn.setEllipsize(TextUtils.TruncateAt.MIDDLE);
btn.setMaxLines(1);
setNativeView(btn);
}

Expand Down Expand Up @@ -180,7 +183,7 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP
if (newValue == null){
btn.getBackground().clearColorFilter();
} else {
btn.getBackground().setColorFilter( TiConvert.toColor(TiConvert.toString(newValue)), Mode.MULTIPLY);
btn.getBackground().setColorFilter( TiConvert.toColor(TiConvert.toString(newValue)), Mode.MULTIPLY);
}
} else {
super.propertyChanged(key, oldValue, newValue, proxy);
Expand Down