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-3857): only allow text view data #157

Merged
merged 1 commit into from
Dec 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void setData(DataRow dataRow, int rowHeight, CellContentStyle cellContent
}

CellView cellView = (CellView) row.getChildAt(columnIndex);
if(column.representation.type.equals("image")) {
if(column.representation.type.equals("image") && !dataProvider.isDataView) {
LinearLayout.LayoutParams layout = new LinearLayout.LayoutParams(column.width, ViewGroup.LayoutParams.MATCH_PARENT);
cellView.setLayoutParams(layout);
cellView.convertCellContentType("image", column);
Expand All @@ -72,7 +72,7 @@ public void setData(DataRow dataRow, int rowHeight, CellContentStyle cellContent
ClickableImageView imageView = (ClickableImageView) cellView.content;
imageView.setImageBitmap(imageBitmap);
imageView.scaleAndPositionImage(column, imageBitmap);
} else if(column.representation.type.equals("miniChart")) {
} else if(column.representation.type.equals("miniChart") && !dataProvider.isDataView) {
LinearLayout.LayoutParams cellViewLayoutParams = new LinearLayout.LayoutParams(column.width, ViewGroup.LayoutParams.MATCH_PARENT);
cellView.setLayoutParams(cellViewLayoutParams);
cellView.setData(cell, dataRow, column);
Expand All @@ -81,20 +81,19 @@ public void setData(DataRow dataRow, int rowHeight, CellContentStyle cellContent
miniChartView.setData(cell, column);
} else {
cellView.convertCellContentType("text", column);

ClickableTextView textView = (ClickableTextView) cellView.content;
RelativeLayout.LayoutParams textViewLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
textView.setLayoutParams(textViewLayoutParams);
LinearLayout.LayoutParams cellViewLayoutParams = new LinearLayout.LayoutParams(column.width, ViewGroup.LayoutParams.MATCH_PARENT);
cellViewLayoutParams.gravity = Gravity.TOP;
cellView.setLayoutParams(cellViewLayoutParams);

if(column.representation.type.equals("text")) {
if(column.representation.type.equals("text") || dataProvider.isDataView) {
cell.indicator = null;
}

cellView.setData(cell, dataRow, column);
if(column.representation.type.equals("url")) {
if(column.representation.type.equals("url") && !dataProvider.isDataView) {
setupHyperLink(textView);
}
if(column.isDim && cellContentStyle.wrap) {
Expand Down