@@ -186,10 +186,7 @@ private void fetchSharees() {
186186 return Unit .INSTANCE ;
187187 }, () -> {
188188 showShareContainer ();
189- final var view = getView ();
190- if (view != null ) {
191- DisplayUtils .showSnackMessage (view , R .string .error_fetching_sharees );
192- }
189+ DisplayUtils .showSnackMessage (this , R .string .error_fetching_sharees );
193190 return Unit .INSTANCE ;
194191 });
195192 }
@@ -414,10 +411,7 @@ public void copyInternalLink() {
414411 OwnCloudAccount account = accountManager .getCurrentOwnCloudAccount ();
415412
416413 if (account == null ) {
417- final var view = getView ();
418- if (view != null ) {
419- DisplayUtils .showSnackMessage (view , getString (R .string .could_not_retrieve_url ));
420- }
414+ DisplayUtils .showSnackMessage (this , R .string .could_not_retrieve_url );
421415 return ;
422416 }
423417
@@ -581,10 +575,7 @@ public void refreshSharesFromDB() {
581575 }
582576
583577 if (internalShareeListAdapter == null ) {
584- final var view = getView ();
585- if (view != null ) {
586- DisplayUtils .showSnackMessage (view , getString (R .string .could_not_retrieve_shares ));
587- }
578+ DisplayUtils .showSnackMessage (this , R .string .could_not_retrieve_shares );
588579 return ;
589580 }
590581
@@ -642,7 +633,7 @@ private void pickContactEmail() {
642633 if (intent .resolveActivity (requireContext ().getPackageManager ()) != null ) {
643634 onContactSelectionResultLauncher .launch (intent );
644635 } else {
645- DisplayUtils .showSnackMessage (requireActivity (), getString ( R .string .file_detail_sharing_fragment_no_contact_app_message ) );
636+ DisplayUtils .showSnackMessage (this , R .string .file_detail_sharing_fragment_no_contact_app_message );
646637 }
647638 }
648639
@@ -665,16 +656,16 @@ private void handleContactResult(@NonNull Uri contactUri) {
665656 binding .searchView .requestFocus ();
666657 });
667658 } else {
668- DisplayUtils .showSnackMessage (binding . getRoot () , R .string .email_pick_failed );
659+ DisplayUtils .showSnackMessage (this , R .string .email_pick_failed );
669660 Log_OC .e (FileDetailSharingFragment .class .getSimpleName (), "Failed to pick email address." );
670661 }
671662 } else {
672- DisplayUtils .showSnackMessage (binding . getRoot () , R .string .email_pick_failed );
663+ DisplayUtils .showSnackMessage (this , R .string .email_pick_failed );
673664 Log_OC .e (FileDetailSharingFragment .class .getSimpleName (), "Failed to pick email address as no Email found." );
674665 }
675666 cursor .close ();
676667 } else {
677- DisplayUtils .showSnackMessage (binding . getRoot () , R .string .email_pick_failed );
668+ DisplayUtils .showSnackMessage (this , R .string .email_pick_failed );
678669 Log_OC .e (FileDetailSharingFragment .class .getSimpleName (), "Failed to pick email address as Cursor is null." );
679670 }
680671 }
@@ -737,10 +728,7 @@ public void unShare(OCShare share) {
737728 fileDataStorageManager .updateFileEntity (entity );
738729 }
739730 } else {
740- final var view = getView ();
741- if (view != null ) {
742- DisplayUtils .showSnackMessage (view , getString (R .string .failed_update_ui ));
743- }
731+ DisplayUtils .showSnackMessage (this , R .string .failed_update_ui );
744732 }
745733 }
746734
@@ -778,7 +766,7 @@ public void openShareDetailWithCustomPermissions(OCShare share) {
778766 if (isGranted ) {
779767 pickContactEmail ();
780768 } else {
781- DisplayUtils .showSnackMessage (binding . getRoot () , R .string .contact_no_permission );
769+ DisplayUtils .showSnackMessage (this , R .string .contact_no_permission );
782770 }
783771 });
784772
@@ -789,13 +777,13 @@ public void openShareDetailWithCustomPermissions(OCShare share) {
789777 if (result .getResultCode () == Activity .RESULT_OK ) {
790778 Intent intent = result .getData ();
791779 if (intent == null ) {
792- DisplayUtils .showSnackMessage (binding . getRoot () , R .string .email_pick_failed );
780+ DisplayUtils .showSnackMessage (this , R .string .email_pick_failed );
793781 return ;
794782 }
795783
796784 Uri contactUri = intent .getData ();
797785 if (contactUri == null ) {
798- DisplayUtils .showSnackMessage (binding . getRoot () , R .string .email_pick_failed );
786+ DisplayUtils .showSnackMessage (this , R .string .email_pick_failed );
799787 return ;
800788 }
801789
0 commit comments