mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 23:00:31 +05:30
Merge pull request #4443 from Bnyro/master
feat: download option in audio player
This commit is contained in:
commit
f642aa0d24
@ -36,6 +36,7 @@ import com.github.libretube.helpers.PlayerHelper
|
|||||||
import com.github.libretube.obj.ShareData
|
import com.github.libretube.obj.ShareData
|
||||||
import com.github.libretube.services.OnlinePlayerService
|
import com.github.libretube.services.OnlinePlayerService
|
||||||
import com.github.libretube.ui.activities.MainActivity
|
import com.github.libretube.ui.activities.MainActivity
|
||||||
|
import com.github.libretube.ui.dialogs.DownloadDialog
|
||||||
import com.github.libretube.ui.dialogs.ShareDialog
|
import com.github.libretube.ui.dialogs.ShareDialog
|
||||||
import com.github.libretube.ui.interfaces.AudioPlayerOptions
|
import com.github.libretube.ui.interfaces.AudioPlayerOptions
|
||||||
import com.github.libretube.ui.listeners.AudioPlayerThumbnailListener
|
import com.github.libretube.ui.listeners.AudioPlayerThumbnailListener
|
||||||
@ -111,10 +112,6 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions {
|
|||||||
binding.playerMotionLayout.transitionToEnd()
|
binding.playerMotionLayout.transitionToEnd()
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.dropdownMenu.setOnClickListener {
|
|
||||||
onLongTap()
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.autoPlay.isChecked = PlayerHelper.autoPlayEnabled
|
binding.autoPlay.isChecked = PlayerHelper.autoPlayEnabled
|
||||||
binding.autoPlay.setOnCheckedChangeListener { _, isChecked ->
|
binding.autoPlay.setOnCheckedChangeListener { _, isChecked ->
|
||||||
PlayerHelper.autoPlayEnabled = isChecked
|
PlayerHelper.autoPlayEnabled = isChecked
|
||||||
@ -165,6 +162,12 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.download.setOnClickListener {
|
||||||
|
val videoId = PlayingQueue.getCurrent()?.url?.toID() ?: return@setOnClickListener
|
||||||
|
val downloadDialog = DownloadDialog(videoId)
|
||||||
|
downloadDialog.show(childFragmentManager, DownloadDialog::class.java.name)
|
||||||
|
}
|
||||||
|
|
||||||
binding.share.setOnClickListener {
|
binding.share.setOnClickListener {
|
||||||
val currentVideo = PlayingQueue.getCurrent() ?: return@setOnClickListener
|
val currentVideo = PlayingQueue.getCurrent() ?: return@setOnClickListener
|
||||||
ShareDialog(
|
ShareDialog(
|
||||||
|
@ -56,16 +56,6 @@
|
|||||||
app:track="@drawable/player_switch_track"
|
app:track="@drawable/player_switch_track"
|
||||||
app:trackTint="?colorControlNormal" />
|
app:trackTint="?colorControlNormal" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/dropdown_menu"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:background="?selectableItemBackgroundBorderless"
|
|
||||||
android:scaleX="0.8"
|
|
||||||
android:scaleY="0.8"
|
|
||||||
android:src="@drawable/ic_three_dots" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
@ -298,6 +288,11 @@
|
|||||||
style="@style/AudioPlayerButton"
|
style="@style/AudioPlayerButton"
|
||||||
android:src="@drawable/ic_video" />
|
android:src="@drawable/ic_video" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/download"
|
||||||
|
style="@style/AudioPlayerButton"
|
||||||
|
android:src="@drawable/ic_download" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/share"
|
android:id="@+id/share"
|
||||||
style="@style/AudioPlayerButton"
|
style="@style/AudioPlayerButton"
|
||||||
|
Loading…
Reference in New Issue
Block a user