Skip to content
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

Fixed: #2395 Added SDK Checks for Deprecated Parcelable and Serializable Functions #2396

Conversation

SekhGulamMainuddin
Copy link
Contributor

@SekhGulamMainuddin SekhGulamMainuddin commented Oct 15, 2023

Fixes: #2395

Added SDK Checks for the Deprecated Parcelable and Serializable Functions.

Made an Object Class ParcelableAndSerializableUtils to do all the work so as to reduce redundancy in the code and refactored the activities and fragments containing the deprecated Parcelable and Serializable Functions.

object ParcelableAndSerializableUtils {

    fun <T> Bundle.getCheckedArrayListFromParcelable(classType: Class<T>, key: String): List<T>? {
        return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
            this.getParcelableArrayList(key, classType)
        } else {
            this.getParcelableArrayList(key)
        }
    }

    fun <T> Bundle.getCheckedParcelable(classType: Class<T>, key: String): T? {
        return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
            this.getParcelable(key, classType)
        } else {
            this.getParcelable(key)
        }
    }

    fun <T : Serializable> Bundle.getCheckedSerializable(classType: Class<T>, key: String): Any? {
        return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
            this.getSerializable(key, classType)
        } else {
            this.getSerializable(key)
        }
    }

}

@SekhGulamMainuddin SekhGulamMainuddin force-pushed the fixSerializableAndParcebleDeprecations branch from 04192d5 to aba69f7 Compare October 15, 2023 06:58
@SekhGulamMainuddin
Copy link
Contributor Author

@PratyushSingh07 can you please review my PR

@PratyushSingh07
Copy link
Collaborator

PratyushSingh07 commented Oct 16, 2023

I don't think of it as a priority as we are in the midst of migration. We can avoid this easily if we use navigation graph ( safe args should be enough imo). And in the future we are looking to entirely migrate the project to compose and it such a case we wouldn't really have to worry about this warning

@therajanmaurya
Copy link
Member

Hi @SekhGulamMainuddin can you resolve the conflicts, I see scope meanwhile we are migrating the PR but I want to put focus on migration. You are most welcome to send PR for migration to jetpack compose.

@SekhGulamMainuddin
Copy link
Contributor Author

Sure sir I will resolve the conflicts.

SaiThanushreddy and others added 23 commits February 14, 2024 11:12
fix openMF#1075: ui layout for loan application fragment
keshriAyushh and others added 24 commits February 14, 2024 11:13
fix openMF#1665: Filter error in AccountsFragment.kt fixed

fix openMF#1665: Filter error in AccountsFragment.kt fixed

fix openMF#1665: Filter error in AccountsFragment.kt fixed

fix openMF#1665: Filter error in AccountsFragment.kt fixed
…ations' into fixSerializableAndParcebleDeprecations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add SDK Checks to Deprecated Parcelable and Serializable functions
9 participants