Coder Social home page Coder Social logo

skydoves / only Goto Github PK

View Code? Open in Web Editor NEW
484.0 9.0 29.0 566 KB

:bouquet: An easy way to persist and run code block only as many times as necessary on Android.

License: Apache License 2.0

Kotlin 100.00%
kotlin android preference only onlyonce dsl kotlin-dsl persistence skydoves

only's Introduction

Google Developer Expert Google Developers Medium Speaker
Sponsors Twitter Mastodon YouTube

GitHub Status

only's People

Contributors

skydoves avatar vitusortner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

only's Issues

[FR] Set a time period along with the number of times to do an action

Is your feature request related to a problem?

So the thing is, say I want to show a feedback dialog to the user every 2 months and do this for a certain number of times.

Describe the solution you'd like:

Set a time period and number of times the dialog should appear.

Time period = value in duration
Count = number

You can even set exponential backoff for that. Like for example, first 3 counts, it asks every 3 months (the developer sets this time period parameter of course), then once the count is reached, it'll ask every 6 months and so on. Now with de-sugaring, you can incorporate java 8 time libraries for that.

Repeat every X times

I almost wanted to implement the Once library (https://github.com/jonfinerty/Once) until I found your library. The Once has a feature I'd really like to see in Only and that is repeating a task every X times. There can be multiple variants for this feature.

Variant 1) perform action on the first time (when action has never been performed) and after X times
Variant 2) perform action after X times
Variant 3) perform action after X times and keep redoing this for Y times or an infinite amount of times

Examples:

  1. Ask user to rate app after opening the app 10 times, keep asking again after 10 times until the user has rated the app

  2. Notify user about new feature on the app launch and remind them every 10 app startups 2 times (meaning this action is done after 20 app startups)

  3. Keep reminding the user about something every X times for-ever

I hope you can consider this functionality and for starters just implement the basic one (variant 1 or 2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.