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

fix(md-3896): expand row text color #158

Merged
merged 2 commits into from Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
Expand Up @@ -111,7 +111,14 @@ public JSONObject toEvent() throws JSONException {
cell.put("rawRowIdx", rawRowIdx);
cell.put("rawColIdx", rawColIdx);
cell.put("isNumber", isNumber);

if(cellForegroundColorValid) {
String hexColor = String.format("#%06X", 0xFFFFFF & cellForegroundColor);
cell.put("cellForegroundColor", hexColor);
}
if(cellBackgroundColorValid) {
String hexColor = String.format("#%06X", 0xFFFFFF & cellBackgroundColor);
cell.put("cellBackgroundColor", hexColor);
}
if(qAttrExpValues != null) {
JSONObject qAttrExps = new JSONObject();
qAttrExps.put("qValues", qAttrExpValues.toEvent());
Expand Down
Expand Up @@ -14,11 +14,12 @@ public class Indicator {
String position = null;
boolean showTextValues = false;
char icon;
String iconKey;
boolean hasIcon = false;

Indicator(ReadableMap data) {
applySegmentColors = data.hasKey("applySegmentColors") ? data.getBoolean("applySegmentColors") : false;
showTextValues = data.hasKey("showTextValues") ? data.getBoolean("showTextValues") : false;
applySegmentColors = data.hasKey("applySegmentColors") && data.getBoolean("applySegmentColors");
showTextValues = data.hasKey("showTextValues") && data.getBoolean("showTextValues");
position = data.hasKey("position") ? data.getString("position") : null;
index = data.hasKey("index") ? data.getInt("index") : -1;
parseColor(data);
Expand All @@ -37,13 +38,16 @@ public JSONObject toEvent() throws JSONException {
json.put("showTextValues", showTextValues);
json.put("position", position);
json.put("index", index);
String hexColor = String.format("#%06X", 0xFFFFFF & color);
json.put("color", hexColor);
json.put("icon", iconKey);
return json;
}

private void getIcon(ReadableMap data) {
if (data.hasKey("icon")) {
hasIcon = true;
String iconKey = data.getString("icon");
iconKey = data.getString("icon");
switch (iconKey) {
case "m":
icon = 0xe96c;
Expand Down