-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Migrate related items fragment to Jetpack Compose #11383
Merged
Isira-Seneviratne
merged 15 commits into
TeamNewPipe:refactor
from
Isira-Seneviratne:Related-items-Compose
Aug 23, 2024
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b36eb5f
Rename .java to .kt
Isira-Seneviratne a73da16
Migrate related items fragment to Jetpack Compose
Isira-Seneviratne bd304ee
Specify mode parameter explicitly
Isira-Seneviratne dce84ea
Rm unused class
Isira-Seneviratne 994688b
Fix list item size
Isira-Seneviratne 34fd5da
Added stream progress bar, separate stream and playlist thumbnails
Isira-Seneviratne a267953
Display message if no related streams are available
Isira-Seneviratne 12d614d
Dispose of related items when closing the video player
Isira-Seneviratne 94450ab
Add modifiers for no items message function
Isira-Seneviratne 6b14811
Implement remaining stream menu items
Isira-Seneviratne fac92cd
Improved stream composables
Isira-Seneviratne 99bf052
Use view model lifecycle scope
Isira-Seneviratne 99d0d2d
Make live color solid red
Isira-Seneviratne 6f5187b
Use nested scroll modifier
Isira-Seneviratne 03b47b8
Simplify determineItemViewMode()
Isira-Seneviratne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
176 changes: 0 additions & 176 deletions
176
app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedItemsFragment.java
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedItemsFragment.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.schabi.newpipe.fragments.list.videos | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.ui.platform.ComposeView | ||
import androidx.compose.ui.platform.ViewCompositionStrategy | ||
import androidx.core.os.bundleOf | ||
import androidx.fragment.app.Fragment | ||
import org.schabi.newpipe.extractor.stream.StreamInfo | ||
import org.schabi.newpipe.ktx.serializable | ||
import org.schabi.newpipe.ui.components.video.RelatedItems | ||
import org.schabi.newpipe.ui.theme.AppTheme | ||
import org.schabi.newpipe.util.KEY_INFO | ||
|
||
class RelatedItemsFragment : Fragment() { | ||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
return ComposeView(requireContext()).apply { | ||
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed) | ||
setContent { | ||
AppTheme { | ||
Surface(color = MaterialTheme.colorScheme.background) { | ||
RelatedItems(requireArguments().serializable<StreamInfo>(KEY_INFO)!!) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
companion object { | ||
@JvmStatic | ||
fun getInstance(info: StreamInfo) = RelatedItemsFragment().apply { | ||
arguments = bundleOf(KEY_INFO to info) | ||
} | ||
} | ||
} |
22 changes: 0 additions & 22 deletions
22
app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedItemsInfo.java
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you need to make this change? Did requireContext() return an invalid context or something like that?