-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Feature: reminder type selector #32
base: develop
Are you sure you want to change the base?
Feature: reminder type selector #32
Conversation
Right now the button doesn't do anything other than open up the three options. Placeholder icons and colours are used (although I don't mind the current menu button colours). |
Thanks for getting started on this! It looks already very good! I know it's only a POC, but as it already looks close to a usable version, here are some comments:
Btw, Github has Draft pull requests, I converted it to one. |
Thanks!
Okay, I'll look into it. Strange that adding the elevation attribute didn't do anything, since they use it all over the example app.
Have you looked at it on a physical device (with wireless debugging, for example)? It's the "mini" version, so it's the same size as the menu buttons. The only other option (without scale attributes) is the "normal" version, which is the bigger size in the example gif. In my opinion, if it gets any smaller it could run the risk of being too small for some users to consistently tap.
The spin? I agree. It can be removed by setting the
Unfortunately there is only one opening animation available in the AFAB project. The "popping up" effect is caused by the interpolator they have chosen here: The closing animation uses the
You're right, I didn't notice it before. It can be fixed by adding an Thanks for converting it to a draft, I must have missed the option to create it as one. |
Notes: - The icons are obviously placeholders (still) - Selecting the "nagging" option will make the reminder nag correctly, but there is no toast or long press yet so the nagging interval is always 1 minute - The current selection is indicated by a white border around the button, which is done using a progress bar with a white background and foreground
The above commit removes the spin animation and fixes the margin issue, in addition to what was listed in the commit message. |
Yes, my impression came from a physical device. But it's also more about the relative size in relation to the other UI elements (text field, date buttons, add button). I don't think that a slightly smaller button, better fitting into the remaining UI, would be too small compared to other UI elements commonly found. In addition, in the system settings one can set the general size for UI elements, so that if one has problems of comfortably using the UI, one can scale it up. I just tested it with the Add Reminder dialog and it works fine. So I I'd prefer to try a smaller version - it must be possible to set the size freely somewhere, I would expect in the XML?
Thanks for tracking it down and good if it doesn't seem too difficult to change. It's easy to make changes (which we might have to/want to anyway if the project is no longer maintained) and still include it as a dependency: we would simply fork the project on Github and then include it via jitpack in the same way as of now, or add it as a submodule, like it is done with As these changes are not crucial for now, we could wait until everything else is sorted out. But if you want to experiment, you can of course go ahead and fork the Advanced Floating Action Button project. When you add it as a submodule you will set and then later update the commit that the main repository is supposed to use. If for instance you want to use a specific branch from the forked AFAB project, that's no problem. Probably this intro on git submodules and maybe a bit of the git book should be enough to get you going.
Sounds good! I'll take a look soon. |
Okay, sure. I made it slightly smaller, so it's approximately the same size as the circular indicator on the date picker now.
I think the latter is the way to go. There's a few other things I'd like to change the AFAB source code for (exposing some functions, mostly) so I'll look into it.
Thanks for the tips and the resources! PS: I increased the size of the labels, which in my opinion makes them stand out more and blend into the background less. Let me know what you think. |
Okay, I've forked the AFAB repo, added it as a submodule, and pushed some changes to it in a new branch ( Also, I made the main button change colour according to the selection because I didn't think the selection change was obvious enough. Let me know what you think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with the submodule! As the improvements you make to the project are probably not just SimpleReminder-related, you probably want to merge them into master or at least some general feature branch there before we merge here, and then you can make a pull request to the main project (just to see whether there is interest; if it gets merged, we can switch back to the main project).
The button size seems fine now (even though it could still be a little bit smaller, but that will also depend on which icons we choose). However, I would reduce the margins to the left and right, so that it is more above the "+" button and the text goes nearly up to the button.
I'm not sure which size of the labels I like best, let's decide when we have a near final version.
Very nice with the current choice now being indicated by main button in a grey version as well as in the menu! With real icons it will probably look very good!
As commented in the code, let's keep the data model as-is for now and focus on the UI. Currently there are no alarm reminders anyway, so we don't need any change in the data model. We could use the new UI even before alarm reminders are available, the corresponding button could just result in a toast "Coming soon: alarm reminders" :).
So maybe the long-click actions as well as removal/change of animation would be next?
Good work!
android:scaleX="0.95" | ||
android:scaleY="0.95" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to specify the size in dp, so it's more in line with the size specification of other UI elements? Or, if the original is in dp, then it's maybe okay. I just want to make sure it scales fine in relation to the other UI elements for different screen sizes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scaleX and scaleY parameters are a percentage, so 0.95 means 95% of the original size (see the docs). The original, unscaled sizes are also specified in dp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay then it's fine, especially if it is not possible to specify dp here.
@Builder //(builderClassName = "Builder") | ||
public Reminder(int id, @NonNull Date date, int naggingRepeatInterval, @NonNull String text) { | ||
public Reminder(int id, @NonNull Date date, int naggingRepeatInterval, @NonNull String text, @NonNull ReminderType reminderType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding changes to persistency (for example in this class), let's rather not continue on this for now because I haven't thought yet about how to do this best. (Several things have to be considered here including compatibility with the previous data format, whether it's "future save" and also that this class and others are now implemented in Kotlin.)
My only concern with that is that some changes we make will only be needed for the app - for example, changing the interpolator. I'm not sure that implementing a way for users of the library to change the interpolator without modifying the source code is within the scope of this PR, but simply changing that one line of source code is. The only other changes I've made is exposing some getters on the button colours and making the
Good idea, I'll do that.
Sure.
Thanks!
Okay, sure. That would mean it wouldn't be possible to remember the reminder type for alarm reminders, which I guess is not that big of an issue since they haven't been implemented yet.
Yep, I'll get on that soon too. |
Ah okay, that's also fine for now. Another aspect to consider: Does the AFAB library have further dependencies and are they maintained? Is the code generally fine/are there any important Lint warnings if you run code inspection on the project?
Exactly; one shouldn't even be able to choose the alarm reminder type (optimally, selecting it will only show the toast, not change the choice). And when one then for instance edits a reminder, the selection should be at either normal reminder or nagging reminder.
Sounds good, thanks! |
issue: java.lang.ClassNotFoundException: _layoutlib_._internal_.kotlin.TypeCastException
app/build.gradle
Outdated
@@ -93,6 +93,7 @@ dependencies { | |||
implementation project(':sectionedrecyclerviewadapter') | |||
compileOnly 'org.projectlombok:lombok:1.18.4' | |||
annotationProcessor 'org.projectlombok:lombok:1.18.4' | |||
implementation 'androidx.core:core-ktx:1.8.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Luckily this will anyway be included because of the switch to Kotlin (I'll try to push my maintenance work soon).
From AFAB's build.gradle: implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" // 1.3.41
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' All of the above libraries have new versions available, although they are all on their most recent major versions. The first three are widely used and supported, and the last three are test dependencies which are basically unused, given that the two tests in the library (1, 2) are examples that haven't been touched since the first commit.
There are a few (11) lint warnings but they don't seem too important. Two of them are labelled as errors and they both seem relatively simple to fix:
I can try to fix them if you'd like, but they haven't affected anything so far. There is also an error in one of the tests where
|
as newer version had a resource linking error
It now uses the The FAB is also now aligned with the "+" button. |
Long clicking is implemented now too, on the menu icons and on the main icon (acting as whichever is currently selected). |
Regarding the AFAB libraryThanks for checking the code and dependencies. I suggest
Then see whether everything still works fine. We just have to keep in mind that by making our UI depend on this library, we will have to maintain it to some degree and we don't want that to be troublesome. Regarding the updates
|
Sure, I'll look into it and let you know how it goes.
The
Disabling the "flashing" effect on the labels is pretty straightforward, it just involves setting Doing the same for the main button is a bit harder because it changes colour depending on if it's open or closed, so the ripple/pressed colours would have to be changed accordingly. This is a more complex task than it seems, since the Another option would be to add a function called something like A third option would be to add an attribute called something like To quickly compare the button with and without the flashing, you can comment out lines 187 to 200 in ReminderDialogActivity.java. PS: I also added some potential icons. The bell and alarm ones are borrowed from SystemUI (with credit in LICENSE.md) and the bell with the |
Perfect! Regarding your updates
As I am not into the internals of the library, I haven't really checked how you made it possible with avoiding animation on the main button (thanks for the description though). I suggest to document at least the methods you add to the library if it is not intuitive for externals (for example, I wouldn't know what the different color types like "current color" refer to). If instead a general explanation at the class level would do (describing the concepts/terms) then that would also be helpful. Again, very good work! P.S. I haven't looked at your code in detail yet, I will do a full review in the end where I might give some suggestions for improvement. I will probably also ask you to cleanup the commit history in the end (I don't want to squash all commits, as for example including the icons from elsewhere and adding a dependency etc. should be a separate commit, while other commits can be combined into one); I hope that will be okay for you, otherwise I could do that. |
I have now pushed the maintenance changes I mentioned before, so this branch can be rebased onto the updated develop branch. There will be a few merge conflicts, but they are easy to solve. If you like, I would do the rebasing. I also just tried different animation parameters, and the following times and interpolators seem best to me:
Lower numbers don't seem to make it faster anyway (it probably depends on the animation speed set in system settings). Thanks again for your work, when do you think you would continue with the few things that are left? |
@maxcutlyp are you planning to complete this pull request? |
Hey! I'd like to start by apologising for my disappearance, and more specifically, my lack of communication regarding it. The short is that I got a new job and found myself with significantly less spare time, and suddenly two months had passed without me realising it. As for this PR - I would love to complete it, but to be honest, I can't promise I'll be able to. I think it's best if you finish it off - there shouldn't be much left after the merge conflicts are resolved. I'll add you as a collaborator to my fabmenus fork so you can easily make changes without the URL changing - if you'd like me to transfer it instead, let me know. Again, sorry for my absence. Good luck with the rest of this feature - I look forward to seeing it in a future update. |
Hi, thanks for your message and congratulations with the job. It's understandable that it got your focus. I'll complete this pull request then, no worries. Regarding the fork of afab, I think I will rather create a fork under my account, so that everything is in one place. I'll probably even start with a fresh fork and implement the changes a bit differently. Regarding the removal of the ripple effect on the main button, I see that the current solution is to just set the ripple color in the onClick listener, which I guess results in that the effect cannot be seen. I think I'd really prefer a "doRipple" attribute as you suggested before or just remove the effect completely in the library's code. So I think I'll try to find the places in the code where the effect is created and make that part conditional or remove it. Regarding your contributions, I'll add you to the list of contributors (probably also within a new section for the icon). Your entry will link to your Github profile, but you can choose a different display name instead of your user name and optionally I'll add an email address. Let me know what you prefer. Thanks again for your help! Whenever you feel like contributing again, please let me know, I'd really appreciated it and there is always a lot to do :). |
Implementing #30.