Resolve deprecation warnings

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-02-23 20:09:46 +05:30
parent eb5bfa9b5d
commit 0b45151a3d
2 changed files with 4 additions and 7 deletions

View File

@ -171,11 +171,10 @@ public class TunnelEditorFragment extends BaseFragment implements AppExclusionLi
}
public void onRequestSetExcludedApplications(@SuppressWarnings("unused") final View view) {
final FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null && binding != null) {
if (binding != null) {
final ArrayList<String> excludedApps = new ArrayList<>(binding.getConfig().getInterface().getExcludedApplications());
final AppListDialogFragment fragment = AppListDialogFragment.newInstance(excludedApps, this);
fragment.show(fragmentManager, null);
fragment.show(getParentFragmentManager(), null);
}
}

View File

@ -79,9 +79,7 @@ public class TunnelListFragment extends BaseFragment {
Config.parse(new ByteArrayInputStream(configText.getBytes(StandardCharsets.UTF_8)));
// Config text is valid, now create the tunnel
final FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null)
ConfigNamingDialogFragment.newInstance(configText).show(fragmentManager, null);
ConfigNamingDialogFragment.newInstance(configText).show(getParentFragmentManager(), null);
} catch (final BadConfigException | IOException e) {
onTunnelImportFinished(Collections.emptyList(), Collections.singletonList(e));
}
@ -220,7 +218,7 @@ public class TunnelListFragment extends BaseFragment {
binding.createFab.setOnClickListener(v -> {
final AddTunnelsSheet bottomSheet = new AddTunnelsSheet();
bottomSheet.setTargetFragment(this, REQUEST_TARGET_FRAGMENT);
bottomSheet.show(requireFragmentManager(), "BOTTOM_SHEET");
bottomSheet.show(getParentFragmentManager(), "BOTTOM_SHEET");
});
binding.executePendingBindings();
EdgeToEdge.setUpRoot((ViewGroup) binding.getRoot());