Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add uri scheme for opening timer by opening a link #79

Merged
merged 3 commits into from Jul 4, 2022

Conversation

olastor
Copy link

@olastor olastor commented Jul 3, 2022

for #15

@tzugen can you please take a look?

link scheme is like this: bodhi://timer?times=60,120 (will start a 1 minute and a two minute timer)

Pausing does not work properly, but I think that is not necessary to support initially.

import android.content.Intent
import android.content.IntentFilter
import android.content.SharedPreferences
import android.content.*
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IDE changed this, is the wildcard import a problem?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems for some people this is important, I don't care either way

@olastor olastor changed the title Draft: feat: add uri scheme for opening timer by opening a link feat: add uri scheme for opening timer by opening a link Jul 3, 2022
}

for (timeStr in data.getQueryParameter("times")!!.split(",").toTypedArray()) {
val time = Integer.valueOf(timeStr)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested what happens

  • when times= (empty param)
  • when times=,
  • when times=@€(@,€(

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, good point... The last two raise an unhandled error. I've added a try/catch and a check whether the timer list is empty after parsing.

@tzugen tzugen merged commit 5f63a92 into yuttadhammo:master Jul 4, 2022
@tzugen
Copy link
Collaborator

tzugen commented Jul 4, 2022

Merged, thank you!

@tzugen
Copy link
Collaborator

tzugen commented Jul 4, 2022

ah, forgot, could you add a short note to the readme to document this feature? Otherwise it will be very hidden.

@olastor
Copy link
Author

olastor commented Jul 5, 2022

ah, forgot, could you add a short note to the readme to document this feature? Otherwise it will be very hidden.

sure, added in #80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants