-/*
- * Copyright © 2019-2023 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2019-2023 Soren Stoutner <soren@stoutner.com>
*
- * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
+ * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android/>.
*
- * Privacy Browser Android 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 3 of the License, or
- * (at your option) any later version.
+ * 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 3 of the License, or (at your option) any later
+ * version.
*
- * Privacy Browser Android 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.
+ * 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.
*
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser Android. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.stoutner.privacybrowser.dialogs
// The public interface is used to send information back to the parent activity.
interface UpdateFontSizeListener {
- fun onApplyNewFontSize(dialogFragment: DialogFragment)
+ fun updateFontSize(dialogFragment: DialogFragment)
}
override fun onAttach(context: Context) {
// Set the apply button listener.
dialogBuilder.setPositiveButton(R.string.apply) { _: DialogInterface?, _: Int ->
// Return the dialog fragment to the parent activity.
- updateFontSizeListener.onApplyNewFontSize(this)
+ updateFontSizeListener.updateFontSize(this)
}
// Create an alert dialog from the builder.
// Check the key code, event, and button status.
if (keyEvent.action == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_ENTER) { // The enter key was pressed.
// Trigger the update font size listener and return the dialog fragment to the parent activity.
- updateFontSizeListener.onApplyNewFontSize(this)
+ updateFontSizeListener.updateFontSize(this)
// Manually dismiss the alert dialog.
alertDialog.dismiss()