File tree Expand file tree Collapse file tree
simplified-app-shared/src/main/java/org/nypl/simplified/app/catalog Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1052,18 +1052,20 @@ public Object some(final Some<URI> s) {
10521052 }
10531053 };
10541054
1055- if (related_book_link .isSome ()) {
1056- final Button books_button = CatalogBookDetailView .this .related_books_button ;
1057- if (books_button != null ) {
1058- // set the "Related Books" section visibility to display, and set the button to listen for user actions
1059- CatalogBookDetailView .this .related_layout .setVisibility (View .VISIBLE );
1060-
1061- books_button .setOnClickListener (related_book_listener );
1055+ UIThread .runOnUIThread (() -> {
1056+ if (related_book_link .isSome ()) {
1057+ final Button books_button = CatalogBookDetailView .this .related_books_button ;
1058+ if (books_button != null ) {
1059+ // set the "Related Books" section visibility to display, and set the button to listen for user actions
1060+ CatalogBookDetailView .this .related_layout .setVisibility (View .VISIBLE );
1061+
1062+ books_button .setOnClickListener (related_book_listener );
1063+ }
10621064 }
1063- }
10641065
1065- final Button report_button = this .book_download_report_button ;
1066- report_button .setOnClickListener (new CatalogBookReport (this .activity , e ));
1066+ final Button report_button = this .book_download_report_button ;
1067+ report_button .setOnClickListener (new CatalogBookReport (this .activity , e ));
1068+ });
10671069 }//onStatus
10681070
10691071
You can’t perform that action at this time.
0 commit comments