Skip to content

Commit db88ff7

Browse files
authored
fix: updated guide layout to hide image (#2178)
* Fixed NullPointerException in HomeFragment by initializing wvProgressBar * updated setupGuideLayout in abstract class PSLabSensor to hide image if not available in a sensor's bottomsheet guide
1 parent 22466ea commit db88ff7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/main/java/io/pslab/models/PSLabSensor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,12 @@ private void setupGuideLayout() {
588588
bottomSheetText.setText(getGuideAbstract());
589589
bottomSheetSchematic.setImageResource(getGuideSchematics());
590590
bottomSheetDesc.setText(getGuideDescription());
591+
// if sensor doesn't image in it's guide and hence returns 0 for getGuideSchematics(), hide the visibility of bottomSheetSchematic
592+
if (getGuideSchematics() != 0) {
593+
bottomSheetSchematic.setImageResource(getGuideSchematics());
594+
}else{
595+
bottomSheetSchematic.setVisibility(View.GONE);
596+
}
591597
// If a sensor has extra content than provided in the standard layout, create a new layout
592598
// and attach the layout id with getGuideExtraContent()
593599
if (getGuideExtraContent() != 0) {

0 commit comments

Comments
 (0)