import android.os.Bundle;
import android.view.MenuItem;
+import org.strongswan.android.R;
import org.strongswan.android.data.VpnProfileDataSource;
+import org.strongswan.android.utils.Utils;
import androidx.activity.OnBackPressedCallback;
import androidx.annotation.Nullable;
protected void onCreate(@Nullable Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
+ setContentView(R.layout.selected_applications_activity);
WindowCompat.enableEdgeToEdge(getWindow());
- WindowCompat.setDecorFitsSystemWindows(getWindow(), true);
+ Utils.applyWindowInsetsAsMarginsForLists(findViewById(R.id.fragment_container));
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
if (mApps == null)
{
mApps = new SelectedApplicationsListFragment();
- fm.beginTransaction().add(android.R.id.content, mApps, LIST_TAG).commit();
+ fm.beginTransaction().add(R.id.fragment_container, mApps, LIST_TAG).commit();
}
}
import org.strongswan.android.data.VpnProfileDataSource;
import org.strongswan.android.ui.adapter.SelectedApplicationEntry;
import org.strongswan.android.ui.adapter.SelectedApplicationsAdapter;
+import org.strongswan.android.utils.Utils;
import java.util.ArrayList;
import java.util.Collections;
super.onViewCreated(view, savedInstanceState);
requireActivity().addMenuProvider(this, getViewLifecycleOwner());
+ getListView().setClipToPadding(false);
+ Utils.applyWindowInsetsAsPaddingForLists(getListView());
+
final boolean readOnly = getActivity().getIntent().getBooleanExtra(VpnProfileDataSource.KEY_READ_ONLY, false);
getListView().setChoiceMode(readOnly ? ListView.CHOICE_MODE_NONE : ListView.CHOICE_MODE_MULTIPLE);
import android.os.Bundle;
import android.view.MenuItem;
+import org.strongswan.android.R;
+
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.view.WindowCompat;
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
+ setContentView(R.layout.settings_activity);
WindowCompat.enableEdgeToEdge(getWindow());
- WindowCompat.setDecorFitsSystemWindows(getWindow(), true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
- getSupportFragmentManager().beginTransaction()
- .replace(android.R.id.content, new SettingsFragment())
- .commit();
+ if (savedInstanceState == null)
+ {
+ getSupportFragmentManager().beginTransaction()
+ .setReorderingAllowed(true)
+ .add(R.id.fragment_container, SettingsFragment.class, null)
+ .commit();
+ }
}
@Override
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDialogFragment;
-import androidx.core.view.WindowCompat;
import androidx.fragment.app.FragmentTransaction;
public class TrustedCertificateImportActivity extends AppCompatActivity
import org.strongswan.android.logic.TrustedCertificateManager.TrustedCertificateSource;
import org.strongswan.android.security.TrustedCertificateEntry;
import org.strongswan.android.ui.CertificateDeleteConfirmationDialog.OnCertificateDeleteListener;
-import org.strongswan.android.utils.Utils;
import java.security.KeyStore;
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2025 Tobias Brunner
+
+ Copyright (C) secunet Security Networks AG
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2 of the License, or (at your
+ option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+-->
+<androidx.fragment.app.FragmentContainerView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/fragment_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2025 Tobias Brunner
+
+ Copyright (C) secunet Security Networks AG
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2 of the License, or (at your
+ option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+-->
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/fragment_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:fitsSystemWindows="true" />