set theme for dialogs
This commit is contained in:
		| @ -10,7 +10,7 @@ | ||||
|         android:label="@string/app_name" | ||||
|         android:roundIcon="@mipmap/ic_launcher_round" | ||||
|         android:supportsRtl="true" | ||||
|         android:theme="@style/AppThemeLight"> | ||||
|         android:theme="@style/AppTheme.Light"> | ||||
|         <activity | ||||
|             android:name=".SplashActivity" | ||||
|             android:label="@string/app_name" | ||||
|  | ||||
| @ -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() | ||||
|         } | ||||
|  | ||||
| @ -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() { | ||||
|  | ||||
|  | ||||
| @ -3,7 +3,7 @@ | ||||
|     android:height="24dp" | ||||
|     android:viewportWidth="24" | ||||
|     android:viewportHeight="24" | ||||
|     android:tint="?attr/colorControlNormal"> | ||||
|     android:tint="?attr/iconAction"> | ||||
|   <path | ||||
|       android:fillColor="@android:color/white" | ||||
|       android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/> | ||||
|  | ||||
| @ -16,6 +16,7 @@ | ||||
|         android:iconifiedByDefault="false" | ||||
|         android:paddingBottom="5dp" | ||||
|         android:queryHint="@string/search_hint" | ||||
|         android:searchIcon="@drawable/ic_baseline_search_24" | ||||
|         app:layout_constraintEnd_toEndOf="parent" | ||||
|         app:layout_constraintStart_toStartOf="parent" | ||||
|         app:layout_constraintTop_toTopOf="parent"> | ||||
|  | ||||
| @ -60,4 +60,9 @@ | ||||
|         <copyright>Copyright 2020 Wasabeef</copyright> | ||||
|         <license>Apache Software License 2.0</license> | ||||
|     </notice> | ||||
|     <notice> | ||||
|         <name>The Movie Database API</name> | ||||
|         <url>https://www.themoviedb.org</url> | ||||
|         <copyright>This product uses the TMDb API but is not endorsed or certified by TMDb</copyright> | ||||
|     </notice> | ||||
| </notices> | ||||
| @ -17,7 +17,7 @@ | ||||
|  | ||||
|     <!-- dark theme colors --> | ||||
|     <color name="themePrimaryDark">#000000</color> | ||||
|     <color name="themeSecondaryDark">#303030</color> | ||||
|     <color name="themeSecondaryDark">#171717</color> | ||||
|     <color name="textPrimaryDark">#deffffff</color> | ||||
|     <color name="textSecondaryDark">#99ffffff</color> | ||||
|     <color name="iconActionDark">#99ffffff</color> | ||||
|  | ||||
							
								
								
									
										33
									
								
								app/src/main/res/values/css_style.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								app/src/main/res/values/css_style.xml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,33 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <resources> | ||||
|     <string name="license_dialog_style_light" translatable="false"> | ||||
|         body { | ||||
|             background-color: #ffffff; | ||||
|             color: #000000; | ||||
|             font-family: sans-serif; | ||||
|             overflow-wrap: break-word; | ||||
|         } | ||||
|         pre { | ||||
|             background-color: #eeeeee; | ||||
|             padding: 1em; | ||||
|             white-space: pre-wrap; | ||||
|         } | ||||
|     </string> | ||||
|  | ||||
|     <string name="license_dialog_style_dark" translatable="false"> | ||||
|         body { | ||||
|             background-color: #303030; | ||||
|             color: #ffffff; | ||||
|             font-family: sans-serif; | ||||
|             overflow-wrap: break-word; | ||||
|         } | ||||
|         pre { | ||||
|             background-color: #424242; | ||||
|             padding: 1em; | ||||
|             white-space: pre-wrap; | ||||
|         } | ||||
|         li a { | ||||
|             color: #21a3df; | ||||
|         } | ||||
|     </string> | ||||
| </resources> | ||||
| @ -6,7 +6,7 @@ | ||||
|         <item name="colorAccent">@color/colorAccent</item> | ||||
|     </style> | ||||
|  | ||||
|     <style name="AppThemeLight" parent="AppTheme"> | ||||
|     <style name="AppTheme.Light" parent="AppTheme"> | ||||
|         <item name="themePrimary">@color/themePrimaryLight</item> | ||||
|         <item name="themeSecondary">@color/themeSecondaryLight</item> | ||||
|         <item name="textPrimary">@color/textPrimaryLight</item> | ||||
| @ -14,13 +14,15 @@ | ||||
|         <item name="android:textColor">@color/textPrimaryLight</item> | ||||
|         <item name="android:textColorPrimary">@color/textPrimaryLight</item> | ||||
|         <item name="android:textColorHint">@color/textSecondaryLight</item> | ||||
|  | ||||
|         <item name="iconAction">@color/iconActionLight</item> | ||||
|         <item name="iconNoAction">@color/iconNoActionLight</item> | ||||
|         <item name="buttonBackground">@color/buttonBackgroundLight</item> | ||||
|         <item name="md_background_color">@color/themeSecondaryLight</item> | ||||
|         <item name="md_color_title">@color/textPrimaryLight</item> | ||||
|         <item name="md_color_content">@color/textSecondaryLight</item> | ||||
|     </style> | ||||
|  | ||||
|     <style name="AppThemeDark" parent="AppTheme"> | ||||
|     <style name="AppTheme.Dark" parent="AppTheme"> | ||||
|         <item name="themePrimary">@color/themePrimaryDark</item> | ||||
|         <item name="themeSecondary">@color/themeSecondaryDark</item> | ||||
|         <item name="textPrimary">@color/textPrimaryDark</item> | ||||
| @ -28,10 +30,16 @@ | ||||
|         <item name="android:textColor">@color/textPrimaryDark</item> | ||||
|         <item name="android:textColorPrimary">@color/textPrimaryDark</item> | ||||
|         <item name="android:textColorHint">@color/textSecondaryDark</item> | ||||
|  | ||||
|         <item name="iconAction">@color/iconActionDark</item> | ||||
|         <item name="iconNoAction">@color/iconNoActionDark</item> | ||||
|         <item name="buttonBackground">@color/buttonBackgroundDark</item> | ||||
|         <item name="md_background_color">@color/themeSecondaryDark</item> | ||||
|         <item name="md_color_title">@color/textPrimaryDark</item> | ||||
|         <item name="md_color_content">@color/textSecondaryDark</item> | ||||
|     </style> | ||||
|  | ||||
|     <style name="LicensesDialogTheme.Dark" parent="Theme.AppCompat.Dialog"> | ||||
|         <item name="android:windowBackground">@color/themeSecondaryDark</item> | ||||
|     </style> | ||||
|  | ||||
|     <!-- player theme --> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user