GithubHelp home page GithubHelp logo

maltaisn / recurpickerlib Goto Github PK

View Code? Open in Web Editor NEW
65.0 6.0 16.0 32.53 MB

Recurrence picker fragment and dialog for Android, with utilities for finding recurrence dates

License: Apache License 2.0

Kotlin 98.88% Java 1.12%
android android-library android-pickers android-dialog recurrence-picker

recurpickerlib's People

Contributors

amsanjeev avatar davidvavra avatar guger avatar maltaisn 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

recurpickerlib's Issues

Localization problems

Hi, I wanted to translate the library to Czech language (and others), but I face a few problems:

  • you are using some non-standard notation for string parameters, e.g. on every {0} {1}. I don't see why not to use standard parameters like %s. My translators are used to standard format and explaining them something else would be hard.
  • your custom parameter format ignores plurals. Some languages (like Czech), don't have just two forms (singular and plural), but multiple. For example "every month" is "každý měsíc", "every 2 months" is "každé 2 měsíce" and "every 5 months" is "každých 5 měsíců". I can't use plurals now, so Czech translation would be wrong. Android has plurals built-in, so why not to use it.
  • I would argue against string arrays, strings.xml should be only about translations and not about UI structure. It has disadvantage that some strings are repeating ("Forever"). So I would place only individual strings in strings.xml and build lists from them in the code. But it's not a blocker.
  • name of week days and abbreviated week days are part of Calendar API, you don't need to put them into translations. It's unnecessary clutter and increases APK size.
  • you can remove a string "rp_cancel" and replace it with "android.R.string.cancel"
  • you should put instructions for the translation into translation_description attribute instead of a comment. Tools for translators read it and display it automatically as a context.

What do you think? If you solve this, I'm willing to translate it into Czech myself and then upload it to GetLocalization platform where users of my app (Settle Up) translate the app to 18 languages. When it's translated I can send PR for all translated languages.

Strings "every 1 day" doesn't make sense

I uploaded strings to GL and started translating. I found that there are many string where quantity "one" doesn't make sense with the number. "Every 1 day" can simply be "Every day". "Every 1 month", "Repeats every 1 year" etc. is the same. Numbers should be removed from these strings.

Listeners instead of TargetFragment?

It's a consistent feature throughout all your libraries, the callback via setTargetFragment().

Why do you prefer this instead of passing a callback?

Computation error in findRecurrences

Hello.

Found an error in the computation of recurrences.

Starting date set to Fri Aug 02, 2019
Repeat every 5 weeks on sun, fri, sat with no end date.

Results:

  1. is on Sat Aug 03, 2019
  2. is on Sun Sept 01, 2019
  3. is on Fri Sept 06, 2019
  4. is on Sat Sept 07, 2019
  5. is on Sun Oct 06, 2019
  6. is on Fri Oct 11, 2019
  7. is on Sat Oct 12, 2019
  8. is on Sun Nov 10, 2019

Expected result:

  1. is on Sat Aug 03, 2019
  2. is on Sun Aug 04, 2019
  3. is on Fri Sept 06, 2019
  4. is on Sat Sept 07, 2019
  5. is on Sun Sept 08, 2019
  6. is on Fri Oct 11, 2019
  7. is on Sat Oct 12, 2019
  8. is on Sun Oct 13, 2019

Does anyone have a quick fix?

Day selection UI displays incorrectly in small screens

Currently on small screens or low resolution setting, the day selection buttons rollover and overlap each other
please check the screenshot to understand better

To replicate the issue , please try the following steps

  1. go to settings > display > display size
  2. change the display size to "largest"
  3. open the recurrence selection dialog

reproduce : yes
frequency : 5 of 5 (100%)

*attached screenshot is from a P4XL device with the display size set to largest

Screenshot (Jan 4, 2021 10_11_37 AM)

Callbacks not working

the callbacks are not being called.

@Override
   public void onRecurrencePickerSelected(Recurrence r) {
       Toast.makeText(activity, "working", Toast.LENGTH_SHORT).show();
   }

   @Override
   public void onRecurrencePickerCancelled(Recurrence r) {

       Toast.makeText(activity, "dismissed", Toast.LENGTH_SHORT).show();
   }

ArrayIndexOutOfBoundsException on line 498

Hi,
I see this crash in Crashlytics:

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 at com.maltaisn.recurpicker.RecurrencePickerView$10.afterTextChanged(RecurrencePickerView.java:498) at android.widget.TextView.sendAfterTextChanged(TextView.java:9375) at android.widget.TextView.setText(TextView.java:5401) at android.widget.TextView.setText(TextView.java:5248) at android.widget.EditText.setText(EditText.java:113) at android.widget.TextView.setText(TextView.java:5205) at com.maltaisn.recurpicker.RecurrencePickerView.changeMode(RecurrencePickerView.java:639) at com.maltaisn.recurpicker.RecurrencePickerView$2.onClick(RecurrencePickerView.java:291) at android.view.View.performClick(View.java:6256) at android.view.View$PerformClick.run(View.java:24701) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:251) at android.app.ActivityThread.main(ActivityThread.java:6572) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

