Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reworked context menu for audio queue, removed buttons for video queue #1527

Merged
merged 1 commit into from
Mar 20, 2022

Conversation

mueslimak3r
Copy link
Member

@mueslimak3r mueslimak3r commented Mar 16, 2022

Changes

  • clicking on an item in the audio queue on the home screen now either:
    (for other actions, long click on the item to open the context menu)
  • opens the NowPlayingActivity if it's the first item in the row
  • otherwise, plays the item without opening NowPlayingActivity
  • changed the buttons in the context menu for audio items:
  • only show 'play from here' if:
  • if not in NowPlayingActivity since a single click on an item will play it
  • the item isn't the currently playing one (the previous code didn't properly do this)
  • added a 'toggle shuffle' button
  • moved the 'favorite' button closer to the top
  • added a 'clear queue' button since we can now do this without crashing the app
  • changed the values in KeyProcessor for MENU_MARK_FAVORITE, MENU_PLAY, etc. If there's a reason why they were numbered how they were I couldn't figure it out.
  • in FullDetailsActivity, removed both the button and menu item for "add to queue" for video items since the video queue doesn't work properly

Notes

  • I'll work on the context menu for video items next

also removed video queue buttons
@mueslimak3r mueslimak3r added needs-testing next-release Pull request related to a future release which is not being worked on yet labels Mar 16, 2022
@nielsvanvelzen nielsvanvelzen removed the next-release Pull request related to a future release which is not being worked on yet label Mar 17, 2022
@mueslimak3r mueslimak3r marked this pull request as ready for review March 19, 2022 21:07
@nielsvanvelzen
Copy link
Member

changed the values in KeyProcessor for MENU_MARK_FAVORITE, MENU_PLAY, etc. If there's a reason why they were numbered how they were I couldn't figure it out.

We just need unique id's for the menu items, they probably weren't incremental anymore because other values had been removed.

@nielsvanvelzen nielsvanvelzen merged commit 19984e1 into jellyfin:master Mar 20, 2022
@mueslimak3r mueslimak3r deleted the context-menu-changes branch March 20, 2022 10:13
Comment on lines +141 to +150
Timber.d("got pos %s", pos);
// if a song isn't the first in the queue, play it
if (rowItem.getIndex() > KoinJavaComponent.<MediaManager>get(MediaManager.class).getCurrentAudioQueuePosition() && rowItem.getIndex() < KoinJavaComponent.<MediaManager>get(MediaManager.class).getCurrentAudioQueueSize()) {
KoinJavaComponent.<MediaManager>get(MediaManager.class).playFrom(rowItem.getIndex());
} else {
// otherwise, open AudioNowPlayingActivity
Intent nowPlaying = new Intent(activity, AudioNowPlayingActivity.class);
activity.startActivity(nowPlaying);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get this crash when I press an album/track card. For example: an item in the "latest music" section in the home screen or an item in "last played" in the smart screen for music libraries.

D/ItemLauncher: got pos 0
I/AppThemeCallbacks: Applying theme: DARK
D/CompatibilityChangeReporter: Compat change id reported: 171228096; UID 10077; state: ENABLED
I/BackgroundService: Adding BackgroundServiceFragment to activity
D/AndroidRuntime: Shutting down VM
    
    
    --------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.jellyfin.androidtv.debug, PID: 5861
    java.lang.RuntimeException: Unable to start activity ComponentInfo{org.jellyfin.androidtv.debug/org.jellyfin.androidtv.ui.playback.AudioNowPlayingActivity}: java.lang.IllegalArgumentException: ObjectAdapter cannot be null
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3635)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7839)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
     Caused by: java.lang.IllegalArgumentException: ObjectAdapter cannot be null
        at androidx.leanback.widget.ListRow.verify(ListRow.java:51)
        at androidx.leanback.widget.ListRow.<init>(ListRow.java:34)
        at org.jellyfin.androidtv.ui.playback.AudioNowPlayingActivity.addQueue(AudioNowPlayingActivity.java:281)
        at org.jellyfin.androidtv.ui.playback.AudioNowPlayingActivity.onCreate(AudioNowPlayingActivity.java:275)
        at android.app.Activity.performCreate(Activity.java:8051)
        at android.app.Activity.performCreate(Activity.java:8031)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3608)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loopOnce(Looper.java:201) 
        at android.os.Looper.loop(Looper.java:288) 
        at android.app.ActivityThread.main(ActivityThread.java:7839) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) 
E/ACRA: ACRA caught a RuntimeException for org.jellyfin.androidtv.debug
    java.lang.RuntimeException: Unable to start activity ComponentInfo{org.jellyfin.androidtv.debug/org.jellyfin.androidtv.ui.playback.AudioNowPlayingActivity}: java.lang.IllegalArgumentException: ObjectAdapter cannot be null
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3635)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7839)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
     Caused by: java.lang.IllegalArgumentException: ObjectAdapter cannot be null
        at androidx.leanback.widget.ListRow.verify(ListRow.java:51)
        at androidx.leanback.widget.ListRow.<init>(ListRow.java:34)
        at org.jellyfin.androidtv.ui.playback.AudioNowPlayingActivity.addQueue(AudioNowPlayingActivity.java:281)
        at org.jellyfin.androidtv.ui.playback.AudioNowPlayingActivity.onCreate(AudioNowPlayingActivity.java:275)
        at android.app.Activity.performCreate(Activity.java:8051)
        at android.app.Activity.performCreate(Activity.java:8031)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3608)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loopOnce(Looper.java:201) 
        at android.os.Looper.loop(Looper.java:288) 
        at android.app.ActivityThread.main(ActivityThread.java:7839) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) 
D/CompatibilityChangeReporter: Compat change id reported: 149924527; UID 10077; state: ENABLED
D/CompatibilityChangeReporter: Compat change id reported: 132649864; UID 10077; state: DISABLED
I/Process: Sending signal. PID: 5861 SIG: 9

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw this. I'm looking into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants