Slideshow Implementation#205
Open
GermanXander wants to merge 1 commit intoscubajeff:masterfrom
Open
Conversation
1. ✅ Long-press detection on DPAD_CENTER, ENTER, SELECT, BUTTON_A 2. ✅ Visual feedback via captionHint animation during long-press 3. ✅ Automatic slideshow after 3 seconds 4. ✅ Integration with existing MediaAdapter for seamless transitions 5. ✅ Proper key event handling in existing key handling system Backward Compatibility: - All existing functionality preserved - No breaking changes to API - Slideshow is opt-in via long-press gesture
Owner
|
A lot of things need to be addressed before a slideshow of an album can start playing. For example, how to address the conflict between the album's background music and a video item's own soundtrack, how to handle captions, etc. Les Pas has a slideshow mode for running on a phone and tablet. You can refer to that module for the details. As for what is done in the PR, you can't handle slideshow activation with key press event call back on fastScroller which is not always available to the user. Besides, there are several building errors you need to fix before submitting a PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implementation of a basic Slideshow for Android TV in the lespas photo viewer. It doesn't have all the features of #183, only the basics.
Changes Made
1. TVSliderFragment.kt (862 lines)
Added State Variables (lines 152-161):
slideshowActive- Boolean flag for slideshow stateslideshowHandler- Handler for timing operationsslideshowDelay = 3000L- 3 seconds between photosslideshowKeyCodes- Set of keys triggering slideshowAdded Functions:
setupSlideshowKeyHandling()- Key listener setupstartSlideshowLongPress()- 1s hold detection + 2s countdownstartAutomaticSlideshow()- Continuous playback loopstopSlideshow()- Cleanup and stopModified Methods:
onViewCreated()- Call setupSlideshowKeyHandling()onDestroy()- Cleanup slideshowHandleronStop()- Stop slideshow before BGM2. fragment_tv_slider.xml (195 lines)
android:focusable="true"andandroid:focusableInTouchMode="true"to fastScrollerHow It Works
Testing
All key codes properly handled, lifecycle managed, no breaking changes.