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

updated setupGuideLayout in abstract class PSLabSensor to hide image if not available in a sensor's bottomsheet guide #2178

Merged
merged 2 commits into from
Jun 4, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/src/main/java/io/pslab/fragment/HomeFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
unbinder = ButterKnife.bind(this, view);
stepsHeader.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG);
deviceDescription.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG);
wvProgressBar = (ProgressBar) view.findViewById(R.id.web_view_progress);

if (deviceFound & deviceConnected) {
tvConnectMsg.setVisibility(View.GONE);
try {
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/java/io/pslab/models/PSLabSensor.java
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,12 @@ private void setupGuideLayout() {
bottomSheetText.setText(getGuideAbstract());
bottomSheetSchematic.setImageResource(getGuideSchematics());
bottomSheetDesc.setText(getGuideDescription());
// if sensor doesn't image in it's guide and hence returns 0 for getGuideSchematics(), hide the visibility of bottomSheetSchematic
if (getGuideSchematics() != 0) {
bottomSheetSchematic.setImageResource(getGuideSchematics());
}else{
bottomSheetSchematic.setVisibility(View.GONE);
}
// If a sensor has extra content than provided in the standard layout, create a new layout
// and attach the layout id with getGuideExtraContent()
if (getGuideExtraContent() != 0) {
Expand Down