Not sure what the user was doing, he had Android 8

Not able to use library with java project

Hello,

Since we have already discuss nearly the same issue on your other project icondialog that I am living same situation on your recurpicker lib also.

old issue --> maltaisn/icondialoglib#35

To make a test I have created 2 project on my pc one with kotlin the other one with java. So basically I wanted to run the demo on both project which has been mentioned here --> https://github.com/maltaisn/recurpickerlib/wiki/Using-the-library

My observation is;

When I use your library with the kotlin based created project everything is okey. Without problem I was able to run the demo.

But when I use the library on the java project, Project has been frozen and I was not able to run even auto complete code and not able index the code. (Ctrl+click on the object will not refer to real place or class.) Even when I have done invalidate cache and restart it will work on first time then when I import sth related the libarary or call the some variable which has been related your library I got the problem permanently.

So i thought maybe it can be help you to improve your library if some more people which has been faced the same issue like me. Maybe it is a problem for jetbrains or sth wrong on my PC(I have remove the android studio and re installed and currently version 4.0, so that is why I would not say a problem on my pc since your library worked with newly created kotlin project without problem.
). And also I am only doing some stuff as hobby on the android and I am not professional developer for android.

That is why I ve uploaded the 2 project as zip on the PR. You can have a look.
And I hope helps to you :)

JavaTrial.zip
KotlinTrial.zip

Android Studio 4.0
Build #AI-193.6911.18.40.6514223, built on May 20, 2020
Runtime version: 1.8.0_242-release-1644-b01 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1237M
Cores: 8
Registry: ide.new.welcome.screen.force=true
Non-Bundled Plugins: com.google.services.firebase, org.intellij.plugins.markdown

Setting to choose available option

Another recurrence picker had a feature request that asked to be able to choose available options ex:

  • No recurrence creator (custom... option)
  • Choosing available periods (daily, weekly, yearly...)
  • Choosing available end types (forever, date, count)

NullPointerException when not setting date formatter

Since the date formatter is required, what about either making it a constructor parameter, or throwing an IllegalStateException "Date Format must be set before calling show." when those parameters are not set before calling show.

Animating Dialog

What would be the best way to change the entering and exit animation for recurrence picker dialogs?

Recurrence Object and Serialization to/from non-Android

Is there a possibility you would ever support extracting the Recurrence object and its Serialization capability out to its own library. I have a tool that is using your (fantastic) recurpickerlib in Android. But would like to be able to generate Recurrence objects that are compatible from a standard Java application.

Customizable strings

Another recurrence picker had a feature request that was to be able to customize strings ex:

  • Option list items strings
  • Period spinner items strings
  • End type spinner items strings
  • Day of the week strings for Recurrence.format and day of week buttons

Recurrence At a specific date of month

Hi, Can anyone please guide me on how I can set recurrence of an event at a specific date of the month. Currently, if I select Period type "Month" it only shows two options recurrence on the same date of the month or the same day of the month.

Recurrence(Recurrence.Period.WEEKLY) String Invalid

I am using a weekly Recurrence and the default 'presets' for the RecurrencePickerSettings creates the default set. If a user selects 'Every week' the resulting Recurrence returned in onRecurrencePresetSelected() override has a toString() that looks like the following:

Recurrence{ Every week o }

If I then attempt to use RRuleFormatter.format() on that Recurrence during the loop on checking 'isRecurringOnDaysOfWeek' none are found. This also occurs in Recurrence class during it's toSting() (which is why the Recurrence to String looks like that). Then the StringBuilder removes the last two characters. In both cases this is not a valid RFC2445 or RFC5445 string.

If looks like the default Builder for Recurrence sets byDay = 1. Which is causing the problem if nothing else sets the byDay and since the preset doesn't it seems like byDay is becoming one and failing the isRecurringOnDaysOfWeek.

Am I doing something wrong here?

Ability to set Hours, Minutes, Seconds

Hello,

I was wondering if you had any plan to support the Period values for Hours, Minutes, and Seconds? This would make the recurrence closer to the RFC spec.

If not, no worries, please feel free to close this issue. Just wanted to check mostly

Repeat monthly

Hello. When I select REPEAT OPTION: "Custom..." -> REPEAT MONTHLY, I see two option: "on the same day each month" and "on every forth Tuesday". How I can to remove or change these options?

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.