Skip to content
Snippets Groups Projects
Commit c0cab552 authored by Alexandre Perraud's avatar Alexandre Perraud Committed by Nicolas Pomepuy
Browse files

Add new repeat icon

parent 0b19dcf7
No related branches found
No related tags found
1 merge request!1131Settings moved to player + new advanced icons
<!--From Google Fonts repeat_black_48dp.svg-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:width="48dp"
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M7,7h10v1.79c0,0.45 0.54,0.67 0.85,0.35l2.79,-2.79c0.2,-0.2 0.2,-0.51 0,-0.71l-2.79,-2.79c-0.31,-0.31 -0.85,-0.09 -0.85,0.36L17,5L6,5c-0.55,0 -1,0.45 -1,1v4c0,0.55 0.45,1 1,1s1,-0.45 1,-1L7,7zM17,17L7,17v-1.79c0,-0.45 -0.54,-0.67 -0.85,-0.35l-2.79,2.79c-0.2,0.2 -0.2,0.51 0,0.71l2.79,2.79c0.31,0.31 0.85,0.09 0.85,-0.36L7,19h11c0.55,0 1,-0.45 1,-1v-4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v3z"
tools:fillColor="#ffffff"
android:fillColor="?attr/player_icon_color"/>
</vector>
<!--From Google Fonts repeat_black_48dp.svg-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M7,7h10v1.79c0,0.45 0.54,0.67 0.85,0.35l2.79,-2.79c0.2,-0.2 0.2,-0.51 0,-0.71l-2.79,-2.79c-0.31,-0.31 -0.85,-0.09 -0.85,0.36L17,5L6,5c-0.55,0 -1,0.45 -1,1v4c0,0.55 0.45,1 1,1s1,-0.45 1,-1L7,7zM17,17L7,17v-1.79c0,-0.45 -0.54,-0.67 -0.85,-0.35l-2.79,2.79c-0.2,0.2 -0.2,0.51 0,0.71l2.79,2.79c0.31,0.31 0.85,0.09 0.85,-0.36L7,19h11c0.55,0 1,-0.45 1,-1v-4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v3z"
android:fillColor="?attr/colorPrimary"/>
</vector>
<!--From Google Fonts repeat_one_black_48dp.svg-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:width="48dp"
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M7,7h10v1.79c0,0.45 0.54,0.67 0.85,0.35l2.79,-2.79c0.2,-0.2 0.2,-0.51 0,-0.71l-2.79,-2.79c-0.31,-0.31 -0.85,-0.09 -0.85,0.36L17,5L6,5c-0.55,0 -1,0.45 -1,1v4c0,0.55 0.45,1 1,1s1,-0.45 1,-1L7,7zM17,17L7,17v-1.79c0,-0.45 -0.54,-0.67 -0.85,-0.35l-2.79,2.79c-0.2,0.2 -0.2,0.51 0,0.71l2.79,2.79c0.31,0.31 0.85,0.09 0.85,-0.36L7,19h11c0.55,0 1,-0.45 1,-1v-4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v3zM13,14.25L13,9.81c0,-0.45 -0.36,-0.81 -0.81,-0.81 -0.13,0 -0.25,0.03 -0.36,0.09l-1.49,0.74c-0.21,0.1 -0.34,0.32 -0.34,0.55 0,0.34 0.28,0.62 0.62,0.62h0.88v3.25c0,0.41 0.34,0.75 0.75,0.75s0.75,-0.34 0.75,-0.75z"
tools:fillColor="#ffffff"
android:fillColor="?attr/colorPrimary"/>
</vector>
......@@ -107,8 +107,8 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
if (primary && AndroidDevices.pipAllowed && !AndroidDevices.isDex(activity))
options.add(PlayerOption(ID_POPUP_VIDEO, R.attr.ic_popup_dim, res.getString(R.string.ctx_pip_title)))
if (primary)
options.add(PlayerOption(ID_REPEAT, R.drawable.ic_repeat, res.getString(R.string.repeat_title)))
if (service.canShuffle()) options.add(PlayerOption(ID_SHUFFLE, R.drawable.ic_shuffle, res.getString(R.string.shuffle_title)))
options.add(PlayerOption(ID_REPEAT, R.drawable.ic_repeat_48dp, res.getString(R.string.repeat_title)))
options.add(PlayerOption(ID_VIDEO_STATS, R.attr.ic_video_stats, res.getString(R.string.video_information)))
}
val chaptersCount = service.getChapters(-1)?.size ?: 0
......@@ -279,18 +279,18 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
private fun setRepeatMode() {
when (service.repeatType) {
PlaybackStateCompat.REPEAT_MODE_NONE -> {
repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat_one)
repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat_one_48dp)
service.repeatType = PlaybackStateCompat.REPEAT_MODE_ONE
}
PlaybackStateCompat.REPEAT_MODE_ONE -> if (service.hasPlaylist()) {
repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat_all)
repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat_all_48dp)
service.repeatType = PlaybackStateCompat.REPEAT_MODE_ALL
} else {
repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat)
repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat_48dp)
service.repeatType = PlaybackStateCompat.REPEAT_MODE_NONE
}
PlaybackStateCompat.REPEAT_MODE_ALL -> {
repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat)
repeatBinding.optionIcon.setImageResource(R.drawable.ic_repeat_48dp)
service.repeatType = PlaybackStateCompat.REPEAT_MODE_NONE
}
}
......@@ -342,9 +342,9 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
repeatBinding = binding
AppScope.launch(Dispatchers.Main) {
repeatBinding.optionIcon.setImageResource(when (service.repeatType) {
PlaybackStateCompat.REPEAT_MODE_ONE -> R.drawable.ic_repeat_one
PlaybackStateCompat.REPEAT_MODE_ALL -> R.drawable.ic_repeat_all
else -> R.drawable.ic_repeat
PlaybackStateCompat.REPEAT_MODE_ONE -> R.drawable.ic_repeat_one_48dp
PlaybackStateCompat.REPEAT_MODE_ALL -> R.drawable.ic_repeat_all_48dp
else -> R.drawable.ic_repeat_48dp
})
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment