Skip to content

Conversation

Isira-Seneviratne
Copy link
Member

@Isira-Seneviratne Isira-Seneviratne commented Oct 4, 2020

What is it?

  • Bug fix (user facing)
  • Feature (user facing)
  • Code base improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Use the Parcelize annotation provided by Kotlin to automatically generate the boilerplate code for classes that implement the Parcelable interface.

Testing apk

debug.zip

Agreement

@Isira-Seneviratne Isira-Seneviratne force-pushed the Use_Parcelize_annotation branch from 35adfb8 to 5483180 Compare October 4, 2020 10:58
@Stypox
Copy link
Member

Stypox commented Oct 4, 2020

Great! I see code is greatly simplified, thank you!

@Stypox Stypox modified the milestone: 0.20.2 Oct 4, 2020
@Isira-Seneviratne Isira-Seneviratne force-pushed the Use_Parcelize_annotation branch 2 times, most recently from 2510eb3 to 5f47fc7 Compare October 12, 2020 00:08
@Isira-Seneviratne Isira-Seneviratne force-pushed the Use_Parcelize_annotation branch 3 times, most recently from 1538ac8 to 1379d99 Compare October 28, 2020 11:42
@Isira-Seneviratne Isira-Seneviratne force-pushed the Use_Parcelize_annotation branch 2 times, most recently from bed35b8 to 39f3717 Compare November 5, 2020 12:08
@Isira-Seneviratne Isira-Seneviratne force-pushed the Use_Parcelize_annotation branch 3 times, most recently from 00c279f to 35b948b Compare November 20, 2020 00:18
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me and works, I tested restoring from RAM on Android 4.4 and 7.0 :-D
Thank you ;-)

@Stypox Stypox merged commit 8bcf0c6 into TeamNewPipe:dev Nov 21, 2020
@Isira-Seneviratne Isira-Seneviratne deleted the Use_Parcelize_annotation branch November 21, 2020 08:11
@vkay94
Copy link
Contributor

vkay94 commented Nov 22, 2020

I just found out that Parcelize is part of the Kotlin Android Extensions compiler plugin and this plugin is deprecated starting from Kotlin 1.4.20 (NewPipe uses 1.4.10 currently). But there is a standalone plugin for it (kotlin-parcelize). Here). is an article about it. @Isira-Seneviratne

@Isira-Seneviratne
Copy link
Member Author

Isira-Seneviratne commented Nov 23, 2020

I just found out that Parcelize is part of the Kotlin Android Extensions compiler plugin and this plugin is deprecated starting from Kotlin 1.4.20 (NewPipe uses 1.4.10 currently). But there is a standalone plugin for it (kotlin-parcelize). Here). is an article about it. @Isira-Seneviratne

Thanks, I'll create a PR with the necessary changes when 1.4.20 is released.

@XiangRongLin
Copy link
Collaborator

XiangRongLin commented Jan 4, 2021

@Isira-Seneviratne Can you run the ErrorInfoTest?
For me it always fails at gradle :app:compileDebugAndroidTestJavaWithJavac, with

error: incompatible types: Object cannot be converted to ErrorInfo
        final ErrorInfo infoFromParcel = ErrorInfo.CREATOR.createFromParcel(parcel);

At first i thought it was because i was using windows, but this time it also failed in a CI action
https://github.com/XiangRongLin/NewPipe/runs/1645255340?check_suite_focus=true#step:6:57137
line 57317

could be related: https://youtrack.jetbrains.com/issue/KT-25807
kotlin 1.4.20 seems to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants