PrivacyPolicyActivity.kt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* _____ _
  2. * |_ _| |_ _ _ ___ ___ _ __ __ _
  3. * | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. * |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. *
  6. * Threema for Android
  7. * Copyright (c) 2013-2025 Threema GmbH
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License, version 3,
  11. * as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. */
  21. package ch.threema.app.webviews
  22. import android.content.Context
  23. import ch.threema.android.buildActivityIntent
  24. import ch.threema.app.R
  25. import ch.threema.app.utils.ConfigUtils
  26. import ch.threema.app.utils.logScreenVisibility
  27. import ch.threema.base.utils.getThreemaLogger
  28. private val logger = getThreemaLogger("PrivacyPolicyActivity")
  29. class PrivacyPolicyActivity : SimpleWebViewActivity() {
  30. init {
  31. logScreenVisibility(logger)
  32. }
  33. override fun getWebViewTitle() = R.string.privacy_policy
  34. override fun getWebViewUrl(isDarkTheme: Boolean) = ConfigUtils.getPrivacyPolicyURL(
  35. /* context = */
  36. this,
  37. /* isDarkTheme = */
  38. isDarkTheme,
  39. )
  40. companion object {
  41. @JvmStatic
  42. fun createIntent(context: Context, forceDarkTheme: Boolean = false) = buildActivityIntent<PrivacyPolicyActivity>(context) {
  43. if (forceDarkTheme) {
  44. putExtra(FORCE_DARK_THEME, true)
  45. }
  46. }
  47. }
  48. }