-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
This pull request enables new group widgets #669
base: main
Are you sure you want to change the base?
Conversation
…o group-widget-2 � Conflicts: � app/src/main/res/values/strings.xml
In MainActivity there is a note like this: // Restore settings from Shared Preference You probably need to edit that to be like: if this is opened from the group widget, use that group. Otherwise, restore from shared preference |
Ah ok I understand. But I don't really know how to write the "if this is opened from the group widget" logic... I'm new to android development :) |
It works now on my device! Feel free to make a review or propose some changes. As I'm new to android development, don't hesitate to make suggestions/corrections/bug reports ! |
I noticed a bug: when changing a group name after a widget has been created for this group, the widget doesn't work anymore. |
That's the important part, so CardShortcutConfigure.java, line 21. It doesn't look like you changed anything there so maybe you found a crash that's in the master branch? What did you do to reproduce it? I can't reproduce the crash you mentioned on the master branch. I haven't tried your branch yet for this, it's been a busy week sorry. |
No worries, you can take your time :) I don't think I changed anything in this place compared to master. Will try the master branch on the same device and maybe open an issue if I encounter the problem again. To reproduce the issue on my branch: just try to create a shortcut. |
It's the same in the main branch, just created an issue. |
I'm sorry that this takes so much time for me to fix. Currently I don't have much time, but I plan to resume the work on this PR soon:copyright: :laughing: |
No worries. I could maybe do the update/delete part myself if you can't run an emulator with a less broken Android version but no promises because time and stuff |
# Conflicts: # app/src/main/java/protect/card_locker/MainActivity.java # app/src/main/res/values/strings.xml
…ith latest features
Well it looks like I need to update a lot of my code with the new UI... Is there a "rapid" and "clean" way to update to the new UI? |
Looking at the "Resolve conflicts" button on GitHub, the conflicts are really small, should be easy to resolve in the web UI. But you can also use the command line, look at the text "Use the web editor or the to resolve conflicts." GitHub shows on this PR |
Yes I now I could use this, but the group widget selector was based on the old UI and has therefor not been adapted to the new UI... |
Hmm, sorry, no suggestion there :( |
All right, no problem :) Just wanted to ask in case there was a way! |
# Conflicts: # app/src/main/res/values/strings.xml
# Conflicts: # app/src/main/res/values/strings.xml
This PR now works again ;) But the issue with the group shortcut update isn't resolved and I'm really stuck. I think the logic for card updates is in ShortcutHelper, but I don't really understand it... ping @TheLastProject, do you know how I could do this? |
Yeah, I think it is in ShortcutHelper too but I don't know for sure either. That code is still from Loyalty Card Keychain and I never touched it because it always worked for me. Have you tried running an emulator of a newer Android version than Android 5 in Android Studio yet? Because the last testing we did did seem to show that it's an Android 5 issue also with existing shortcuts. I think something went wrong with merging the new code into this PR by the way, I see a lot of changes in it unrelated to new group widgets :( |
The code seems pretty "complicated" for me ^^
I just tested on Android 13 ;) What doesn't work:
Really? I just checked again and it seems to me that all changes are related to group shortcuts (except a few blank lines here and there that I could clean up (maybe they were added by the ide?)). |
@TheLastProject After a bit of thinking, I have an idea why the updating might not work: |
I completely forgot I coded it that way! Ouch, that's not great. Okay, so, we'll first have to (and let's do this in another PR):
I think the easiest way is to just create 2 temporary tables and then create the new stuff like I did at newVersion 10 in the DBHelper class. It's going to be a bit of a pain but a requirement to make this work well I'm afraid :( |
So think that this issue might be the cause of the widget not updating because the id changes?
Maybe I can open a new issue to track those 3 points :) |
Yeah, I'm pretty sure that's the reason. Nice find :)
Sounds great :) |
This is just a draft because after a group widget is created, the group doesn't open up. Instead just the last window of the app opens. The group id is well transfered with the intent to the MainActivity, but then I don't really know how to do ^^ I'm sure it's a not a very difficult fix, but for the moment I'm stuck.
This would fix this feature request: #397