Setup EdgeToEdge

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-02-23 20:00:19 +05:30
parent c889a8c8de
commit e5e2e7571f
3 changed files with 10 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import com.wireguard.android.databinding.TunnelDetailFragmentBinding;
import com.wireguard.android.databinding.TunnelDetailPeerBinding;
import com.wireguard.android.model.Tunnel;
import com.wireguard.android.model.Tunnel.State;
import com.wireguard.android.ui.EdgeToEdge;
import com.wireguard.crypto.Key;
import java.util.Timer;
@ -72,6 +73,8 @@ public class TunnelDetailFragment extends BaseFragment {
super.onCreateView(inflater, container, savedInstanceState);
binding = TunnelDetailFragmentBinding.inflate(inflater, container, false);
binding.executePendingBindings();
EdgeToEdge.setUpRoot((ViewGroup) binding.getRoot());
EdgeToEdge.setUpScrollingContent((ViewGroup) binding.getRoot(), null);
return binding.getRoot();
}

View File

@ -28,6 +28,7 @@ import com.wireguard.android.databinding.TunnelEditorFragmentBinding;
import com.wireguard.android.fragment.AppListDialogFragment.AppExclusionListener;
import com.wireguard.android.model.Tunnel;
import com.wireguard.android.model.TunnelManager;
import com.wireguard.android.ui.EdgeToEdge;
import com.wireguard.android.util.ErrorMessages;
import com.wireguard.android.viewmodel.ConfigProxy;
import com.wireguard.config.Config;
@ -89,6 +90,8 @@ public class TunnelEditorFragment extends BaseFragment implements AppExclusionLi
super.onCreateView(inflater, container, savedInstanceState);
binding = TunnelEditorFragmentBinding.inflate(inflater, container, false);
binding.executePendingBindings();
EdgeToEdge.setUpRoot((ViewGroup) binding.getRoot());
EdgeToEdge.setUpScrollingContent(binding.mainContainer, null);
return binding.getRoot();
}

View File

@ -37,6 +37,7 @@ import com.wireguard.android.databinding.ObservableKeyedRecyclerViewAdapter;
import com.wireguard.android.databinding.TunnelListFragmentBinding;
import com.wireguard.android.databinding.TunnelListItemBinding;
import com.wireguard.android.model.Tunnel;
import com.wireguard.android.ui.EdgeToEdge;
import com.wireguard.android.util.ErrorMessages;
import com.wireguard.android.widget.MultiselectableRelativeLayout;
import com.wireguard.config.BadConfigException;
@ -222,6 +223,9 @@ public class TunnelListFragment extends BaseFragment {
bottomSheet.show(requireFragmentManager(), "BOTTOM_SHEET");
});
binding.executePendingBindings();
EdgeToEdge.setUpRoot((ViewGroup) binding.getRoot());
EdgeToEdge.setUpFAB(binding.createFab);
EdgeToEdge.setUpScrollingContent(binding.tunnelList, binding.createFab);
return binding.getRoot();
}