diff --git a/Opus/Code/DataStructure/Song.cs b/Opus/Code/DataStructure/Song.cs index 85e3c07..7a23209 100644 --- a/Opus/Code/DataStructure/Song.cs +++ b/Opus/Code/DataStructure/Song.cs @@ -60,7 +60,7 @@ namespace Opus.DataStructure int pathID = cursor.GetColumnIndex(MediaStore.Audio.Media.InterfaceConsts.Data); int playOrderID = cursor.GetColumnIndex(MediaStore.Audio.Playlists.Members.PlayOrder); - string playOrder = PlaylistTracks.instance != null ? cursor.GetString(playOrderID) : ""; + string playOrder = PlaylistTracks.instance != null ? cursor.GetString(playOrderID) : null; string Artist = cursor.GetString(artistID); string Title = cursor.GetString(titleID); string Album = cursor.GetString(albumID); @@ -75,7 +75,7 @@ namespace Opus.DataStructure if (Album == null) Album = "Unknow Album"; - return new Song(Title, playOrder, Album, null, AlbumArt, id, path); + return new Song(Title, playOrder ?? Artist, Album, null, AlbumArt, id, path); } diff --git a/Opus/Code/MainActivity.cs b/Opus/Code/MainActivity.cs index 817db17..583f609 100644 --- a/Opus/Code/MainActivity.cs +++ b/Opus/Code/MainActivity.cs @@ -80,8 +80,7 @@ namespace Opus { base.OnCreate(savedInstanceState); - ISharedPreferences pref = PreferenceManager.GetDefaultSharedPreferences(this); - SwitchTheme(pref.GetInt("theme", 0)); + SwitchTheme(GetThemeID(this)); SetContentView(Resource.Layout.Main); instance = this; @@ -242,6 +241,28 @@ namespace Opus HandleIntent(intent); } + public static int GetThemeID(Context context) + { + ISharedPreferences pref = PreferenceManager.GetDefaultSharedPreferences(context); + return pref.GetInt("theme", 0); + } + + public static void SetTheme(Context context) + { + int themeID; + switch (GetThemeID(context)) + { + case 0: + default: + themeID = Resource.Style.Theme; + break; + case 1: + themeID = Resource.Style.DarkTheme; + break; + } + context.SetTheme(themeID); + } + public void SwitchTheme(int themeID) { Theme = themeID; diff --git a/Opus/Code/UI/Adapter/BrowseAdapter.cs b/Opus/Code/UI/Adapter/BrowseAdapter.cs index 5e02202..fea5b51 100644 --- a/Opus/Code/UI/Adapter/BrowseAdapter.cs +++ b/Opus/Code/UI/Adapter/BrowseAdapter.cs @@ -41,14 +41,6 @@ namespace Opus.Adapter { SongHolder holder = (SongHolder)viewHolder; - if (MainActivity.Theme == 1) - { - holder.more.SetColorFilter(Color.White); - holder.Title.SetTextColor(Color.White); - holder.Artist.SetTextColor(Color.White); - holder.Artist.Alpha = 0.7f; - } - holder.Title.Text = song.Title; holder.Artist.Text = song.Artist; diff --git a/Opus/Code/UI/Adapter/DownloadQueueAdapter.cs b/Opus/Code/UI/Adapter/DownloadQueueAdapter.cs index 7314b2e..0151351 100644 --- a/Opus/Code/UI/Adapter/DownloadQueueAdapter.cs +++ b/Opus/Code/UI/Adapter/DownloadQueueAdapter.cs @@ -27,10 +27,6 @@ namespace Opus.Adapter holder.Progress.Visibility = ViewStates.Visible; holder.Progress.Indeterminate = true; holder.Title.Alpha = 1f; - if (MainActivity.Theme == 1) - holder.Title.SetTextColor(Color.White); - else - holder.Title.SetTextColor(Color.Black); break; case DownloadState.MetaData: holder.Status.Text = Downloader.instance.GetString(Resource.String.metadata); @@ -38,10 +34,6 @@ namespace Opus.Adapter holder.Progress.Visibility = ViewStates.Visible; holder.Progress.Indeterminate = true; holder.Title.Alpha = 1f; - if (MainActivity.Theme == 1) - holder.Title.SetTextColor(Color.White); - else - holder.Title.SetTextColor(Color.Black); break; case DownloadState.Playlist: holder.Status.Text = Downloader.instance.GetString(Resource.String.downloader_playlist); @@ -49,10 +41,6 @@ namespace Opus.Adapter holder.Progress.Visibility = ViewStates.Visible; holder.Progress.Indeterminate = true; holder.Title.Alpha = 1f; - if (MainActivity.Theme == 1) - holder.Title.SetTextColor(Color.White); - else - holder.Title.SetTextColor(Color.Black); break; case DownloadState.Downloading: holder.Status.Text = Downloader.instance.GetString(Resource.String.downloading_status); @@ -61,19 +49,11 @@ namespace Opus.Adapter holder.Title.Alpha = 1f; holder.Progress.Indeterminate = false; holder.Progress.Progress = Downloader.queue[position].progress; - if (MainActivity.Theme == 1) - holder.Title.SetTextColor(Color.White); - else - holder.Title.SetTextColor(Color.Black); break; case DownloadState.None: holder.Progress.Visibility = ViewStates.Invisible; holder.Status.Visibility = ViewStates.Gone; holder.Title.Alpha = 1f; - if (MainActivity.Theme == 1) - holder.Title.SetTextColor(Color.White); - else - holder.Title.SetTextColor(Color.Black); break; case DownloadState.Completed: holder.Status.Text = Downloader.instance.GetString(Resource.String.completed); @@ -104,10 +84,6 @@ namespace Opus.Adapter DownloadQueue.instance.More(tagPosition); }; } - - if (MainActivity.Theme == 1) - holder.more.SetColorFilter(Color.White); - } public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) diff --git a/Opus/Code/UI/Adapter/FolderAdapter.cs b/Opus/Code/UI/Adapter/FolderAdapter.cs index 22271d2..86b6269 100644 --- a/Opus/Code/UI/Adapter/FolderAdapter.cs +++ b/Opus/Code/UI/Adapter/FolderAdapter.cs @@ -1,6 +1,4 @@ using Android.Content; -using Android.Content.Res; -using Android.Graphics; using Android.Views; using Android.Widget; using Opus.DataStructure; @@ -13,10 +11,10 @@ namespace Opus.Adapter { public int selectedPosition; - private Context context; - private List folders; + private readonly Context context; + private readonly List folders; private LayoutInflater inflater; - private int resource; + private readonly int resource; public FolderAdapter(Context context, int resource, List folders) : base(context, resource, folders) @@ -30,7 +28,7 @@ namespace Opus.Adapter { if (inflater == null) { - inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService); + inflater = Preferences.instance.LayoutInflater; } if (convertView == null) { @@ -58,17 +56,6 @@ namespace Opus.Adapter holder.used.Checked = position == selectedPosition; holder.used.SetTag(Resource.Id.folderName, position); - if(MainActivity.Theme == 1) - { - holder.Name.SetTextColor(Color.White); - holder.expandChild.SetColorFilter(Color.White); - holder.used.ButtonTintList = ColorStateList.ValueOf(Color.White); - } - else - { - convertView.SetBackgroundColor(Color.White); - } - return convertView; } } diff --git a/Opus/Code/UI/Adapter/HomeAdapter.cs b/Opus/Code/UI/Adapter/HomeAdapter.cs index 68d3501..aa9a34b 100644 --- a/Opus/Code/UI/Adapter/HomeAdapter.cs +++ b/Opus/Code/UI/Adapter/HomeAdapter.cs @@ -85,9 +85,6 @@ namespace Opus.Adapter MainActivity.instance.SupportFragmentManager.BeginTransaction().Replace(Resource.Id.contentView, PlaylistTracks.NewInstance(items[position].contentValue, items[position].SectionTitle)).AddToBackStack(null).Commit(); }; } - - if (MainActivity.Theme == 1) - holder.ItemView.SetBackgroundColor(Color.Argb(255, 62, 62, 62)); } else if(items[position].contentType == SectionType.ChannelList) { @@ -118,9 +115,6 @@ namespace Opus.Adapter holder.more.Text = "View More"; } }; - - if (MainActivity.Theme == 1) - holder.ItemView.SetBackgroundColor(Color.Argb(255, 62, 62, 62)); } else if (items[position].contentType == SectionType.PlaylistList) { @@ -129,10 +123,6 @@ namespace Opus.Adapter holder.recycler.SetLayoutManager(new LinearLayoutManager(MainActivity.instance, LinearLayoutManager.Vertical, false)); holder.recycler.SetAdapter(new HomeListAdapter(items[position].playlistContent.GetRange(0, items[position].playlistContent.Count > 4 ? 4 : items[position].playlistContent.Count), holder.recycler)); holder.more.Click += (sender, e) => { MainActivity.instance.FindViewById(Resource.Id.bottomView).SelectedItemId = Resource.Id.playlistLayout; }; - - - if (MainActivity.Theme == 1) - holder.ItemView.SetBackgroundColor(Color.Argb(255, 62, 62, 62)); } //else if(items[position].contentType == SectionType.TopicSelector) //{ @@ -148,16 +138,14 @@ namespace Opus.Adapter // MainActivity.instance.StartActivity(intent); // }; - // if (MainActivity.Theme == 1) - // holder.ItemView.SetBackgroundColor(Color.Argb(255, 62, 62, 62)); //} - else if (items[position].contentType == SectionType.Shuffle) - { - if (MainActivity.Theme == 1) - ((CardView)viewHolder.ItemView).SetCardBackgroundColor(Color.ParseColor("#212121")); - else - ((CardView)viewHolder.ItemView).SetCardBackgroundColor(Color.White); - } + //else if (items[position].contentType == SectionType.Shuffle) + //{ + // if (MainActivity.Theme == 1) + // ((CardView)viewHolder.ItemView).SetCardBackgroundColor(Color.ParseColor("#212121")); + // else + // ((CardView)viewHolder.ItemView).SetCardBackgroundColor(Color.White); + //} } void OnClick(int position) diff --git a/Opus/Code/UI/Adapter/HomeListAdapter.cs b/Opus/Code/UI/Adapter/HomeListAdapter.cs index 70ab30f..49734ab 100644 --- a/Opus/Code/UI/Adapter/HomeListAdapter.cs +++ b/Opus/Code/UI/Adapter/HomeListAdapter.cs @@ -60,17 +60,6 @@ namespace Opus.Adapter holder.RightButtons.FindViewById(Resource.Id.play).Click += (sender, e) => { PlaylistManager.PlayInOrder(playlists[position]); }; holder.RightButtons.FindViewById(Resource.Id.shuffle).Click += (sender, e) => { PlaylistManager.Shuffle(playlists[position]); }; } - - if(MainActivity.Theme == 1) - { - holder.RightButtons.FindViewById(Resource.Id.play).ImageTintList = ColorStateList.ValueOf(Color.White); - holder.RightButtons.FindViewById(Resource.Id.shuffle).ImageTintList = ColorStateList.ValueOf(Color.White); - } - else - { - holder.RightButtons.FindViewById(Resource.Id.play).ImageTintList = ColorStateList.ValueOf(Color.Black); - holder.RightButtons.FindViewById(Resource.Id.shuffle).ImageTintList = ColorStateList.ValueOf(Color.Black); - } } } diff --git a/Opus/Code/UI/Adapter/PlaylistAdapter.cs b/Opus/Code/UI/Adapter/PlaylistAdapter.cs index 365db36..02a364e 100644 --- a/Opus/Code/UI/Adapter/PlaylistAdapter.cs +++ b/Opus/Code/UI/Adapter/PlaylistAdapter.cs @@ -62,11 +62,6 @@ namespace Opus.Adapter else if (position == LocalPlaylists.Count + YoutubePlaylists.Count) { UslessHolder holder = (UslessHolder)viewHolder; - if (MainActivity.Theme == 1) - ((CardView)viewHolder.ItemView).SetCardBackgroundColor(Color.ParseColor("#212121")); - else - ((CardView)viewHolder.ItemView).SetCardBackgroundColor(Color.White); - holder.ItemView.FindViewById(Resource.Id.icon).SetImageResource(Resource.Drawable.PlaylistAdd); holder.ItemView.FindViewById(Resource.Id.text).Text = MainActivity.instance.GetString(Resource.String.add_playlist); @@ -127,21 +122,11 @@ namespace Opus.Adapter if (LocalPlaylists[position].SyncState == SyncState.Error) { holder.sync.Visibility = ViewStates.Visible; - if (MainActivity.Theme == 1) - holder.sync.SetColorFilter(Color.White); } else { holder.sync.Visibility = ViewStates.Gone; } - - if (MainActivity.Theme == 1) - { - holder.more.SetColorFilter(Color.White); - holder.Line1.SetTextColor(Color.White); - holder.Line2.SetTextColor(Color.White); - holder.Line2.Alpha = 0.7f; - } } else if (position > LocalPlaylists.Count && YoutubePlaylists.Count >= position - LocalPlaylists.Count) { @@ -168,11 +153,7 @@ namespace Opus.Adapter } if (playlist.HasWritePermission) - { holder.edit.Visibility = ViewStates.Visible; - if (MainActivity.Theme == 1) - holder.edit.SetColorFilter(Color.White); - } else holder.edit.Visibility = ViewStates.Gone; @@ -180,24 +161,18 @@ namespace Opus.Adapter { holder.sync.Visibility = ViewStates.Gone; holder.SyncLoading.Visibility = ViewStates.Visible; - if (MainActivity.Theme == 1) - holder.SyncLoading.IndeterminateTintList = ColorStateList.ValueOf(Color.White); } else if (playlist.SyncState == SyncState.True) { holder.sync.SetImageResource(Resource.Drawable.Sync); holder.sync.Visibility = ViewStates.Visible; holder.SyncLoading.Visibility = ViewStates.Gone; - if (MainActivity.Theme == 1) - holder.sync.SetColorFilter(Color.White); } else if (playlist.SyncState == SyncState.Error) { holder.sync.SetImageResource(Resource.Drawable.SyncError); holder.sync.Visibility = ViewStates.Visible; holder.SyncLoading.Visibility = ViewStates.Gone; - if (MainActivity.Theme == 1) - holder.sync.SetColorFilter(Color.White); } else if (playlist.SyncState == SyncState.False) { @@ -212,14 +187,6 @@ namespace Opus.Adapter Playlist.instance.More(holder.AdapterPosition); }; } - - if (MainActivity.Theme == 1) - { - holder.more.SetColorFilter(Color.White); - holder.Title.SetTextColor(Color.White); - holder.Owner.SetTextColor(Color.White); - holder.Owner.Alpha = 0.7f; - } } } diff --git a/Opus/Code/UI/Adapter/PlaylistTrackAdapter.cs b/Opus/Code/UI/Adapter/PlaylistTrackAdapter.cs index 606bf87..746b6e0 100644 --- a/Opus/Code/UI/Adapter/PlaylistTrackAdapter.cs +++ b/Opus/Code/UI/Adapter/PlaylistTrackAdapter.cs @@ -78,14 +78,6 @@ namespace Opus.Adapter menu.Show(); }; } - - if (MainActivity.Theme != 1) - { - header.SetBackgroundColor(Color.Argb(255, 255, 255, 255)); - header.FindViewById(Resource.Id.headerPlay).ImageTintList = ColorStateList.ValueOf(Color.Black); - header.FindViewById(Resource.Id.headerShuffle).ImageTintList = ColorStateList.ValueOf(Color.Black); - header.FindViewById(Resource.Id.headerMore).ImageTintList = ColorStateList.ValueOf(Color.Black); - } } else if (BaseCount == 0) { @@ -149,17 +141,6 @@ namespace Opus.Adapter MainActivity.instance.contentRefresh.Enabled = false; }; } - - float scale = MainActivity.instance.Resources.DisplayMetrics.Density; - - if (MainActivity.Theme == 1) - { - holder.more.SetColorFilter(Color.White); - holder.reorder.SetColorFilter(Color.White); - holder.Title.SetTextColor(Color.White); - holder.Artist.SetTextColor(Color.White); - holder.Artist.Alpha = 0.7f; - } } public override Song GetItem(int position) diff --git a/Opus/Code/UI/Adapter/SuggestionAdapter.cs b/Opus/Code/UI/Adapter/SuggestionAdapter.cs index fa59dab..9c64752 100644 --- a/Opus/Code/UI/Adapter/SuggestionAdapter.cs +++ b/Opus/Code/UI/Adapter/SuggestionAdapter.cs @@ -44,12 +44,6 @@ namespace Opus.Adapter if (!convertView.FindViewById(Resource.Id.refine).HasOnClickListeners) convertView.FindViewById(Resource.Id.refine).Click += (sender, e) => { SearchableActivity.instance.Refine(position); }; - if (MainActivity.Theme == 1) - { - convertView.FindViewById(Resource.Id.icon1).SetColorFilter(Color.White); - convertView.FindViewById(Resource.Id.refine).SetColorFilter(Color.White); - } - return convertView; } } diff --git a/Opus/Code/UI/Adapter/TwoLineAdapter.cs b/Opus/Code/UI/Adapter/TwoLineAdapter.cs index c99597b..e18d080 100644 --- a/Opus/Code/UI/Adapter/TwoLineAdapter.cs +++ b/Opus/Code/UI/Adapter/TwoLineAdapter.cs @@ -41,14 +41,6 @@ namespace Opus.Adapter FolderBrowse.instance.More(pos); }; } - - if (MainActivity.Theme == 1) - { - holder.more.SetColorFilter(Color.White); - holder.Line1.SetTextColor(Color.White); - holder.Line2.SetTextColor(Color.White); - holder.Line2.Alpha = 0.7f; - } } public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) diff --git a/Opus/Code/UI/Adapter/YtAdapter.cs b/Opus/Code/UI/Adapter/YtAdapter.cs index 874a677..e66355e 100644 --- a/Opus/Code/UI/Adapter/YtAdapter.cs +++ b/Opus/Code/UI/Adapter/YtAdapter.cs @@ -55,15 +55,6 @@ namespace Opus.Adapter else holder.Live.Visibility = ViewStates.Gone; - if (MainActivity.Theme == 1) - { - holder.more.SetColorFilter(Color.White); - holder.reorder.SetColorFilter(Color.White); - holder.Title.SetTextColor(Color.White); - holder.Artist.SetTextColor(Color.White); - holder.Artist.Alpha = 0.7f; - } - float scale = MainActivity.instance.Resources.DisplayMetrics.Density; if (position + 1 == items.Count) { @@ -100,14 +91,6 @@ namespace Opus.Adapter YoutubeSearch.instances[0].PlaylistMore(items[tagPosition].playlist); }; } - - if (MainActivity.Theme == 1) - { - holder.more.SetColorFilter(Color.White); - holder.Title.SetTextColor(Color.White); - holder.Owner.SetTextColor(Color.White); - holder.Owner.Alpha = 0.7f; - } } else if(items[position].Kind == YtKind.Channel) { @@ -124,11 +107,6 @@ namespace Opus.Adapter YoutubeManager.MixFromChannel(channel.YoutubeID); }; } - - if (MainActivity.Theme == 1) - { - holder.Title.SetTextColor(Color.White); - } } else if(items[position].Kind == YtKind.ChannelPreview) { diff --git a/Opus/Code/UI/Fragments/DownloadFragment.cs b/Opus/Code/UI/Fragments/DownloadFragment.cs index 399841b..af6c91e 100644 --- a/Opus/Code/UI/Fragments/DownloadFragment.cs +++ b/Opus/Code/UI/Fragments/DownloadFragment.cs @@ -206,8 +206,8 @@ namespace Opus.Fragments public override void OnViewCreated(View view, Bundle savedInstanceState) { - if (MainActivity.Theme == 1) - view.SetBackgroundColor(Color.Argb(225, 33, 33, 33)); + //if (MainActivity.Theme == 1) + // view.SetBackgroundColor(Color.Argb(225, 33, 33, 33)); base.OnViewCreated(view, savedInstanceState); } } diff --git a/Opus/Code/UI/Fragments/DownloadQueue.cs b/Opus/Code/UI/Fragments/DownloadQueue.cs index 10666d5..c940aaa 100644 --- a/Opus/Code/UI/Fragments/DownloadQueue.cs +++ b/Opus/Code/UI/Fragments/DownloadQueue.cs @@ -22,9 +22,7 @@ namespace Opus.Fragments { base.OnCreate(savedInstanceState); - if (MainActivity.Theme == 1) - SetTheme(Resource.Style.DarkTheme); - + MainActivity.SetTheme(this); instance = this; SetContentView(Resource.Layout.DownloadQueue); diff --git a/Opus/Code/UI/Fragments/EditMetaData.cs b/Opus/Code/UI/Fragments/EditMetaData.cs index 33ce150..b993a99 100644 --- a/Opus/Code/UI/Fragments/EditMetaData.cs +++ b/Opus/Code/UI/Fragments/EditMetaData.cs @@ -45,9 +45,7 @@ namespace Opus.Fragments { base.OnCreate(savedInstanceState); - if(MainActivity.Theme == 1) - SetTheme(Resource.Style.DarkTheme); - + MainActivity.SetTheme(this); SetContentView(Resource.Layout.EditMetaData); Window.SetStatusBarColor(Color.Argb(70, 00, 00, 00)); @@ -62,12 +60,6 @@ namespace Opus.Fragments toolbar.Parent.RequestLayout(); toolbar.LayoutParameters.Height = metrics.WidthPixels / 3; toolbar.RequestLayout(); - - if (MainActivity.Theme == 1) - { - toolbar.PopupTheme = Resource.Style.DarkPopup; - } - SetSupportActionBar(toolbar); SupportActionBar.SetDisplayShowTitleEnabled(false); SupportActionBar.SetDisplayHomeAsUpEnabled(true); diff --git a/Opus/Code/UI/Fragments/Playlist.cs b/Opus/Code/UI/Fragments/Playlist.cs index 4ce6573..b807233 100644 --- a/Opus/Code/UI/Fragments/Playlist.cs +++ b/Opus/Code/UI/Fragments/Playlist.cs @@ -192,8 +192,6 @@ namespace Opus.Fragments PlaylistHolder holder = (PlaylistHolder)ListView.GetChildViewHolder(ListView.GetChildAt(LocalPlaylists.Count + YoutubeIndex)); holder.sync.Visibility = ViewStates.Gone; holder.SyncLoading.Visibility = ViewStates.Visible; - if (MainActivity.Theme == 1) - holder.SyncLoading.IndeterminateTintList = ColorStateList.ValueOf(Color.White); } } @@ -208,8 +206,6 @@ namespace Opus.Fragments holder.sync.SetImageResource(Resource.Drawable.SyncError); holder.sync.Visibility = ViewStates.Visible; holder.SyncLoading.Visibility = ViewStates.Gone; - if (MainActivity.Theme == 1) - holder.sync.SetColorFilter(Color.White); } } } @@ -231,17 +227,11 @@ namespace Opus.Fragments Picasso.With(Application.Context).Load(item.ImageURL).Placeholder(Resource.Color.background_material_dark).Resize(400, 400).CenterCrop().Into(holder.AlbumArt); if (item.HasWritePermission) - { holder.edit.Visibility = ViewStates.Visible; - if (MainActivity.Theme == 1) - holder.edit.SetColorFilter(Color.White); - } holder.sync.SetImageResource(Resource.Drawable.Sync); holder.sync.Visibility = ViewStates.Visible; holder.SyncLoading.Visibility = ViewStates.Gone; - if (MainActivity.Theme == 1) - holder.sync.SetColorFilter(Color.White); } } @@ -514,8 +504,6 @@ namespace Opus.Fragments holder.SyncLoading.Visibility = ViewStates.Gone; holder.sync.SetImageResource(Resource.Drawable.Sync); holder.sync.Visibility = ViewStates.Visible; - if (MainActivity.Theme == 1) - holder.sync.SetColorFilter(Color.White); } } } diff --git a/Opus/Code/UI/Fragments/Preferences.cs b/Opus/Code/UI/Fragments/Preferences.cs index 1770483..48284e0 100644 --- a/Opus/Code/UI/Fragments/Preferences.cs +++ b/Opus/Code/UI/Fragments/Preferences.cs @@ -34,9 +34,7 @@ namespace Opus.Fragments protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); - if (MainActivity.Theme == 1) - SetTheme(Resource.Style.DarkPreferences); - + MainActivity.SetTheme(this); SetContentView(Resource.Layout.PreferenceRoot); toolbar = FindViewById(Resource.Id.toolbar); SetSupportActionBar(toolbar); @@ -232,8 +230,6 @@ namespace Opus.Fragments public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = base.OnCreateView(inflater, container, savedInstanceState); - if (MainActivity.Theme == 1) - view.SetBackgroundColor(Color.Argb(225, 33, 33, 33)); return view; } diff --git a/Opus/Code/UI/Fragments/SearchableActivity.cs b/Opus/Code/UI/Fragments/SearchableActivity.cs index 5357677..664fb1b 100644 --- a/Opus/Code/UI/Fragments/SearchableActivity.cs +++ b/Opus/Code/UI/Fragments/SearchableActivity.cs @@ -34,9 +34,8 @@ namespace Opus.Fragments { instance = this; base.OnCreate(savedInstanceState); - if (MainActivity.Theme == 1) - SetTheme(Resource.Style.DarkTheme); + MainActivity.SetTheme(this); SetContentView(Resource.Layout.SearchLayout); SetSupportActionBar(FindViewById(Resource.Id.toolbar)); @@ -99,7 +98,7 @@ namespace Opus.Fragments IMenuItem searchItem = menu.FindItem(Resource.Id.search); searchItem.ExpandActionView(); searchView = searchItem.ActionView.JavaCast(); - //searchView.MaxWidth = int.MaxValue; + searchView.MaxWidth = int.MaxValue; searchView.QueryHint = GetString(Resource.String.youtube_search); searchView.QueryTextChange += (s, e) => { diff --git a/Opus/Code/UI/Views/AccountPreference.cs b/Opus/Code/UI/Views/AccountPreference.cs index 7853665..5dd91cf 100644 --- a/Opus/Code/UI/Views/AccountPreference.cs +++ b/Opus/Code/UI/Views/AccountPreference.cs @@ -1,6 +1,6 @@ using Android.Content; -using Android.Gms.Auth.Api; -using Android.Gms.Auth.Api.SignIn; +//using Android.Gms.Auth.Api; +//using Android.Gms.Auth.Api.SignIn; using Android.Gms.Common.Apis; using Android.Graphics; using Android.Runtime; @@ -9,14 +9,14 @@ using Android.Support.V7.Preferences; using Android.Util; using Android.Views; using Android.Widget; -using Google.Apis.YouTube.v3; +//using Google.Apis.YouTube.v3; using Opus; -using Opus.Api; +//using Opus.Api; using Opus.Fragments; using Opus.Others; using Square.Picasso; using System; -using System.Threading.Tasks; +//using System.Threading.Tasks; public class AccountPreference : Preference, IResultCallback { diff --git a/Opus/Resources/Resource.Designer.cs b/Opus/Resources/Resource.Designer.cs index 5816bd7..94a6f05 100644 --- a/Opus/Resources/Resource.Designer.cs +++ b/Opus/Resources/Resource.Designer.cs @@ -333,6 +333,9 @@ namespace Opus // aapt resource value: 0x7f010090 public const int background = 2130772112; + // aapt resource value: 0x7f01027f + public const int backgroundAccent = 2130772607; + // aapt resource value: 0x7f010092 public const int backgroundSplit = 2130772114; diff --git a/Opus/Resources/layout/ChannelList.xml b/Opus/Resources/layout/ChannelList.xml index 00b9e71..56bc4f2 100644 --- a/Opus/Resources/layout/ChannelList.xml +++ b/Opus/Resources/layout/ChannelList.xml @@ -29,6 +29,5 @@ android:layout_toLeftOf="@id/action" android:paddingLeft="70dp" android:textSize="14dip" - android:textColor="#000" android:textStyle="bold" /> \ No newline at end of file diff --git a/Opus/Resources/layout/DownloadItem.xml b/Opus/Resources/layout/DownloadItem.xml index 55c11af..9c59799 100644 --- a/Opus/Resources/layout/DownloadItem.xml +++ b/Opus/Resources/layout/DownloadItem.xml @@ -10,6 +10,7 @@ android:layout_height="wrap_content" android:src="@drawable/More" android:background="@null" + android:tint="?iconColor" android:layout_alignParentRight="true" android:paddingBottom="10dp" android:id="@+id/more" /> diff --git a/Opus/Resources/layout/EditMetaData.xml b/Opus/Resources/layout/EditMetaData.xml index 18bc71d..49af361 100644 --- a/Opus/Resources/layout/EditMetaData.xml +++ b/Opus/Resources/layout/EditMetaData.xml @@ -15,7 +15,6 @@ android:layout_height="match_parent" android:id="@+id/collapsingToolbar" app:layout_scrollFlags="scroll|exitUntilCollapsed" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:fitsSystemWindows="true"> diff --git a/Opus/Resources/layout/HomeChannels.xml b/Opus/Resources/layout/HomeChannels.xml index 33a00a4..911aaee 100644 --- a/Opus/Resources/layout/HomeChannels.xml +++ b/Opus/Resources/layout/HomeChannels.xml @@ -5,7 +5,7 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:elevation="6dp" - android:background="#fafafa" + android:background="?backgroundAccent" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android:orientation="vertical"> diff --git a/Opus/Resources/layout/HomePlaylist.xml b/Opus/Resources/layout/HomePlaylist.xml index 9ad7b06..43e8741 100644 --- a/Opus/Resources/layout/HomePlaylist.xml +++ b/Opus/Resources/layout/HomePlaylist.xml @@ -26,6 +26,7 @@ android:layout_height="30dp" android:layout_margin="6dp" android:src="@drawable/play" + android:tint="?iconColor" android:background="@null" android:id="@+id/play" /> diff --git a/Opus/Resources/layout/HomePlaylists.xml b/Opus/Resources/layout/HomePlaylists.xml index 3d5a6c5..81611b3 100644 --- a/Opus/Resources/layout/HomePlaylists.xml +++ b/Opus/Resources/layout/HomePlaylists.xml @@ -5,7 +5,7 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:elevation="6dp" - android:background="#fafafa" + android:background="?backgroundAccent" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android:orientation="vertical"> diff --git a/Opus/Resources/layout/LineSongs.xml b/Opus/Resources/layout/LineSongs.xml index dcbbeac..3ef2e76 100644 --- a/Opus/Resources/layout/LineSongs.xml +++ b/Opus/Resources/layout/LineSongs.xml @@ -5,7 +5,7 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:elevation="6dp" - android:background="#fafafa" + android:background="?backgroundAccent" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android:orientation="vertical"> diff --git a/Opus/Resources/layout/PlaylistItem.xml b/Opus/Resources/layout/PlaylistItem.xml index 5bbf11a..97dc1d6 100644 --- a/Opus/Resources/layout/PlaylistItem.xml +++ b/Opus/Resources/layout/PlaylistItem.xml @@ -28,7 +28,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="14dip" - android:textColor="#000" android:ellipsize="end" android:maxLines="1" android:textStyle="bold" /> @@ -37,8 +36,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="12dip" - android:maxLines="1" - android:textColor="#000" /> + android:alpha="0.7" + android:maxLines="1" /> diff --git a/Opus/Resources/layout/PlaylistSmallHeader.xml b/Opus/Resources/layout/PlaylistSmallHeader.xml index ed5f194..5168a3f 100644 --- a/Opus/Resources/layout/PlaylistSmallHeader.xml +++ b/Opus/Resources/layout/PlaylistSmallHeader.xml @@ -3,7 +3,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" - android:background="#424242" + android:background="?backgroundAccent" android:id="@+id/playlistHeader" android:elevation="6dp" > @@ -33,7 +33,7 @@ android:id="@+id/headerShuffle" android:layout_width="60dp" android:layout_height="60dp" - android:tint="#ffffff" + android:tint="?iconColor" android:clickable="true" android:src="@drawable/Shuffle" android:background="@null"/> @@ -41,7 +41,7 @@ android:id="@+id/headerMore" android:layout_width="60dp" android:layout_height="60dp" - android:tint="#ffffff" + android:tint="?iconColor" android:clickable="true" android:src="@drawable/More" android:background="@null" /> diff --git a/Opus/Resources/layout/PreferenceRoot.xml b/Opus/Resources/layout/PreferenceRoot.xml index 6bfe4e5..cc9e8ef 100644 --- a/Opus/Resources/layout/PreferenceRoot.xml +++ b/Opus/Resources/layout/PreferenceRoot.xml @@ -22,6 +22,6 @@ \ No newline at end of file diff --git a/Opus/Resources/layout/SongList.xml b/Opus/Resources/layout/SongList.xml index 81e6094..7689ea0 100644 --- a/Opus/Resources/layout/SongList.xml +++ b/Opus/Resources/layout/SongList.xml @@ -27,7 +27,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="14dip" - android:textColor="#000" android:ellipsize="end" android:maxLines="1" android:textStyle="bold" /> @@ -36,8 +35,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="12dip" - android:maxLines="1" - android:textColor="#000" /> + android:alpha="0.7" + android:maxLines="1" /> @@ -85,6 +85,7 @@ android:padding="5dp" android:clickable="true" android:visibility="gone" + android:tint="?iconColor" android:layout_gravity="center_vertical" android:src="@drawable/Reorder" /> diff --git a/Opus/Resources/layout/SuggestionLayout.xml b/Opus/Resources/layout/SuggestionLayout.xml index 61657fc..5b33314 100644 --- a/Opus/Resources/layout/SuggestionLayout.xml +++ b/Opus/Resources/layout/SuggestionLayout.xml @@ -10,6 +10,7 @@ android:layout_marginLeft="18dp" android:layout_marginTop="12dp" android:layout_marginBottom="12dp" + android:tint="?iconColor" android:layout_alignParentStart="true" android:layout_centerVertical="true" /> + android:alpha="0.7"/> diff --git a/Opus/Resources/layout/folderList.xml b/Opus/Resources/layout/folderList.xml index 1910750..e5d5905 100644 --- a/Opus/Resources/layout/folderList.xml +++ b/Opus/Resources/layout/folderList.xml @@ -2,6 +2,7 @@ + \ No newline at end of file diff --git a/Opus/Resources/values/styles.xml b/Opus/Resources/values/styles.xml index f965d82..57f80e9 100644 --- a/Opus/Resources/values/styles.xml +++ b/Opus/Resources/values/styles.xml @@ -15,6 +15,7 @@ #000 #000 #ffffff + #fafafa