Skip to content

Commit 528a991

Browse files
committed
Analysis: Resolve parameter is never and could be renamed to _ warnings
Warning Message: "Parameter 'xyz' is never used, could be renamed to _" Renaming the parameter 'xyz' that is never used to '_' or removing it completely is the recommended action to resolve this kind of warnings.
1 parent ac8fbda commit 528a991

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsDetailListFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class NotificationsDetailListFragment : ListFragment(), NotificationFragment {
301301
}
302302
}
303303
}
304-
private val mOnGravatarClickedListener = OnGravatarClickedListener { siteId, userId, siteUrl ->
304+
private val mOnGravatarClickedListener = OnGravatarClickedListener { siteId, _, siteUrl ->
305305
if (!isAdded || activity !is NotificationsDetailActivity) {
306306
return@OnGravatarClickedListener
307307
}

WordPress/src/main/java/org/wordpress/android/ui/people/InviteLinksApiCallsProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class InviteLinksApiCallsProvider @Inject constructor(
5050
suspend fun generateLinks(blogId: Long): InviteLinksCallResult = suspendCoroutine { cont ->
5151
val endPointPath = "/sites/$blogId/invites/links/generate"
5252

53-
val listener = Listener { jsonObject ->
53+
val listener = Listener {
5454
AppLog.d(
5555
T.PEOPLE,
5656
"generateLinks > Succeeded [blogId=$blogId]"
@@ -72,7 +72,7 @@ class InviteLinksApiCallsProvider @Inject constructor(
7272
suspend fun disableLinks(blogId: Long): InviteLinksCallResult = suspendCoroutine { cont ->
7373
val endPointPath = "/sites/$blogId/invites/links/disable"
7474

75-
val listener = Listener { jsonObject ->
75+
val listener = Listener {
7676
AppLog.d(
7777
T.PEOPLE,
7878
"deleteLinks > Succeeded [blogId=$blogId]"

WordPress/src/main/java/org/wordpress/android/ui/people/WPEditTextWithChipsOutlined.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ class WPEditTextWithChipsOutlined @JvmOverloads constructor(
276276
}
277277

278278
private fun setListeners() {
279-
editor.setOnFocusChangeListener { v, hasFocus ->
279+
editor.setOnFocusChangeListener { _, hasFocus ->
280280
val canAnimate = hint.width > 0 && label.width > 0 && hint.height > 0 && label.height > 0
281281
if (canAnimate) {
282282
styleView(hasFocus, hasItemsOrText(), true)

WordPress/src/main/java/org/wordpress/android/ui/posts/editor/StoriesEventListener.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ class StoriesEventListener @Inject constructor(
293293
)
294294
builder.setTitle(activity.getString(R.string.dialog_edit_story_unavailable_title))
295295
builder.setMessage(activity.getString(R.string.dialog_edit_story_unavailable_message))
296-
builder.setPositiveButton(R.string.dialog_button_ok) { dialog, id ->
296+
builder.setPositiveButton(R.string.dialog_button_ok) { dialog, _ ->
297297
dialog.dismiss()
298298
}
299299
val dialog = builder.create()
@@ -305,7 +305,7 @@ class StoriesEventListener @Inject constructor(
305305
)
306306
builder.setTitle(activity.getString(R.string.dialog_edit_story_unrecoverable_title))
307307
builder.setMessage(activity.getString(R.string.dialog_edit_story_unrecoverable_message))
308-
builder.setPositiveButton(R.string.dialog_button_ok) { dialog, id -> dialog.dismiss() }
308+
builder.setPositiveButton(R.string.dialog_button_ok) { dialog, _ -> dialog.dismiss() }
309309
val dialog = builder.create()
310310
dialog.show()
311311
}
@@ -348,7 +348,7 @@ class StoriesEventListener @Inject constructor(
348348
activity
349349
)
350350
builder.setTitle(activity.getString(R.string.cannot_retry_deleted_media_item_fatal))
351-
builder.setPositiveButton(R.string.ok) { dialog, id -> dialog.dismiss() }
351+
builder.setPositiveButton(R.string.ok) { dialog, _ -> dialog.dismiss() }
352352
val dialog = builder.create()
353353
dialog.show()
354354
return

WordPress/src/main/java/org/wordpress/android/ui/reader/ReaderPostDetailFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ class ReaderPostDetailFragment : ViewPagerFragment(),
348348
appBar.addOnOffsetChangedListener(appBarLayoutOffsetChangedListener)
349349

350350
// Fixes collapsing toolbar layout being obscured by the status bar when drawn behind it
351-
ViewCompat.setOnApplyWindowInsetsListener(appBar) { v: View, insets: WindowInsetsCompat ->
351+
ViewCompat.setOnApplyWindowInsetsListener(appBar) { _: View, insets: WindowInsetsCompat ->
352352
val insetTop = insets.systemWindowInsetTop
353353
if (insetTop > 0) {
354354
toolBar.setPadding(0, insetTop, 0, 0)

WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/StatsUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class StatsUtils
173173
entries: List<Line>
174174
): List<String> {
175175
val contentDescriptions = mutableListOf<String>()
176-
entries.forEachIndexed { index, bar ->
176+
entries.forEachIndexed { _, bar ->
177177
val contentDescription = resourceProvider.getString(
178178
R.string.stats_bar_chart_accessibility_entry,
179179
bar.label,

0 commit comments

Comments
 (0)