mirror of
https://github.com/zoriya/Opus.git
synced 2026-05-31 13:23:01 +00:00
Solving theme and small bugs.
This commit is contained in:
@@ -1270,12 +1270,18 @@ namespace MusicApp
|
||||
{
|
||||
if (displayToast)
|
||||
{
|
||||
if (instance != null)
|
||||
if (instance != null && !instance.StateSaved)
|
||||
{
|
||||
Snackbar snackBar = Snackbar.Make(instance.FindViewById(Resource.Id.snackBar), "You are not connected to internet, can't check for updates.", Snackbar.LengthLong);
|
||||
snackBar.View.FindViewById<TextView>(Resource.Id.snackbar_text).SetTextColor(Color.White);
|
||||
snackBar.Show();
|
||||
}
|
||||
else if(Preferences.instance != null)
|
||||
{
|
||||
Snackbar snackBar = Snackbar.Make(Preferences.instance.FindViewById(Android.Resource.Id.Content), "You are not connected to internet, can't check for updates.", Snackbar.LengthLong);
|
||||
snackBar.View.FindViewById<TextView>(Resource.Id.snackbar_text).SetTextColor(Color.White);
|
||||
snackBar.Show();
|
||||
}
|
||||
else
|
||||
Toast.MakeText(Application.Context, "You are not connected to internet, can't check for updates.", ToastLength.Short).Show();
|
||||
}
|
||||
@@ -1320,10 +1326,16 @@ namespace MusicApp
|
||||
}
|
||||
else if(displayToast)
|
||||
{
|
||||
if (instance != null)
|
||||
if (instance != null && !instance.StateSaved)
|
||||
{
|
||||
Snackbar snackBar = Snackbar.Make(instance.FindViewById(Resource.Id.snackBar), "Your app is up to date.", Snackbar.LengthLong);
|
||||
snackBar.View.FindViewById<TextView>(Resource.Id.snackbar_text).SetTextColor(Android.Graphics.Color.White);
|
||||
snackBar.View.FindViewById<TextView>(Resource.Id.snackbar_text).SetTextColor(Color.White);
|
||||
snackBar.Show();
|
||||
}
|
||||
else if(Preferences.instance != null)
|
||||
{
|
||||
Snackbar snackBar = Snackbar.Make(Preferences.instance.FindViewById(Android.Resource.Id.Content), "Your app is up to date.", Snackbar.LengthLong);
|
||||
snackBar.View.FindViewById<TextView>(Resource.Id.snackbar_text).SetTextColor(Color.White);
|
||||
snackBar.Show();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -41,7 +41,7 @@ public class AccountPreference : Preference, IResultCallback
|
||||
|
||||
if (MainActivity.account == null)
|
||||
{
|
||||
log.SetTextColor(Android.Graphics.Color.DarkBlue);
|
||||
log.SetTextColor(Color.DarkBlue);
|
||||
log.Text = "Log In";
|
||||
log.Click += logIn;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class AccountPreference : Preference, IResultCallback
|
||||
{
|
||||
log.Text = "Log Out";
|
||||
Picasso.With(Android.App.Application.Context).Load(MainActivity.account.PhotoUrl).Transform(new CircleTransformation()).Into(view.FindViewById<ImageView>(Android.Resource.Id.Icon));
|
||||
log.SetTextColor(Android.Graphics.Color.Red);
|
||||
log.SetTextColor(Color.Red);
|
||||
log.Click += logOut;
|
||||
}
|
||||
}
|
||||
@@ -73,6 +73,7 @@ public class AccountPreference : Preference, IResultCallback
|
||||
Picasso.With(Android.App.Application.Context).Load(Resource.Drawable.account).Into(view.FindViewById<ImageView>(Android.Resource.Id.Icon));
|
||||
view.FindViewById<ImageView>(Android.Resource.Id.Icon).SetColorFilter(Color.White);
|
||||
log.Click -= logOut;
|
||||
MainActivity.instance.InvalidateOptionsMenu();
|
||||
}
|
||||
|
||||
void LogIn()
|
||||
|
||||
@@ -14,6 +14,7 @@ using MusicApp.Resources.values;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
@@ -336,7 +337,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
r = new Random();
|
||||
if (r.Next(0, 100) > 90)
|
||||
AddHomeTopics();
|
||||
await AddHomeTopics();
|
||||
|
||||
for (int i = 0; i < adapter.items.Count; i++)
|
||||
{
|
||||
@@ -359,13 +360,13 @@ namespace MusicApp.Resources.Portable_Class
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHomeTopics();
|
||||
await AddHomeTopics();
|
||||
}
|
||||
populating = false;
|
||||
}
|
||||
}
|
||||
|
||||
public async void AddHomeTopics()
|
||||
public async Task AddHomeTopics()
|
||||
{
|
||||
List<Song> channelLits = new List<Song>();
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
View view = inflater.Inflate(Resource.Layout.RecyclerFragment, container, false);
|
||||
ListView = view.FindViewById<RecyclerView>(Resource.Id.recycler);
|
||||
ListView.SetLayoutManager(new LinearLayoutManager(Android.App.Application.Context));
|
||||
System.Console.WriteLine("&Creating view");
|
||||
instance = this;
|
||||
|
||||
#pragma warning disable CS4014
|
||||
|
||||
@@ -30,7 +30,10 @@ namespace MusicApp.Resources.Portable_Class
|
||||
base.OnCreate(savedInstanceState);
|
||||
|
||||
if(MainActivity.Theme == 1)
|
||||
{
|
||||
SetTheme(Resource.Style.DarkPreferences);
|
||||
Window.SetNavigationBarColor(Android.Graphics.Color.Argb(255, 33, 33, 33));
|
||||
}
|
||||
|
||||
instance = this;
|
||||
Window.SetStatusBarColor(Android.Graphics.Color.Argb(255, 33, 33, 33));
|
||||
@@ -231,6 +234,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
accountPreference.Title = "Logged in as:";
|
||||
accountPreference.Summary = MainActivity.account.DisplayName;
|
||||
accountPreference.OnSignedIn();
|
||||
MainActivity.instance.InvalidateOptionsMenu();
|
||||
}
|
||||
|
||||
#region Topic Preference
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
<item name="android:textColor">#FFFFFF</item>
|
||||
<item name="android:textColorSecondary">#B3FFFFFF</item>
|
||||
<item name="android:statusBarColor">#212121</item>
|
||||
<item name="android:navigationBarColor">#212121</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowContentTransitions">true</item>
|
||||
|
||||
Reference in New Issue
Block a user