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

Parent PR for updating compileSdk 33 #17947

Merged
merged 60 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
225b774
Update compileSdk to 33
irfano Feb 10, 2023
69f1fb8
Disable all warnings as errors for temporary fix
irfano Feb 10, 2023
f4af1c4
Update changed functions of AnimatorListener
irfano Jan 29, 2023
dfddd9a
Update changed functions of MenuItem
irfano Feb 11, 2023
a57595c
Update changed functions of SimpleOnGestureListener
irfano Jan 29, 2023
2b2b024
Remove redundant SAM-constructors
irfano Feb 12, 2023
41557cd
Move lambda argument out of parentheses in PostListActivity
irfano Feb 12, 2023
dcec3d3
Remove unused import from MediaPickerActionModeCallback
irfano Feb 12, 2023
45c680b
Merge branch 'trunk' into feature/update-compile-sdk-33
irfano Feb 25, 2023
8648d0b
Use onBackPressedDispatcher to trigger onBackPressed()
irfano Feb 11, 2023
3bca5a7
Migrate activities to OnBackPressedCallback
irfano Feb 11, 2023
bf693ec
Migrate dialogs to OnBackPressedCallback
irfano Feb 27, 2023
b1607f0
Use extension function for OnBackPressedCallback
irfano Feb 11, 2023
864b7db
Move lambda argument out pf parentheses
irfano Feb 12, 2023
0afe737
Remove redundant null checks
irfano Feb 12, 2023
cc9f2e9
Add missing super.onBackPressed() behaviors
irfano Mar 1, 2023
3a3110e
Fix loop issue of OnBackPressedCallback in SiteCreationActivity
irfano Mar 2, 2023
1808fd4
Fix the crash on JetpackFullPluginInstallOnboardingDialogFragment
irfano Mar 1, 2023
1749865
Refactor ComponentDialog casting
irfano Mar 2, 2023
fb7a69c
Refactor onBackPressed function in CollapseFullScreenDialogFragment
irfano Mar 5, 2023
bfcf01d
Use CompatExtensions functions for migrating super.onBackPressed
irfano Mar 5, 2023
5364166
Merge pull request #18019 from wordpress-mobile/update-deprecated-onb…
ParaskP7 Mar 6, 2023
c13d776
Merge branch 'trunk' into feature/update-compile-sdk-33
irfano Mar 6, 2023
3489019
Add CompatExtensions
irfano Feb 28, 2023
851a448
Update deprecated functions of Intent and Bundle
irfano Mar 7, 2023
f34517c
Use type-safe functions for Bundle
irfano Mar 7, 2023
dcb6e30
Replace get calls with indexing operator
irfano Mar 7, 2023
b6a4373
Move lambda arguments out of parentheses
irfano Mar 7, 2023
8d8edac
Add types to CompatExtensions functions
irfano Mar 8, 2023
ae617dc
Reformat lines of commentIdentifier
irfano Mar 8, 2023
0f4d567
Reformat lines for ViewModelProviders
irfano Mar 8, 2023
3b9109d
Add null check for tracking source key
irfano Mar 8, 2023
d16d34d
Fix a comment in CompatExtensions
irfano Mar 8, 2023
ff3699a
Update androidx.core version to 1.9.0
irfano Mar 8, 2023
86dd01a
Add android.permission.POST_NOTIFICATIONS
irfano Mar 8, 2023
d33a199
Use ParcelCompat for Android 13 changes
irfano Mar 8, 2023
62375b2
Optimize type references on CompatExtensions functions
irfano Mar 9, 2023
de3e505
Reformat lines for ViewModelProviders
irfano Mar 9, 2023
4c32fd4
Add comments to functions in CompatExtensions
irfano Mar 9, 2023
d98d281
Revert "Update androidx.core version to 1.9.0"
irfano Mar 9, 2023
28fff0b
Revert "Add android.permission.POST_NOTIFICATIONS"
irfano Mar 9, 2023
4047e5a
Revert "Use ParcelCompat for Android 13 changes"
irfano Mar 9, 2023
64f591a
Add Android 13 compatibility functions for Parcel
irfano Mar 9, 2023
21ad209
Update deprecated Parcel functions
irfano Mar 9, 2023
b194387
Add comments to functions in CompatExtensions
irfano Mar 9, 2023
36ed7ac
Merge pull request #18061 from wordpress-mobile/update-intent-bundle-…
irfano Mar 9, 2023
2ced926
Merge branch 'trunk' into feature/update-compile-sdk-33
irfano Mar 9, 2023
b5bc515
Merge branch 'feature/update-compile-sdk-33' into update-parcelcompat…
irfano Mar 9, 2023
01736fb
Merge pull request #18068 from wordpress-mobile/update-parcelcompat-f…
irfano Mar 9, 2023
3143cc1
Merge branch 'trunk' into feature/update-compile-sdk-33
irfano Mar 9, 2023
1fbf19a
Add Android 13 compatibility functions for PackageManager
irfano Mar 9, 2023
6c1911c
Update deprecated PackageManager functions
irfano Mar 9, 2023
bb9c0d1
Merge pull request #18077 from wordpress-mobile/update-deprecated-pac…
irfano Mar 15, 2023
7afedcb
Merge branch 'trunk' into feature/update-compile-sdk-33
irfano Mar 15, 2023
77a6278
Re-enable all warnings as errors
irfano Mar 15, 2023
d49b8d7
Fix null exception on Bundle.getSerializableCompat()
irfano Mar 16, 2023
343b1dc
Merge branch 'trunk' into feature/update-compile-sdk-33
irfano Mar 16, 2023
e4274d5
Remove empty files
irfano Mar 17, 2023
7ac2576
Update deprecated intent functions in JetpackRemoteInstallActivity
irfano Mar 17, 2023
4e3568d
Update deprecated onBackPressed usage in JetpackRemoteInstallActivity
irfano Mar 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Optimize type references on CompatExtensions functions
  • Loading branch information
