Solving bugs with connection status lost.

This commit is contained in:
Anonymus Raccoon
2019-06-05 21:10:21 +02:00
parent c8ea78284d
commit 7179680d84
2 changed files with 19 additions and 13 deletions

View File

@@ -124,9 +124,11 @@ namespace Opus.Fragments
adapter.NotifyItemRangeInserted(loadPos, result.Count - loadPos);
searching = false;
}
catch (System.Net.Http.HttpRequestException)
catch (Exception ex)
{
MainActivity.instance.Timout();
Console.WriteLine("&Exception catched in the youtube load more (search tab): " + ex.Source + " - " + ex.Message);
if (ex is System.Net.Http.HttpRequestException)
MainActivity.instance.Timout();
}
}
}
@@ -298,11 +300,15 @@ namespace Opus.Fragments
else
EmptyView.Visibility = ViewStates.Gone;
}
catch (System.Net.Http.HttpRequestException)
catch(Exception ex)
{
MainActivity.instance.Timout();
EmptyView.Text = GetString(Resource.String.timout);
EmptyView.Visibility = ViewStates.Visible;
Console.WriteLine("&Exception catched in the youtube search: " + ex.Source + " - " + ex.Message);
if(ex is System.Net.Http.HttpRequestException)
{
MainActivity.instance.Timout();
EmptyView.Text = GetString(Resource.String.timout);
EmptyView.Visibility = ViewStates.Visible;
}
}
}

View File

@@ -575,12 +575,12 @@ namespace Opus
public class PlayerCallback : BottomSheetBehavior.BottomSheetCallback
{
private Activity context;
private NestedScrollView sheet;
private BottomNavigationView bottomView;
private FrameLayout smallPlayer;
private View playerContainer;
private CoordinatorLayout snackBar;
private readonly Activity context;
private readonly NestedScrollView sheet;
private readonly BottomNavigationView bottomView;
private readonly FrameLayout smallPlayer;
private readonly View playerContainer;
private readonly CoordinatorLayout snackBar;
private bool Refreshed = false;
private SheetMovement movement = SheetMovement.Unknow;
@@ -668,7 +668,7 @@ namespace Opus
public class QueueListener : Java.Lang.Object, DrawerLayout.IDrawerListener
{
private ImageView QueueBackground;
private readonly ImageView QueueBackground;
public QueueListener(ImageView queueBackground)
{