set theme for dialogs

This commit is contained in:
2020-11-23 09:53:44 +01:00
parent 830f7e753b
commit 0e5c697bce
9 changed files with 68 additions and 11 deletions

View File

@ -46,11 +46,24 @@ class AccountFragment : Fragment() {
}
text_licenses.setOnClickListener {
val selectedTheme = requireContext().applicationInfo.theme
val dialogCss = when (selectedTheme) {
R.style.AppTheme_Dark -> R.string.license_dialog_style_dark
else -> R.string.license_dialog_style_light
}
val themeId = when (selectedTheme) {
R.style.AppTheme_Dark -> R.style.LicensesDialogTheme_Dark
else -> R.style.AppTheme_Light
}
LicensesDialog.Builder(requireContext())
.setNotices(R.raw.notices)
.setTitle(R.string.licenses)
.setIncludeOwnLicense(true)
.setThemeResourceId(R.style.AppTheme)
.setThemeResourceId(themeId)
.setNoticesCssStyle(dialogCss)
.build()
.show()
}

View File

@ -1,6 +1,5 @@
package org.mosad.teapod.ui.fragments
import android.R.color
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
@ -17,8 +16,6 @@ import org.mosad.teapod.parser.AoDParser
import org.mosad.teapod.util.StorageController
import org.mosad.teapod.util.adapter.MediaItemAdapter
import org.mosad.teapod.util.decoration.MediaItemDecoration
import java.lang.String
class HomeFragment : Fragment() {