Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
// Apply transparent background theme to the dialog
BottomSheetDialog dialog = new BottomSheetDialog(requireContext(), R.style.BottomSheetDialogTheme);
dialog.setOnShowListener(dialogInterface -> {
// Check if the fragment is still attached to avoid IllegalStateException
if (getActivity() == null || !isAdded()) {
return;
}

FrameLayout bottomSheet = dialog.findViewById(com.google.android.material.R.id.design_bottom_sheet);
if (bottomSheet != null) {
// Set the bottom sheet to be full screen
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/io/netbird/client/ui/home/HomeFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;

import com.airbnb.lottie.LottieAnimationView;
Expand All @@ -22,7 +21,6 @@
import io.netbird.client.StateListener;
import io.netbird.client.StateListenerRegistry;
import io.netbird.client.databinding.FragmentHomeBinding;
import io.netbird.client.ui.PreferenceUI;
import io.netbird.gomobile.android.PeerInfo;
import io.netbird.gomobile.android.PeerInfoArray;

Expand Down Expand Up @@ -126,6 +124,8 @@ public void onDestroyView() {
super.onDestroyView();
buttonAnimation.destroy();
stateListenerRegistry.unregisterServiceStateListener(this);
FrameLayout openPanelCardView = binding.peersBtn;
openPanelCardView.setOnClickListener(null);
binding = null;
}

Expand Down
Loading