added check for descriptionTv

This commit is contained in:
Chumva 2018-03-17 13:32:09 +02:00
parent 267f3f5ef6
commit ff116a08db

View file

@ -48,11 +48,13 @@ public class BottomSheetItemWithDescription extends SimpleBottomSheetItem {
public void inflate(OsmandApplication app, ViewGroup container, boolean nightMode) { public void inflate(OsmandApplication app, ViewGroup container, boolean nightMode) {
super.inflate(app, container, nightMode); super.inflate(app, container, nightMode);
descriptionTv = (TextView) view.findViewById(R.id.description); descriptionTv = (TextView) view.findViewById(R.id.description);
if (descriptionTv != null) {
descriptionTv.setText(description); descriptionTv.setText(description);
if (descriptionColorId != INVALID_ID) { if (descriptionColorId != INVALID_ID) {
descriptionTv.setTextColor(ContextCompat.getColor(app, descriptionColorId)); descriptionTv.setTextColor(ContextCompat.getColor(app, descriptionColorId));
} }
} }
}
public static class Builder extends SimpleBottomSheetItem.Builder { public static class Builder extends SimpleBottomSheetItem.Builder {