diff --git a/app/build.gradle b/app/build.gradle index 686defd3..f61e1e0f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,8 +31,8 @@ android { testApplicationId "ac.mdiq.podcini.tests" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - versionCode 3020251 - versionName "6.6.6" + versionCode 3020252 + versionName "6.6.7" applicationId "ac.mdiq.podcini.R" def commit = "" diff --git a/app/src/main/kotlin/ac/mdiq/podcini/storage/model/VolumeAdaptionSetting.kt b/app/src/main/kotlin/ac/mdiq/podcini/storage/model/VolumeAdaptionSetting.kt index 820e5d1e..a3a1cce5 100644 --- a/app/src/main/kotlin/ac/mdiq/podcini/storage/model/VolumeAdaptionSetting.kt +++ b/app/src/main/kotlin/ac/mdiq/podcini/storage/model/VolumeAdaptionSetting.kt @@ -6,12 +6,12 @@ enum class VolumeAdaptionSetting(private val value: Int, @JvmField val adaptionF OFF(0, 1.0f, R.string.feed_volume_reduction_off), LIGHT_REDUCTION(1, 0.5f, R.string.feed_volume_reduction_light), HEAVY_REDUCTION(2, 0.2f, R.string.feed_volume_reduction_heavy), -// LIGHT_BOOST(3, 1.5f, R.string.feed_volume_boost_light), + LIGHT_BOOST(3, 1.6f, R.string.feed_volume_boost_light), // MEDIUM_BOOST(4, 2f, R.string.feed_volume_boost_medium), // HEAVY_BOOST(5, 2.5f, R.string.feed_volume_boost_heavy); - LIGHT_BOOST(3, 2f, R.string.feed_volume_boost_light), - MEDIUM_BOOST(4, 4f, R.string.feed_volume_boost_medium), - HEAVY_BOOST(5, 7f, R.string.feed_volume_boost_heavy); +// LIGHT_BOOST(3, 2f, R.string.feed_volume_boost_light), + MEDIUM_BOOST(4, 2.4f, R.string.feed_volume_boost_medium), + HEAVY_BOOST(5, 3.6f, R.string.feed_volume_boost_heavy); fun toInteger(): Int { return value diff --git a/app/src/main/kotlin/ac/mdiq/podcini/ui/dialog/SleepTimerDialog.kt b/app/src/main/kotlin/ac/mdiq/podcini/ui/dialog/SleepTimerDialog.kt index 24e5a7ab..423986ad 100644 --- a/app/src/main/kotlin/ac/mdiq/podcini/ui/dialog/SleepTimerDialog.kt +++ b/app/src/main/kotlin/ac/mdiq/podcini/ui/dialog/SleepTimerDialog.kt @@ -79,6 +79,12 @@ class SleepTimerDialog : DialogFragment() { etxtTime = binding.etxtTime binding.timeDisplay.visibility = View.GONE + val timeLeft = (playbackService?.taskManager?.sleepTimerTimeLeft?:0) + if (timeLeft > 0) { + binding.timeSetup.visibility = View.GONE + binding.timeDisplay.visibility = View.VISIBLE + binding.time.text = getDurationStringLong(timeLeft.toInt()) + } val extendSleepFiveMinutesButton = binding.extendSleepFiveMinutesButton extendSleepFiveMinutesButton.text = getString(R.string.extend_sleep_timer_label, 5) val extendSleepTenMinutesButton = binding.extendSleepTenMinutesButton @@ -125,7 +131,6 @@ class SleepTimerDialog : DialogFragment() { } binding.disableSleeptimerButton.setOnClickListener { playbackService?.taskManager?.disableSleepTimer() } - binding.setSleeptimerButton.setOnClickListener { if (!PlaybackService.isRunning) { Snackbar.make(content, R.string.no_media_playing_label, Snackbar.LENGTH_LONG).show() @@ -265,7 +270,6 @@ class SleepTimerDialog : DialogFragment() { paintText.color = getColorFromAttr(context, android.R.attr.textColorPrimary) paintText.textAlign = Paint.Align.CENTER } - override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { when { MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY && MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.EXACTLY -> @@ -276,15 +280,12 @@ class SleepTimerDialog : DialogFragment() { else -> super.onMeasure(heightMeasureSpec, heightMeasureSpec) } } - override fun onDraw(canvas: Canvas) { super.onDraw(canvas) - val size = height.toFloat() // square val padding = size * 0.1f paintDial.strokeWidth = size * 0.005f bounds[padding, padding, size - padding] = size - padding - paintText.alpha = DIAL_ALPHA canvas.drawArc(bounds, 0f, 360f, false, paintDial) for (i in 0..23) { @@ -301,7 +302,6 @@ class SleepTimerDialog : DialogFragment() { canvas.drawLine(outer.x.toFloat(), outer.y.toFloat(), inner.x.toFloat(), inner.y.toFloat(), paintDial) } paintText.alpha = 255 - val angleFrom = from.toFloat() / 24 * 360 - 90 val angleDistance = ((to - from + 24) % 24).toFloat() / 24 * 360 paintSelected.strokeWidth = padding / 6 @@ -312,7 +312,6 @@ class SleepTimerDialog : DialogFragment() { canvas.drawCircle(p1.x.toFloat(), p1.y.toFloat(), padding / 2, paintSelected) val p2 = radToPoint(angleFrom + angleDistance + 90, size / 2 - padding) canvas.drawCircle(p2.x.toFloat(), p2.y.toFloat(), padding / 2, paintSelected) - paintText.textSize = 0.6f * padding val timeRange = when { from == to -> context.getString(R.string.sleep_timer_always) @@ -324,12 +323,10 @@ class SleepTimerDialog : DialogFragment() { } canvas.drawText(timeRange, size / 2, (size - paintText.descent() - paintText.ascent()) / 2, paintText) } - private fun radToPoint(angle: Float, radius: Float): Point { return Point((width / 2 + radius * sin(-angle * Math.PI / 180 + Math.PI)).toInt(), (height / 2 + radius * cos(-angle * Math.PI / 180 + Math.PI)).toInt()) } - override fun onTouchEvent(event: MotionEvent): Boolean { parent.requestDisallowInterceptTouchEvent(true) val center = Point(width / 2, height / 2) @@ -337,7 +334,6 @@ class SleepTimerDialog : DialogFragment() { var angle = (angleRad * (180 / Math.PI)).toFloat() angle += (360 + 360 - 90).toFloat() angle %= 360f - when { event.action == MotionEvent.ACTION_DOWN -> { val fromDistance = abs((angle - from.toFloat() / 24 * 360).toDouble()).toFloat() diff --git a/app/src/main/kotlin/ac/mdiq/podcini/ui/fragment/AudioPlayerFragment.kt b/app/src/main/kotlin/ac/mdiq/podcini/ui/fragment/AudioPlayerFragment.kt index fa4a340b..119c967b 100644 --- a/app/src/main/kotlin/ac/mdiq/podcini/ui/fragment/AudioPlayerFragment.kt +++ b/app/src/main/kotlin/ac/mdiq/podcini/ui/fragment/AudioPlayerFragment.kt @@ -391,7 +391,8 @@ class AudioPlayerFragment : Fragment(), SeekBar.OnSeekBarChangeListener, Toolbar is FlowEvent.PlayEvent -> onPlayEvent(event) is FlowEvent.FavoritesEvent -> onFavoriteEvent(event) is FlowEvent.PlayerErrorEvent -> MediaPlayerErrorDialog.show(activity as Activity, event) - is FlowEvent.SleepTimerUpdatedEvent -> if (event.isCancelled || event.wasJustEnabled()) loadMediaInfo(false) +// is FlowEvent.SleepTimerUpdatedEvent -> if (event.isCancelled || event.wasJustEnabled()) loadMediaInfo(false) + is FlowEvent.SleepTimerUpdatedEvent -> if (event.isCancelled || event.wasJustEnabled()) setupOptionsMenu() is FlowEvent.PlaybackPositionEvent -> onPlaybackPositionEvent(event) is FlowEvent.SpeedChangedEvent -> playerUI?.updatePlaybackSpeedButton(event) else -> {} @@ -707,9 +708,7 @@ class AudioPlayerFragment : Fragment(), SeekBar.OnSeekBarChangeListener, Toolbar fun onPlaybackServiceChanged(event: FlowEvent.PlaybackServiceEvent) { when (event.action) { FlowEvent.PlaybackServiceEvent.Action.SERVICE_SHUT_DOWN -> (activity as MainActivity).setPlayerVisible(false) - FlowEvent.PlaybackServiceEvent.Action.SERVICE_STARTED -> { - if (curMedia != null) (activity as MainActivity).setPlayerVisible(true) - } + FlowEvent.PlaybackServiceEvent.Action.SERVICE_STARTED -> if (curMedia != null) (activity as MainActivity).setPlayerVisible(true) // PlaybackServiceEvent.Action.SERVICE_RESTARTED -> (activity as MainActivity).setPlayerVisible(true) } } diff --git a/changelog.md b/changelog.md index cc684b28..72ff8f3e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +# 6.6.7 + +* volume adaptation numbers were changed to 0.2, 0.5, 1, 1.6, 2.4, 3.6 to avoid much distortion +* sleep timer and related menu item are enhanced + # 6.6.6 * fixed difference between the count of episodes and the actual number of episodes (seen when the number is small) in History, AllEpisodes, and OnlineFeed views diff --git a/fastlane/metadata/android/en-US/changelogs/3020252.txt b/fastlane/metadata/android/en-US/changelogs/3020252.txt new file mode 100644 index 00000000..eeecf727 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/3020252.txt @@ -0,0 +1,4 @@ + Version 6.6.7: + +* volume adaptation numbers were changed to 0.2, 0.5, 1, 1.6, 2.4, 3.6 to avoid much distortion +* sleep timer and related menu item are enhanced