Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit fe90849

Browse files
committed
Bug 1975907 - Update annotation syntax for defaulting rule changes. r=android-reviewers,mcarare
warning: This annotation is currently applied to the value parameter only, but in the future it will also be applied to 'field'. See https://youtrack.jetbrains.com/issue/KT-73255 for more details. To remove this warning, use the '@param:' annotation target. Differential Revision: https://phabricator.services.mozilla.com/D256213
1 parent 7b4857e commit fe90849

File tree

92 files changed

+220
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+220
-254
lines changed

mobile/android/android-components/components/browser/errorpages/src/main/java/mozilla/components/browser/errorpages/ErrorPages.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ object ErrorPages {
102102
* Enum containing all supported error types that we can display an error page for.
103103
*/
104104
enum class ErrorType(
105-
@StringRes val titleRes: Int,
106-
@StringRes val messageRes: Int,
107-
@StringRes val refreshButtonRes: Int = R.string.mozac_browser_errorpages_page_refresh,
108-
@StringRes val imageNameRes: Int? = null,
109-
@StringRes val errorCode: Int? = null,
105+
@param:StringRes val titleRes: Int,
106+
@param:StringRes val messageRes: Int,
107+
@param:StringRes val refreshButtonRes: Int = R.string.mozac_browser_errorpages_page_refresh,
108+
@param:StringRes val imageNameRes: Int? = null,
109+
@param:StringRes val errorCode: Int? = null,
110110
) {
111111
UNKNOWN(
112112
R.string.mozac_browser_errorpages_generic_title,

mobile/android/android-components/components/browser/icons/src/main/java/mozilla/components/browser/icons/IconRequest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ data class IconRequest(
2323
val url: String,
2424
val size: Size = Size.DEFAULT,
2525
val resources: List<Resource> = emptyList(),
26-
@ColorInt val color: Int? = null,
26+
@param:ColorInt val color: Int? = null,
2727
val isPrivate: Boolean = false,
2828
val waitOnNetworkLoad: Boolean = true,
2929
) {
@@ -33,7 +33,7 @@ data class IconRequest(
3333
*
3434
* We are trying to limit the supported sizes in order to optimize our caching strategy.
3535
*/
36-
enum class Size(@DimenRes val dimen: Int) {
36+
enum class Size(@param:DimenRes val dimen: Int) {
3737
DEFAULT(R.dimen.mozac_browser_icons_size_default),
3838
LAUNCHER(R.dimen.mozac_browser_icons_size_launcher),
3939
LAUNCHER_ADAPTIVE(R.dimen.mozac_browser_icons_size_launcher_adaptive),

mobile/android/android-components/components/browser/icons/src/main/java/mozilla/components/browser/icons/generator/DefaultIconGenerator.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ import kotlin.math.abs
2929
* representing the URL.
3030
*/
3131
class DefaultIconGenerator(
32-
@DimenRes private val cornerRadiusDimen: Int? = R.dimen.mozac_browser_icons_generator_default_corner_radius,
33-
@ColorRes private val textColorRes: Int = R.color.mozac_browser_icons_generator_default_text_color,
34-
@ArrayRes private val backgroundColorsRes: Int = R.array.mozac_browser_icons_photon_palette,
32+
@param:DimenRes private val cornerRadiusDimen: Int? = R.dimen.mozac_browser_icons_generator_default_corner_radius,
33+
@param:ColorRes private val textColorRes: Int = R.color.mozac_browser_icons_generator_default_text_color,
34+
@param:ArrayRes private val backgroundColorsRes: Int = R.array.mozac_browser_icons_photon_palette,
3535
) : IconGenerator {
3636

3737
override fun generate(context: Context, request: IconRequest): Icon {

mobile/android/android-components/components/browser/menu/src/main/java/mozilla/components/browser/menu/BrowserMenuHighlight.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ sealed class BrowserMenuHighlight {
3737
* displaying their own highlight.
3838
*/
3939
data class LowPriority(
40-
@ColorInt val notificationTint: Int,
40+
@param:ColorInt val notificationTint: Int,
4141
override val label: String? = null,
4242
override val canPropagate: Boolean = true,
4343
) : BrowserMenuHighlight() {
@@ -58,7 +58,7 @@ sealed class BrowserMenuHighlight {
5858
* displaying their own highlight.
5959
*/
6060
data class HighPriority(
61-
@ColorInt val backgroundTint: Int,
61+
@param:ColorInt val backgroundTint: Int,
6262
override val label: String? = null,
6363
val endImageResource: Int = NO_ID,
6464
override val canPropagate: Boolean = true,
@@ -79,10 +79,10 @@ sealed class BrowserMenuHighlight {
7979
*/
8080
@Deprecated("Replace with LowPriority or HighPriority highlight")
8181
open class ClassicHighlight(
82-
@DrawableRes val startImageResource: Int,
83-
@DrawableRes val endImageResource: Int,
84-
@DrawableRes val backgroundResource: Int,
85-
@ColorRes val colorResource: Int,
82+
@param:DrawableRes val startImageResource: Int,
83+
@param:DrawableRes val endImageResource: Int,
84+
@param:DrawableRes val backgroundResource: Int,
85+
@param:ColorRes val colorResource: Int,
8686
override val canPropagate: Boolean = true,
8787
) : BrowserMenuHighlight() {
8888
override val label: String? = null

mobile/android/android-components/components/browser/menu/src/main/java/mozilla/components/browser/menu/BrowserMenuPositioning.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ internal data class MenuPositioningData(
3939
/**
4040
* Distance between [display top, anchor top margin]. Used for better positioning the menu.
4141
*/
42-
@Px val availableHeightToTop: Int = 0,
42+
@param:Px val availableHeightToTop: Int = 0,
4343

4444
/**
4545
* Distance between [display bottom, anchor bottom margin]. Used for better positioning the menu.
4646
*/
47-
@Px val availableHeightToBottom: Int = 0,
47+
@param:Px val availableHeightToBottom: Int = 0,
4848

4949
/**
5050
* [View#measuredHeight] of the menu. May be bigger than the available screen height.
5151
*/
52-
@Px val containerViewHeight: Int = 0,
52+
@param:Px val containerViewHeight: Int = 0,
5353
)
5454

5555
/**

mobile/android/android-components/components/browser/menu/src/main/java/mozilla/components/browser/menu/WebExtensionBrowserMenuBuilder.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,8 @@ class WebExtensionBrowserMenuBuilder(
156156
* Allows to customize how items should look like.
157157
*/
158158
data class Style(
159-
@ColorRes
160-
val webExtIconTintColorResource: Int = NO_ID,
161-
@DrawableRes
162-
val backPressMenuItemDrawableRes: Int = iconsR.drawable.mozac_ic_back_24,
163-
@DrawableRes
164-
val addonsManagerMenuItemDrawableRes: Int = iconsR.drawable.mozac_ic_extension_24,
159+
@param:ColorRes val webExtIconTintColorResource: Int = NO_ID,
160+
@param:DrawableRes val backPressMenuItemDrawableRes: Int = iconsR.drawable.mozac_ic_back_24,
161+
@param:DrawableRes val addonsManagerMenuItemDrawableRes: Int = iconsR.drawable.mozac_ic_extension_24,
165162
)
166163
}

mobile/android/android-components/components/browser/menu/src/main/java/mozilla/components/browser/menu/item/BrowserMenuCategory.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,10 @@ import mozilla.components.concept.menu.candidate.TypefaceStyle
3535
class BrowserMenuCategory(
3636
internal val label: String,
3737
private val textSize: Float = NO_ID.toFloat(),
38-
@ColorRes
39-
private val textColorResource: Int = NO_ID,
40-
@ColorRes
41-
private val backgroundColorResource: Int = NO_ID,
42-
@TypefaceStyle private val textStyle: Int = Typeface.BOLD,
43-
@TextAlignment private val textAlignment: Int = View.TEXT_ALIGNMENT_VIEW_START,
38+
@param:ColorRes private val textColorResource: Int = NO_ID,
39+
@param:ColorRes private val backgroundColorResource: Int = NO_ID,
40+
@param:TypefaceStyle private val textStyle: Int = Typeface.BOLD,
41+
@param:TextAlignment private val textAlignment: Int = View.TEXT_ALIGNMENT_VIEW_START,
4442
override val isCollapsingMenuLimit: Boolean = false,
4543
override val isSticky: Boolean = false,
4644
) : BrowserMenuItem {

mobile/android/android-components/components/browser/menu/src/main/java/mozilla/components/browser/menu/item/BrowserMenuHighlightableItem.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ private val defaultHighlight = BrowserMenuHighlightableItem.Highlight(0, 0, 0, 0
4141
*/
4242
class BrowserMenuHighlightableItem(
4343
private val label: String,
44-
@DrawableRes private val startImageResource: Int,
44+
@param:DrawableRes private val startImageResource: Int,
4545
@ColorRes iconTintColorResource: Int = NO_ID,
46-
@ColorRes private val textColorResource: Int = NO_ID,
46+
@param:ColorRes private val textColorResource: Int = NO_ID,
4747
enabled: Boolean = true,
4848
override val isCollapsingMenuLimit: Boolean = false,
4949
override val isSticky: Boolean = false,

mobile/android/android-components/components/browser/menu/src/main/java/mozilla/components/browser/menu/item/BrowserMenuHighlightableSwitch.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ import mozilla.components.concept.menu.candidate.LowPriorityHighlightEffect
3232
*/
3333
class BrowserMenuHighlightableSwitch(
3434
label: String,
35-
@DrawableRes private val startImageResource: Int,
36-
@ColorRes private val iconTintColorResource: Int = NO_ID,
37-
@ColorRes private val textColorResource: Int = NO_ID,
35+
@param:DrawableRes private val startImageResource: Int,
36+
@param:ColorRes private val iconTintColorResource: Int = NO_ID,
37+
@param:ColorRes private val textColorResource: Int = NO_ID,
3838
override val isCollapsingMenuLimit: Boolean = false,
3939
override val isSticky: Boolean = false,
4040
override val highlight: BrowserMenuHighlight.LowPriority,

mobile/android/android-components/components/browser/menu/src/main/java/mozilla/components/browser/menu/item/BrowserMenuImageSwitch.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ import java.lang.reflect.Modifier
2828
*/
2929
class BrowserMenuImageSwitch(
3030
@get:VisibleForTesting(otherwise = Modifier.PRIVATE)
31-
@DrawableRes
32-
val imageResource: Int,
31+
@param:DrawableRes val imageResource: Int,
3332
label: String,
3433
override val isCollapsingMenuLimit: Boolean = false,
3534
override val isSticky: Boolean = false,

0 commit comments

Comments
 (0)