mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-26 13:42:15 +03:00
Changed how the NowPlaying view is displayed and hidden
This commit is contained in:
parent
b7bb0851db
commit
90090ba870
@ -170,6 +170,9 @@ public class SubsonicTabActivity extends ResultActivity implements OnClickListen
|
|||||||
restart();
|
restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This must be filled here because onCreate is called before the derived objects would call setContentView
|
||||||
|
getNowPlayingView();
|
||||||
|
|
||||||
if (!nowPlayingHidden)
|
if (!nowPlayingHidden)
|
||||||
{
|
{
|
||||||
showNowPlaying();
|
showNowPlaying();
|
||||||
@ -242,6 +245,19 @@ public class SubsonicTabActivity extends ResultActivity implements OnClickListen
|
|||||||
return destroyed;
|
return destroyed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void getNowPlayingView()
|
||||||
|
{
|
||||||
|
if (nowPlayingView == null)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
nowPlayingView = findViewById(R.id.now_playing);
|
||||||
|
}
|
||||||
|
catch (Exception exception) {
|
||||||
|
Timber.w(exception, "An exception has occurred while trying to get the nowPlayingView by findViewById");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void showNowPlaying()
|
public void showNowPlaying()
|
||||||
{
|
{
|
||||||
this.runOnUiThread(new Runnable()
|
this.runOnUiThread(new Runnable()
|
||||||
@ -260,8 +276,6 @@ public class SubsonicTabActivity extends ResultActivity implements OnClickListen
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
nowPlayingView = findViewById(R.id.now_playing);
|
|
||||||
|
|
||||||
if (nowPlayingView != null)
|
if (nowPlayingView != null)
|
||||||
{
|
{
|
||||||
PlayerState playerState = mediaPlayerControllerLazy.getValue().getPlayerState();
|
PlayerState playerState = mediaPlayerControllerLazy.getValue().getPlayerState();
|
||||||
@ -307,11 +321,6 @@ public class SubsonicTabActivity extends ResultActivity implements OnClickListen
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nowPlayingView == null)
|
|
||||||
{
|
|
||||||
nowPlayingView = findViewById(R.id.now_playing);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nowPlayingView != null)
|
if (nowPlayingView != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -407,11 +416,6 @@ public class SubsonicTabActivity extends ResultActivity implements OnClickListen
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (nowPlayingView == null)
|
|
||||||
{
|
|
||||||
nowPlayingView = findViewById(R.id.now_playing);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nowPlayingView != null)
|
if (nowPlayingView != null)
|
||||||
{
|
{
|
||||||
setVisibilityOnUiThread(nowPlayingView, View.GONE);
|
setVisibilityOnUiThread(nowPlayingView, View.GONE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user