irfano committed Mar 9, 2023
commit 62375b25b5aa531d01075bca43101c913fa708ee
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ class ActivityLogListFragment : Fragment(R.layout.activity_log_list_fragment) {
}
}

val site: SiteModel = requireNotNull(
val site = requireNotNull(
if (savedInstanceState == null) {
val nonNullIntent = checkNotNull(nonNullActivity.intent)
nonNullIntent.getSerializableExtraCompat(WordPress.SITE)
nonNullIntent.getSerializableExtraCompat<SiteModel>(WordPress.SITE)
} else {
savedInstanceState.getSerializableCompat(WordPress.SITE)
savedInstanceState.getSerializableCompat<SiteModel>(WordPress.SITE)
}
)
val rewindableOnly = nonNullActivity.intent.getBooleanExtra(ACTIVITY_LOG_REWINDABLE_ONLY_KEY, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,14 @@ class ScanFragment : Fragment(R.layout.scan_fragment) {
}

private fun getSite(savedInstanceState: Bundle?): SiteModel {
val site: SiteModel? = if (savedInstanceState == null) {
requireActivity().intent.getSerializableExtraCompat(WordPress.SITE)
} else {
savedInstanceState.getSerializableCompat(WordPress.SITE)
}
return requireNotNull(site)
val site = requireNotNull(
if (savedInstanceState == null) {
requireActivity().intent.getSerializableExtraCompat<SiteModel>(WordPress.SITE)
} else {
savedInstanceState.getSerializableCompat<SiteModel>(WordPress.SITE)
}
)
return site
}

override fun onSaveInstanceState(outState: Bundle) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,14 @@ class ScanHistoryFragment : Fragment(R.layout.scan_history_fragment), MenuProvid
}

private fun getSite(savedInstanceState: Bundle?): SiteModel {
val site: SiteModel? = if (savedInstanceState == null) {
requireActivity().intent.getSerializableExtraCompat(WordPress.SITE)
} else {
savedInstanceState.getSerializableCompat(WordPress.SITE)
}
return requireNotNull(site)
val site = requireNotNull(
if (savedInstanceState == null) {
requireActivity().intent.getSerializableExtraCompat<SiteModel>(WordPress.SITE)
} else {
savedInstanceState.getSerializableCompat<SiteModel>(WordPress.SITE)
}
)
return site
}

override fun onSaveInstanceState(outState: Bundle) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@ class ScanHistoryListFragment : ViewPagerFragment(R.layout.scan_history_list_fra
}

private fun getSite(savedInstanceState: Bundle?): SiteModel {
val site: SiteModel? = if (savedInstanceState == null) {
requireActivity().intent.getSerializableExtraCompat(WordPress.SITE)
} else {
savedInstanceState.getSerializableCompat(WordPress.SITE)
}
return requireNotNull(site)
val site = requireNotNull(
if (savedInstanceState == null) {
requireActivity().intent.getSerializableExtraCompat<SiteModel>(WordPress.SITE)
} else {
savedInstanceState.getSerializableCompat<SiteModel>(WordPress.SITE)
}
)
return site
}

private fun getTabType() = requireNotNull(arguments?.getParcelableCompat<ScanHistoryTabType>(ARG_TAB_TYPE))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,13 @@ class PagesFragment : Fragment(R.layout.pages_fragment), ScrollableViewInitializ
setupActions(activity)
setupMlpObservers(activity)

val site: SiteModel = requireNotNull(
val site = requireNotNull(
if (savedInstanceState == null) {
val nonNullIntent = checkNotNull(activity.intent)
nonNullIntent.getSerializableExtraCompat(WordPress.SITE)
nonNullIntent.getSerializableExtraCompat<SiteModel>(WordPress.SITE)
} else {
restorePreviousSearch = true
savedInstanceState.getSerializableCompat(WordPress.SITE)
savedInstanceState.getSerializableCompat<SiteModel>(WordPress.SITE)
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ class CategoriesListFragment : Fragment(R.layout.site_settings_categories_list_f
}

private fun getSite(savedInstanceState: Bundle?): SiteModel {
val site: SiteModel? = if (savedInstanceState == null) {
requireActivity().intent.getSerializableExtraCompat(WordPress.SITE)
} else {
savedInstanceState.getSerializableCompat(WordPress.SITE)
}
return requireNotNull(site)
val site = requireNotNull(
if (savedInstanceState == null) {
requireActivity().intent.getSerializableExtraCompat<SiteModel>(WordPress.SITE)
} else {
savedInstanceState.getSerializableCompat<SiteModel>(WordPress.SITE)
}
)
return site
}

private fun SiteSettingsCategoriesListFragmentBinding.setupObservers() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ class StatsViewAllFragment : DaggerFragment(R.layout.stats_view_all_fragment) {
savedInstanceState: Bundle?
) {
val nonNullIntent = checkNotNull(activity.intent)
val type: StatsViewType = requireNotNull(
val type = requireNotNull(
if (savedInstanceState == null) {
nonNullIntent.getSerializableExtraCompat(ARGS_VIEW_TYPE)
nonNullIntent.getSerializableExtraCompat<StatsViewType>(ARGS_VIEW_TYPE)
} else {
savedInstanceState.getSerializableCompat(ARGS_VIEW_TYPE)
savedInstanceState.getSerializableCompat<StatsViewType>(ARGS_VIEW_TYPE)
}
)

Expand Down