Skip to content

Commit

Permalink
6.6.7 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
XilinJia committed Sep 17, 2024
1 parent 7d78f2b commit 338788a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 20 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 6 additions & 10 deletions app/src/main/kotlin/ac/mdiq/podcini/ui/dialog/SleepTimerDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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 ->
Expand All @@ -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) {
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -324,20 +323,17 @@ 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)
val angleRad = atan2((center.y - event.y).toDouble(), (center.x - event.x).toDouble())
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {}
Expand Down Expand Up @@ -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)
}
}
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/3020252.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 338788a

Please sign in to comment.