From d01c72b7d77b6eb04046b6a54c1ea56829180d73 Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Tue, 6 Feb 2024 19:51:37 +0100 Subject: [PATCH] change: Disable SyntheticAccessor lint rule (#424) Does not appear to be adding value, and R8 optimises the code to remove the generated accessors. --- app/lint-baseline.xml | 1595 ----------------- app/lint.xml | 4 + .../notifications/NotificationsFragment.kt | 1 - .../components/trending/TrendingActivity.kt | 2 - .../trending/TrendingTagsFragment.kt | 2 - .../app/pachli/fragment/ViewVideoFragment.kt | 6 +- core/activity/lint-baseline.xml | 11 - core/common/lint-baseline.xml | 68 +- core/network/lint-baseline.xml | 24 +- .../app/pachli/feature/about/AboutActivity.kt | 2 - feature/login/lint-baseline.xml | 99 - 11 files changed, 7 insertions(+), 1807 deletions(-) diff --git a/app/lint-baseline.xml b/app/lint-baseline.xml index 4562ac73c..9b7487bb6 100644 --- a/app/lint-baseline.xml +++ b/app/lint-baseline.xml @@ -1866,1601 +1866,6 @@ column="13"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/app/src/main/java/app/pachli/components/notifications/NotificationsFragment.kt b/app/src/main/java/app/pachli/components/notifications/NotificationsFragment.kt index 0f679c7bd..3c2faa04a 100644 --- a/app/src/main/java/app/pachli/components/notifications/NotificationsFragment.kt +++ b/app/src/main/java/app/pachli/components/notifications/NotificationsFragment.kt @@ -161,7 +161,6 @@ class NotificationsFragment : actionButton?.visible(viewModel.uiState.value.showFabWhileScrolling || dy == 0) } - @Suppress("SyntheticAccessor") override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) { newState != SCROLL_STATE_IDLE && return diff --git a/app/src/main/java/app/pachli/components/trending/TrendingActivity.kt b/app/src/main/java/app/pachli/components/trending/TrendingActivity.kt index 1e2d5dedf..7ff971ef9 100644 --- a/app/src/main/java/app/pachli/components/trending/TrendingActivity.kt +++ b/app/src/main/java/app/pachli/components/trending/TrendingActivity.kt @@ -17,7 +17,6 @@ package app.pachli.components.trending -import android.annotation.SuppressLint import android.os.Bundle import android.view.Menu import android.view.MenuInflater @@ -69,7 +68,6 @@ class TrendingActivity : BottomSheetActivity(), AppBarLayoutHost, MenuProvider { onBackPressedDispatcher.addCallback( this, object : OnBackPressedCallback(true) { - @SuppressLint("SyntheticAccessor") override fun handleOnBackPressed() { if (binding.pager.currentItem != 0) binding.pager.currentItem = 0 else finish() } diff --git a/app/src/main/java/app/pachli/components/trending/TrendingTagsFragment.kt b/app/src/main/java/app/pachli/components/trending/TrendingTagsFragment.kt index 65cd8775e..cf8a045fc 100644 --- a/app/src/main/java/app/pachli/components/trending/TrendingTagsFragment.kt +++ b/app/src/main/java/app/pachli/components/trending/TrendingTagsFragment.kt @@ -17,7 +17,6 @@ package app.pachli.components.trending -import android.annotation.SuppressLint import android.content.res.Configuration import android.os.Bundle import android.view.Menu @@ -90,7 +89,6 @@ class TrendingTagsFragment : adapter.registerAdapterDataObserver( object : RecyclerView.AdapterDataObserver() { - @SuppressLint("SyntheticAccessor") override fun onItemRangeInserted(positionStart: Int, itemCount: Int) { if (positionStart == 0 && adapter.itemCount != itemCount) { binding.recyclerView.post { diff --git a/app/src/main/java/app/pachli/fragment/ViewVideoFragment.kt b/app/src/main/java/app/pachli/fragment/ViewVideoFragment.kt index 1c3aefe67..7e1c9b2fb 100644 --- a/app/src/main/java/app/pachli/fragment/ViewVideoFragment.kt +++ b/app/src/main/java/app/pachli/fragment/ViewVideoFragment.kt @@ -211,7 +211,7 @@ class ViewVideoFragment : ViewMediaFragment() { } mediaPlayerListener = object : Player.Listener { - @SuppressLint("ClickableViewAccessibility", "SyntheticAccessor") + @SuppressLint("ClickableViewAccessibility") @OptIn(UnstableApi::class) override fun onPlaybackStateChanged(playbackState: Int) { when (playbackState) { @@ -238,7 +238,6 @@ class ViewVideoFragment : ViewMediaFragment() { } } - @SuppressLint("SyntheticAccessor") override fun onPlayerError(error: PlaybackException) { binding.progressBar.hide() val message = getString( @@ -337,7 +336,6 @@ class ViewVideoFragment : ViewMediaFragment() { mediaAttachment.previewUrl?.let { url -> Glide.with(this).load(url).into( object : CustomTarget() { - @SuppressLint("SyntheticAccessor") override fun onResourceReady( resource: Drawable, transition: Transition?, @@ -346,7 +344,6 @@ class ViewVideoFragment : ViewMediaFragment() { binding.videoView.defaultArtwork = resource } - @SuppressLint("SyntheticAccessor") override fun onLoadCleared(placeholder: Drawable?) { view ?: return binding.videoView.defaultArtwork = null @@ -408,7 +405,6 @@ class ViewVideoFragment : ViewMediaFragment() { binding.mediaDescription.animate().alpha(alpha) .setListener( object : AnimatorListenerAdapter() { - @SuppressLint("SyntheticAccessor") override fun onAnimationEnd(animation: Animator) { view ?: return binding.mediaDescription.visible(isDescriptionVisible) diff --git a/core/activity/lint-baseline.xml b/core/activity/lint-baseline.xml index 730c55caa..558ce4a98 100644 --- a/core/activity/lint-baseline.xml +++ b/core/activity/lint-baseline.xml @@ -12,17 +12,6 @@ column="5"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/core/network/lint-baseline.xml b/core/network/lint-baseline.xml index f93456288..03c0924e0 100644 --- a/core/network/lint-baseline.xml +++ b/core/network/lint-baseline.xml @@ -1,26 +1,4 @@ - - - - - - - - - + diff --git a/feature/about/src/main/kotlin/app/pachli/feature/about/AboutActivity.kt b/feature/about/src/main/kotlin/app/pachli/feature/about/AboutActivity.kt index 547f28f1b..9bbd31cee 100644 --- a/feature/about/src/main/kotlin/app/pachli/feature/about/AboutActivity.kt +++ b/feature/about/src/main/kotlin/app/pachli/feature/about/AboutActivity.kt @@ -17,7 +17,6 @@ package app.pachli.feature.about -import android.annotation.SuppressLint import android.os.Bundle import androidx.activity.OnBackPressedCallback import androidx.appcompat.content.res.AppCompatResources @@ -67,7 +66,6 @@ class AboutActivity : BottomSheetActivity(), MenuProvider { onBackPressedDispatcher.addCallback( this, object : OnBackPressedCallback(true) { - @SuppressLint("SyntheticAccessor") override fun handleOnBackPressed() { if (binding.pager.currentItem != 0) binding.pager.currentItem = 0 else finish() } diff --git a/feature/login/lint-baseline.xml b/feature/login/lint-baseline.xml index 873403432..5e50a6c44 100644 --- a/feature/login/lint-baseline.xml +++ b/feature/login/lint-baseline.xml @@ -1,105 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -