From 070216f4871d89a7428e851bb6fa4ea1afdfbfad Mon Sep 17 00:00:00 2001 From: MohitMali Date: Thu, 10 Nov 2022 16:48:34 +0530 Subject: [PATCH] Convert Constants.java into kotlin --- templates/Constants.java | 16 ---------------- templates/Constants.kt | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 16 deletions(-) delete mode 100644 templates/Constants.java create mode 100644 templates/Constants.kt diff --git a/templates/Constants.java b/templates/Constants.java deleted file mode 100644 index 2d902377d0..0000000000 --- a/templates/Constants.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.kiwix.kiwixmobile.settings; - -public class Constants { - public static final boolean IS_CUSTOM_APP = true; - public static final String CUSTOM_APP_ID = "~package~"; - public static final boolean CUSTOM_APP_HAS_EMBEDDED_ZIM = ~embed_zim~; - public static final String CUSTOM_APP_ZIM_FILE_NAME = "~zim_name~"; - public static final long CUSTOM_APP_ZIM_FILE_SIZE = ~zim_size~L; - public static final String CUSTOM_APP_VERSION_NAME = "~version_name~"; - public static final int CUSTOM_APP_VERSION_CODE = ~version_code~; - public static final int CUSTOM_APP_CONTENT_VERSION_CODE = ~content_version_code~; - public static final String CUSTOM_APP_WEBSITE = "~website~"; - public static final String CUSTOM_APP_EMAIL = "~support_email~"; - public static final String CUSTOM_APP_SUPPORT_EMAIL = "~support_email~"; - public static final String CUSTOM_APP_ENFORCED_LANG = "~enforced_lang~"; -} diff --git a/templates/Constants.kt b/templates/Constants.kt new file mode 100644 index 0000000000..38b2a5776b --- /dev/null +++ b/templates/Constants.kt @@ -0,0 +1,34 @@ +/* + * Kiwix Android + * Copyright (c) 2022 Kiwix + * 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. + * + * 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 this program. If not, see . + * + */ + +package org.kiwix.kiwixmobile.settings + +object Constants { + const val IS_CUSTOM_APP = true + const val CUSTOM_APP_ID = "~package~" + const val CUSTOM_APP_HAS_EMBEDDED_ZIM = embed_zim.inv().toBoolean() + const val CUSTOM_APP_ZIM_FILE_NAME = "~zim_name~" + const val CUSTOM_APP_ZIM_FILE_SIZE = zim_size.inv().toLong() + const val CUSTOM_APP_VERSION_NAME = "~version_name~" + const val CUSTOM_APP_VERSION_CODE: Int = version_code.inv() + const val CUSTOM_APP_CONTENT_VERSION_CODE: Int = content_version_code.inv() + const val CUSTOM_APP_WEBSITE = "~website~" + const val CUSTOM_APP_EMAIL = "~support_email~" + const val CUSTOM_APP_SUPPORT_EMAIL = "~support_email~" + const val CUSTOM_APP_ENFORCED_LANG = "~enforced_lang~" +}