minor fixes

This commit is contained in:
Bnyro 2022-07-20 13:49:56 +02:00
parent 28d95c3bc6
commit 88da71502f
4 changed files with 20 additions and 12 deletions

View File

@ -404,10 +404,10 @@ class PlayerFragment : Fragment() {
// show the advanced player options
playerBinding.toggleOptions.setOnClickListener {
if (playerBinding.advancedOptions.isVisible) {
playerBinding.toggleOptions.animate().rotationX(0F).setDuration(200).start()
playerBinding.toggleOptions.animate().rotation(0F).setDuration(250).start()
playerBinding.advancedOptions.visibility = View.GONE
} else {
playerBinding.toggleOptions.animate().rotationX(180F).setDuration(200).start()
playerBinding.toggleOptions.animate().rotation(180F).setDuration(250).start()
playerBinding.advancedOptions.visibility = View.VISIBLE
}
}
@ -613,9 +613,15 @@ class PlayerFragment : Fragment() {
}
private fun toggleDescription() {
binding.playerDescriptionArrow.animate().rotationBy(180F).setDuration(250).start()
binding.descLinLayout.visibility =
if (binding.descLinLayout.isVisible) View.GONE else View.VISIBLE
if (binding.descLinLayout.isVisible) {
// hide the description and chapters
binding.playerDescriptionArrow.animate().rotation(0F).setDuration(250).start()
binding.descLinLayout.visibility = View.GONE
} else {
// show the description and chapters
binding.playerDescriptionArrow.animate().rotation(180F).setDuration(250).start()
binding.descLinLayout.visibility = View.VISIBLE
}
}
private fun toggleComments() {

View File

@ -102,14 +102,16 @@ object ThemeHelper {
val nManager = context
.getSystemService(AppCompatActivity.NOTIFICATION_SERVICE) as NotificationManager
nManager.cancelAll()
// restart to MainActivity
// start a new Intent of the app
val pm: PackageManager = context.packageManager
val intent = pm.getLaunchIntentForPackage(context.packageName)
intent?.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK
context.startActivity(intent)
// kill the old application
android.os.Process.killProcess(android.os.Process.myPid())
}
fun getThemeColor(context: Context, colorCode: Int): Int {
private fun getThemeColor(context: Context, colorCode: Int): Int {
val value = TypedValue()
context.theme.resolveAttribute(colorCode, value, true)
return value.data

View File

@ -19,7 +19,7 @@ internal class CustomExoPlayerView(
init {
setControllerVisibilityListener {
// hide the advanced options
binding.toggleOptions.animate().rotationX(0F).setDuration(0).start()
binding.toggleOptions.animate().rotation(0F).setDuration(250).start()
binding.advancedOptions.visibility = View.GONE
}
}

View File

@ -62,10 +62,10 @@
style="@style/Widget.Material3.CardView.Elevated"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:layout_marginStart="8dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="12dp"
android:visibility="gone"
app:cardCornerRadius="18dp"
app:cardElevation="20dp">