add light and dark theme
* currently the theme can not be changed
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/AppTheme"> | ||||
|         android:theme="@style/AppThemeLight"> | ||||
|         <activity | ||||
|             android:name=".SplashActivity" | ||||
|             android:label="@string/app_name" | ||||
|  | ||||
| @ -1,5 +1,6 @@ | ||||
| package org.mosad.teapod.ui.fragments | ||||
|  | ||||
| import android.R.color | ||||
| import android.os.Bundle | ||||
| import android.view.LayoutInflater | ||||
| import android.view.View | ||||
| @ -16,13 +17,19 @@ 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() { | ||||
|  | ||||
|     private lateinit var adapterMyList: MediaItemAdapter | ||||
|     private lateinit var adapterNewEpisodes: MediaItemAdapter | ||||
|  | ||||
|     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||||
|     override fun onCreateView( | ||||
|         inflater: LayoutInflater, | ||||
|         container: ViewGroup?, | ||||
|         savedInstanceState: Bundle? | ||||
|     ): View? { | ||||
|         return inflater.inflate(R.layout.fragment_home, container, false) | ||||
|     } | ||||
|  | ||||
|  | ||||
							
								
								
									
										5
									
								
								app/src/main/res/color/bottom_nav_item_tint.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								app/src/main/res/color/bottom_nav_item_tint.xml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <item android:color="?attr/colorPrimary" android:state_checked="true"/> | ||||
|     <item android:color="?attr/iconAction"/> | ||||
| </selector> | ||||
| @ -1,5 +1,5 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <solid android:color="#B0B0B0"/> | ||||
|     <solid android:color="?iconNoAction"/> | ||||
|     <corners android:radius="3dp"/> | ||||
| </shape> | ||||
| @ -9,9 +9,8 @@ | ||||
|         android:id="@+id/nav_view" | ||||
|         android:layout_width="0dp" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:layout_marginStart="0dp" | ||||
|         android:layout_marginEnd="0dp" | ||||
|         android:background="?android:attr/windowBackground" | ||||
|         android:background="?themeSecondary" | ||||
|         app:itemIconTint="@color/bottom_nav_item_tint" | ||||
|         app:layout_constraintBottom_toBottomOf="parent" | ||||
|         app:layout_constraintLeft_toLeftOf="parent" | ||||
|         app:layout_constraintRight_toRightOf="parent" | ||||
|  | ||||
| @ -5,7 +5,7 @@ | ||||
|     android:id="@+id/ff_test" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:background="#f5f5f5" | ||||
|     android:background="?themePrimary" | ||||
|     tools:context=".ui.fragments.HomeFragment"> | ||||
|  | ||||
|     <ScrollView | ||||
|  | ||||
| @ -4,7 +4,7 @@ | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:background="#f5f5f5" | ||||
|     android:background="?themePrimary" | ||||
|     tools:context=".ui.fragments.LibraryFragment"> | ||||
|  | ||||
|     <androidx.recyclerview.widget.RecyclerView | ||||
|  | ||||
| @ -3,7 +3,7 @@ | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:background="#f5f5f5" | ||||
|     android:background="?themePrimary" | ||||
|     android:clickable="true" | ||||
|     android:focusable="true"> | ||||
|  | ||||
|  | ||||
| @ -4,7 +4,7 @@ | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:background="#f5f5f5" | ||||
|     android:background="?themePrimary" | ||||
|     tools:context=".ui.fragments.MediaFragment"> | ||||
|  | ||||
|     <androidx.core.widget.NestedScrollView | ||||
| @ -60,7 +60,7 @@ | ||||
|                     android:layout_width="wrap_content" | ||||
|                     android:layout_height="wrap_content" | ||||
|                     android:layout_marginStart="7dp" | ||||
|                     android:background="@drawable/shape_rounden_corner" | ||||
|                     android:background="@drawable/shape_rounded_corner" | ||||
|                     android:paddingStart="3dp" | ||||
|                     android:paddingTop="2dp" | ||||
|                     android:paddingEnd="3dp" | ||||
| @ -86,11 +86,12 @@ | ||||
|                 android:gravity="center" | ||||
|                 android:text="@string/button_play" | ||||
|                 android:textAllCaps="false" | ||||
|                 android:textColor="@android:color/primary_text_dark" | ||||
|                 android:textColor="?themePrimary" | ||||
|                 android:textSize="16sp" | ||||
|                 app:backgroundTint="#4A4141" | ||||
|                 app:backgroundTint="?buttonBackground" | ||||
|                 app:icon="@drawable/ic_baseline_play_arrow_24" | ||||
|                 app:iconGravity="textStart" /> | ||||
|                 app:iconGravity="textStart" | ||||
|                 app:iconTint="?themePrimary" /> | ||||
|  | ||||
|             <TextView | ||||
|                 android:id="@+id/text_title" | ||||
| @ -134,13 +135,14 @@ | ||||
|                         android:layout_width="48dp" | ||||
|                         android:layout_height="48dp" | ||||
|                         android:src="@drawable/ic_baseline_add_24" | ||||
|                         app:tint="#4A4141" /> | ||||
|                         app:tint="?buttonBackground" /> | ||||
|  | ||||
|                     <TextView | ||||
|                         android:id="@+id/text_my_list_action" | ||||
|                         android:layout_width="wrap_content" | ||||
|                         android:layout_height="wrap_content" | ||||
|                         android:text="@string/my_list" | ||||
|                         android:textColor="?textSecondary" | ||||
|                         android:textSize="12sp" /> | ||||
|                 </LinearLayout> | ||||
|             </LinearLayout> | ||||
|  | ||||
| @ -4,14 +4,14 @@ | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:background="#f5f5f5" | ||||
|     android:background="?themePrimary" | ||||
|     tools:context=".ui.fragments.SearchFragment"> | ||||
|  | ||||
|     <SearchView | ||||
|         android:id="@+id/search_text" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="0dp" | ||||
|         android:background="#FFFFFF" | ||||
|         android:background="?themeSecondary" | ||||
|         android:elevation="8dp" | ||||
|         android:iconifiedByDefault="false" | ||||
|         android:paddingBottom="5dp" | ||||
| @ -27,13 +27,13 @@ | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="0dp" | ||||
|         android:clipToPadding="false" | ||||
|         android:padding="3dp" | ||||
|         android:orientation="vertical" | ||||
|         android:padding="3dp" | ||||
|         app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" | ||||
|         app:layout_constraintBottom_toBottomOf="parent" | ||||
|         app:layout_constraintEnd_toEndOf="parent" | ||||
|         app:layout_constraintStart_toStartOf="parent" | ||||
|         app:layout_constraintTop_toBottomOf="@+id/search_text" | ||||
|         app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" | ||||
|         app:spanCount="2" | ||||
|         tools:listitem="@layout/item_media"> | ||||
|  | ||||
|  | ||||
| @ -44,6 +44,7 @@ | ||||
|             android:layout_marginStart="7dp" | ||||
|             android:layout_weight="1" | ||||
|             android:text="@string/component_episode_title" | ||||
|             android:textColor="?textPrimary" | ||||
|             android:textSize="16sp" /> | ||||
|  | ||||
|         <ImageView | ||||
| @ -52,7 +53,8 @@ | ||||
|             android:layout_height="30dp" | ||||
|             android:layout_margin="2dp" | ||||
|             android:contentDescription="@string/component_watched_desc" | ||||
|             app:srcCompat="@drawable/ic_baseline_check_circle_24" /> | ||||
|             app:srcCompat="@drawable/ic_baseline_check_circle_24" | ||||
|             app:tint="?iconNoAction" /> | ||||
|     </LinearLayout> | ||||
|  | ||||
|     <TextView | ||||
| @ -60,5 +62,6 @@ | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:ellipsize="end" | ||||
|         android:maxLines="2" /> | ||||
|         android:maxLines="2" | ||||
|         android:textColor="?textSecondary" /> | ||||
| </LinearLayout> | ||||
| @ -3,7 +3,7 @@ | ||||
|     xmlns:app="http://schemas.android.com/apk/res-auto" | ||||
|     android:layout_width="195dp" | ||||
|     android:layout_height="wrap_content" | ||||
|     android:backgroundTint="#FFFFFF" | ||||
|     android:backgroundTint="?themeSecondary" | ||||
|     android:visibility="visible" | ||||
|     app:cardCornerRadius="7dp" | ||||
|     app:cardElevation="4dp"> | ||||
|  | ||||
| @ -4,4 +4,7 @@ | ||||
|     <attr format="color" name="themeSecondary"/> | ||||
|     <attr format="color" name="textPrimary"/> | ||||
|     <attr format="color" name="textSecondary"/> | ||||
|     <attr format="color" name="iconAction"/> | ||||
|     <attr format="color" name="iconNoAction"/> | ||||
|     <attr format="color" name="buttonBackground"/> | ||||
| </resources> | ||||
| @ -1,21 +1,27 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <resources> | ||||
|     <!-- base theme colors --> | ||||
|     <color name="colorPrimary">#6200EE</color> | ||||
|     <color name="colorPrimaryDark">#3700B3</color> | ||||
|     <color name="colorPrimary">#66aa00</color> | ||||
|     <color name="colorPrimaryDark">#66aa00</color> | ||||
|     <color name="colorAccent">#03DAC5</color> | ||||
|  | ||||
|     <!-- light theme colors --> | ||||
|     <color name="themePrimaryLight">#f5f5f5</color> | ||||
|     <color name="themePrimaryLight">#f7f7f7</color> | ||||
|     <color name="themeSecondaryLight">#ffffff</color> | ||||
|     <color name="textPrimaryLight">#000000</color> | ||||
|     <color name="textSecondaryLight">#323232</color> | ||||
|     <color name="textPrimaryLight">#de000000</color> | ||||
|     <color name="textSecondaryLight">#99000000</color> | ||||
|     <color name="iconActionLight">#99000000</color> | ||||
|     <color name="iconNoActionLight">#66000000</color> | ||||
|     <color name="buttonBackgroundLight">#000000</color> | ||||
|  | ||||
|     <!-- dark theme colors --> | ||||
|     <color name="themePrimaryDark">#000000</color> | ||||
|     <color name="themeSecondaryDark">#303030</color> | ||||
|     <color name="textPrimaryDark">#ffffff</color> | ||||
|     <color name="textSecondaryDark">#c0c0c0</color> | ||||
|     <color name="textPrimaryDark">#deffffff</color> | ||||
|     <color name="textSecondaryDark">#99ffffff</color> | ||||
|     <color name="iconActionDark">#99ffffff</color> | ||||
|     <color name="iconNoActionDark">#66ffffff</color> | ||||
|     <color name="buttonBackgroundDark">#ffffff</color> | ||||
|  | ||||
|     <color name="ic_launcher_background">#FFFFFF</color> | ||||
| </resources> | ||||
| @ -11,9 +11,13 @@ | ||||
|         <item name="themeSecondary">@color/themeSecondaryLight</item> | ||||
|         <item name="textPrimary">@color/textPrimaryLight</item> | ||||
|         <item name="textSecondary">@color/textSecondaryLight</item> | ||||
|         <item name="android:textColor">@color/textSecondaryLight</item> | ||||
|         <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> | ||||
|     </style> | ||||
|  | ||||
|     <style name="AppThemeDark" parent="AppTheme"> | ||||
| @ -24,6 +28,10 @@ | ||||
|         <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> | ||||
|     </style> | ||||
|  | ||||
|     <!-- player theme --> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user