Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

[Android] Use PersistableBundle to persist the whole ShortCutItem object #54

Merged
merged 1 commit into from
Dec 12, 2018
Merged

[Android] Use PersistableBundle to persist the whole ShortCutItem object #54

merged 1 commit into from
Dec 12, 2018

Conversation

ItsNoHax
Copy link
Contributor

@ItsNoHax ItsNoHax commented Dec 18, 2017

Fixes: #51

Pro's:

  1. In memory list mShortcutItems is no longer needed.
  2. 'Type' is technically useless now but I think we should leave it to distinguish each shortcut.
  3. Method: getShortcutItem is no longer needed since the whole object is persisted, not just type.
  4. The whole object persists on COLD APP launch, now consistent with iOS version.

Cons:

  • I believe we need to set the minimumSDK to 21 since PersistableBundle was only added then but because quick actions on Android are only supported on Android 7.1 (25) and after, this should be fine?

This should cause no regression but I am not 100% sure whether iOS returns the whole object like this.

Let me know what you think,

Alberto Blanco

@jordanbyron
Copy link
Owner

Thanks @ItsNoHax! I've skimmed through the code and nothing jumps out as immediately concerning. I need to fire up my old copy of Android Studio and play around with this to make sure it works as expected. If you don't hear from me in a week or so feel free to ping me again.

@ItsNoHax
Copy link
Contributor Author

ItsNoHax commented Jan 8, 2018

@jordanbyron Managed to have a look at this?

@jordanbyron
Copy link
Owner

jordanbyron commented Jan 12, 2018 via email

@ItsNoHax
Copy link
Contributor Author

Hey man, I would very much like to close this issue at work. Could you please take 5 minutes of your time to look at this?

@jordanbyron
Copy link
Owner

jordanbyron commented Feb 21, 2018 via email

@AndrewJack
Copy link
Contributor

AndrewJack commented Feb 21, 2018

@jordanbyron I deleted the comment. I didn't read the diff right. The code looks fine to me.

I'll try and test this PR over the next few days.

Links are still useful to understand PersistableBundle:

@ItsNoHax
Copy link
Contributor Author

Just answering some points in the comment deleted. If I remember correctly, the reason I used PersistableBundle is because it restricts the data types it can hold to make sure it is always persistable since ShortCutManager saves the shortcutinfo on disk.

@jordanbyron
Copy link
Owner

@ItsNoHax I finally had a chance to update my Android Studio so I could test out this PR and it seems like there is a bit of a problem. Any ideas?

screen shot 2018-03-03 at 1 37 10 pm

@ItsNoHax
Copy link
Contributor Author

ItsNoHax commented Mar 7, 2018

Hey @jordanbyron, I'm not sure what that error means but I don't think it's related to my code?
By the sounds of it I'm guessing you linked your project twice. Check your MainApplication/MainActivity for duplicates.

@jsdario
Copy link

jsdario commented Apr 3, 2018

Hi all, I tried the fork and can't use it straight away. I believe it's because I need to lift the API (still using lvl 16, and have users at lower than 21). Is there a way to only use the native code if it is supported by the API level?

I am not really a Java developer and already tried, but couldn't get it working.

@diego3g
Copy link
Contributor

diego3g commented Dec 12, 2018

Any updates on this?

@ItsNoHax
Copy link
Contributor Author

ItsNoHax commented Dec 12, 2018 via email

@diego3g
Copy link
Contributor

diego3g commented Dec 12, 2018

@ItsNoHax Can you publish your fork to NPM registry?

@jordanbyron
Copy link
Owner

🤠 I'll just merge this. If something goes wrong with the android side of the house I'll expect ya'll to chip in and help fix it. As I've stated before the Android code was "gifted" to me and I don't use it.

@jordanbyron jordanbyron merged commit 3afdc9b into jordanbyron:master Dec 12, 2018
@ItsNoHax
Copy link
Contributor Author

Let me know if something goes wrong or some edge case appears and I'll gladly get it fixed.

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

Successfully merging this pull request may close these issues.

5 participants