* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* 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.
*
* You should have received a copy of the GNU General Public License
import androidx.fragment.app.FragmentManager;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.stoutner.privacybrowser.R;
import com.stoutner.privacybrowser.activities.DomainsActivity;
import androidx.fragment.app.FragmentManager;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.stoutner.privacybrowser.R;
import com.stoutner.privacybrowser.activities.DomainsActivity;
private DismissSnackbarInterface dismissSnackbarInterface;
// Define the public dismiss snackbar interface.
private DismissSnackbarInterface dismissSnackbarInterface;
// Define the public dismiss snackbar interface.
// Inflate `domains_list_fragment`. `false` does not attach it to the root `container`.
View domainsListFragmentView = inflater.inflate(R.layout.domains_list_fragment, container, false);
// Inflate `domains_list_fragment`. `false` does not attach it to the root `container`.
View domainsListFragmentView = inflater.inflate(R.layout.domains_list_fragment, container, false);
ListView domainsListView = domainsListFragmentView.findViewById(R.id.domains_listview);
// Remove the incorrect lint error below that `.getSupportFragmentManager()` might be null.
ListView domainsListView = domainsListFragmentView.findViewById(R.id.domains_listview);
// Remove the incorrect lint error below that `.getSupportFragmentManager()` might be null.
// Get a handle for the domain settings fragment.
Fragment domainSettingsFragment = supportFragmentManager.findFragmentById(R.id.domain_settings_fragment_container);
// Get a handle for the domain settings fragment.
Fragment domainSettingsFragment = supportFragmentManager.findFragmentById(R.id.domain_settings_fragment_container);
assert domainSettingsFragment != null;
// Get a handle for the domain settings fragment view.
View domainSettingsFragmentView = domainSettingsFragment.getView();
assert domainSettingsFragment != null;
// Get a handle for the domain settings fragment view.
View domainSettingsFragmentView = domainSettingsFragment.getView();
DomainSettingsFragment domainSettingsFragment = new DomainSettingsFragment();
domainSettingsFragment.setArguments(argumentsBundle);
DomainSettingsFragment domainSettingsFragment = new DomainSettingsFragment();
domainSettingsFragment.setArguments(argumentsBundle);
if (DomainsActivity.twoPanedMode) { // The device in in two-paned mode.
// enable `deleteMenuItem` if the system is not waiting for a `Snackbar` to be dismissed.
if (!DomainsActivity.dismissingSnackbar) {
// Enable the delete menu item.
DomainsActivity.deleteMenuItem.setEnabled(true);
if (DomainsActivity.twoPanedMode) { // The device in in two-paned mode.
// enable `deleteMenuItem` if the system is not waiting for a `Snackbar` to be dismissed.
if (!DomainsActivity.dismissingSnackbar) {
// Enable the delete menu item.
DomainsActivity.deleteMenuItem.setEnabled(true);
- // Set the delete icon according to the theme.
- if (MainWebViewActivity.darkTheme) {
- DomainsActivity.deleteMenuItem.setIcon(R.drawable.delete_dark);
- } else {
- DomainsActivity.deleteMenuItem.setIcon(R.drawable.delete_light);
- }
+ // Set the delete icon.
+ DomainsActivity.deleteMenuItem.setIcon(R.drawable.delete_enabled);
}
// Display the domain settings fragment.
supportFragmentManager.beginTransaction().replace(R.id.domain_settings_fragment_container, domainSettingsFragment).commit();
} else { // The device in in single-paned mode
}
// Display the domain settings fragment.
supportFragmentManager.beginTransaction().replace(R.id.domain_settings_fragment_container, domainSettingsFragment).commit();
} else { // The device in in single-paned mode
// Show `deleteMenuItem` if the system is not waiting for a `Snackbar` to be dismissed.
if (!DomainsActivity.dismissingSnackbar) {
DomainsActivity.deleteMenuItem.setVisible(true);
// Show `deleteMenuItem` if the system is not waiting for a `Snackbar` to be dismissed.
if (!DomainsActivity.dismissingSnackbar) {
DomainsActivity.deleteMenuItem.setVisible(true);