Skip to content

Commit

Permalink
refactor(browser-ktx): make enum classes implement ValueEnum
Browse files Browse the repository at this point in the history
* Update API dump
  • Loading branch information
EdricChan03 committed May 10, 2024
1 parent a5ba8ed commit d82c4e1
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 28 deletions.
35 changes: 21 additions & 14 deletions androidx/browser/browser-ktx/api/browser-ktx.api
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ public final class io/github/edricchan03/androidx/browser/ktx/CustomTabIntentExt
public abstract interface annotation class io/github/edricchan03/androidx/browser/ktx/annotations/ExperimentalBrowserApi : java/lang/annotation/Annotation {
}

public final class io/github/edricchan03/androidx/browser/ktx/enums/ActivityHeightResizeBehavior : java/lang/Enum {
public final class io/github/edricchan03/androidx/browser/ktx/enums/ActivityHeightResizeBehavior : java/lang/Enum, io/github/edricchan03/androidx/common/enums/ValueEnum {
public static final field Adjustable Lio/github/edricchan03/androidx/browser/ktx/enums/ActivityHeightResizeBehavior;
public static final field Companion Lio/github/edricchan03/androidx/browser/ktx/enums/ActivityHeightResizeBehavior$Companion;
public static final field Default Lio/github/edricchan03/androidx/browser/ktx/enums/ActivityHeightResizeBehavior;
public static final field Fixed Lio/github/edricchan03/androidx/browser/ktx/enums/ActivityHeightResizeBehavior;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public fun getValue ()Ljava/lang/Integer;
public synthetic fun getValue ()Ljava/lang/Object;
public static fun valueOf (Ljava/lang/String;)Lio/github/edricchan03/androidx/browser/ktx/enums/ActivityHeightResizeBehavior;
public static fun values ()[Lio/github/edricchan03/androidx/browser/ktx/enums/ActivityHeightResizeBehavior;
}
Expand All @@ -104,14 +105,15 @@ public final class io/github/edricchan03/androidx/browser/ktx/enums/ActivityHeig
public synthetic fun fromValueOrNull (Ljava/lang/Object;)Ljava/lang/Enum;
}

public final class io/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetDecorationType : java/lang/Enum {
public final class io/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetDecorationType : java/lang/Enum, io/github/edricchan03/androidx/common/enums/ValueEnum {
public static final field Companion Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetDecorationType$Companion;
public static final field Default Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetDecorationType;
public static final field Divider Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetDecorationType;
public static final field None Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetDecorationType;
public static final field Shadow Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetDecorationType;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public fun getValue ()Ljava/lang/Integer;
public synthetic fun getValue ()Ljava/lang/Object;
public static fun valueOf (Ljava/lang/String;)Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetDecorationType;
public static fun values ()[Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetDecorationType;
}
Expand All @@ -121,13 +123,14 @@ public final class io/github/edricchan03/androidx/browser/ktx/enums/ActivitySide
public synthetic fun fromValueOrNull (Ljava/lang/Object;)Ljava/lang/Enum;
}

public final class io/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetPosition : java/lang/Enum {
public final class io/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetPosition : java/lang/Enum, io/github/edricchan03/androidx/common/enums/ValueEnum {
public static final field Companion Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetPosition$Companion;
public static final field Default Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetPosition;
public static final field End Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetPosition;
public static final field Start Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetPosition;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public fun getValue ()Ljava/lang/Integer;
public synthetic fun getValue ()Ljava/lang/Object;
public static fun valueOf (Ljava/lang/String;)Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetPosition;
public static fun values ()[Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetPosition;
}
Expand All @@ -137,13 +140,14 @@ public final class io/github/edricchan03/androidx/browser/ktx/enums/ActivitySide
public synthetic fun fromValueOrNull (Ljava/lang/Object;)Ljava/lang/Enum;
}

public final class io/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetRoundedCornersPosition : java/lang/Enum {
public final class io/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetRoundedCornersPosition : java/lang/Enum, io/github/edricchan03/androidx/common/enums/ValueEnum {
public static final field Companion Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetRoundedCornersPosition$Companion;
public static final field Default Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetRoundedCornersPosition;
public static final field None Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetRoundedCornersPosition;
public static final field Top Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetRoundedCornersPosition;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public fun getValue ()Ljava/lang/Integer;
public synthetic fun getValue ()Ljava/lang/Object;
public static fun valueOf (Ljava/lang/String;)Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetRoundedCornersPosition;
public static fun values ()[Lio/github/edricchan03/androidx/browser/ktx/enums/ActivitySideSheetRoundedCornersPosition;
}
Expand All @@ -153,13 +157,14 @@ public final class io/github/edricchan03/androidx/browser/ktx/enums/ActivitySide
public synthetic fun fromValueOrNull (Ljava/lang/Object;)Ljava/lang/Enum;
}

public final class io/github/edricchan03/androidx/browser/ktx/enums/CloseButtonPosition : java/lang/Enum {
public final class io/github/edricchan03/androidx/browser/ktx/enums/CloseButtonPosition : java/lang/Enum, io/github/edricchan03/androidx/common/enums/ValueEnum {
public static final field Companion Lio/github/edricchan03/androidx/browser/ktx/enums/CloseButtonPosition$Companion;
public static final field Default Lio/github/edricchan03/androidx/browser/ktx/enums/CloseButtonPosition;
public static final field End Lio/github/edricchan03/androidx/browser/ktx/enums/CloseButtonPosition;
public static final field Start Lio/github/edricchan03/androidx/browser/ktx/enums/CloseButtonPosition;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public fun getValue ()Ljava/lang/Integer;
public synthetic fun getValue ()Ljava/lang/Object;
public static fun valueOf (Ljava/lang/String;)Lio/github/edricchan03/androidx/browser/ktx/enums/CloseButtonPosition;
public static fun values ()[Lio/github/edricchan03/androidx/browser/ktx/enums/CloseButtonPosition;
}
Expand All @@ -169,13 +174,14 @@ public final class io/github/edricchan03/androidx/browser/ktx/enums/CloseButtonP
public synthetic fun fromValueOrNull (Ljava/lang/Object;)Ljava/lang/Enum;
}

public final class io/github/edricchan03/androidx/browser/ktx/enums/ColorScheme : java/lang/Enum {
public final class io/github/edricchan03/androidx/browser/ktx/enums/ColorScheme : java/lang/Enum, io/github/edricchan03/androidx/common/enums/ValueEnum {
public static final field Companion Lio/github/edricchan03/androidx/browser/ktx/enums/ColorScheme$Companion;
public static final field Dark Lio/github/edricchan03/androidx/browser/ktx/enums/ColorScheme;
public static final field Light Lio/github/edricchan03/androidx/browser/ktx/enums/ColorScheme;
public static final field System Lio/github/edricchan03/androidx/browser/ktx/enums/ColorScheme;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public fun getValue ()Ljava/lang/Integer;
public synthetic fun getValue ()Ljava/lang/Object;
public static fun valueOf (Ljava/lang/String;)Lio/github/edricchan03/androidx/browser/ktx/enums/ColorScheme;
public static fun values ()[Lio/github/edricchan03/androidx/browser/ktx/enums/ColorScheme;
}
Expand All @@ -185,13 +191,14 @@ public final class io/github/edricchan03/androidx/browser/ktx/enums/ColorScheme$
public synthetic fun fromValueOrNull (Ljava/lang/Object;)Ljava/lang/Enum;
}

public final class io/github/edricchan03/androidx/browser/ktx/enums/ShareState : java/lang/Enum {
public final class io/github/edricchan03/androidx/browser/ktx/enums/ShareState : java/lang/Enum, io/github/edricchan03/androidx/common/enums/ValueEnum {
public static final field Companion Lio/github/edricchan03/androidx/browser/ktx/enums/ShareState$Companion;
public static final field Default Lio/github/edricchan03/androidx/browser/ktx/enums/ShareState;
public static final field Off Lio/github/edricchan03/androidx/browser/ktx/enums/ShareState;
public static final field On Lio/github/edricchan03/androidx/browser/ktx/enums/ShareState;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public fun getValue ()Ljava/lang/Integer;
public synthetic fun getValue ()Ljava/lang/Object;
public static fun valueOf (Ljava/lang/String;)Lio/github/edricchan03/androidx/browser/ktx/enums/ShareState;
public static fun values ()[Lio/github/edricchan03/androidx/browser/ktx/enums/ShareState;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.github.edricchan03.androidx.browser.ktx.enums

import androidx.browser.customtabs.CustomTabsIntent
import io.github.edricchan03.androidx.common.enums.EnumFromValue
import io.github.edricchan03.androidx.common.enums.ValueEnum

/**
* Sets the resize behaviour for the custom tab activity.
Expand All @@ -18,13 +19,15 @@ import io.github.edricchan03.androidx.common.enums.EnumFromValue
*
* @property value The numerical representation.
*
* From version 0.3.0, this enum class implements the [ValueEnum] interface, which
* contains the [ValueEnum.value] property.
* @since 0.0.1
* @see io.github.edricchan03.androidx.browser.ktx.setInitialActivityHeightPx
* @see CustomTabsIntent.Builder.setInitialActivityHeightPx
*/
public enum class ActivityHeightResizeBehavior(
@CustomTabsIntent.ActivityHeightResizeBehavior public val value: Int
) {
@CustomTabsIntent.ActivityHeightResizeBehavior public override val value: Int
) : ValueEnum<Int> {
/**
* Applies the default height resize behavior for the Custom Tab Activity
* when it behaves as a bottom sheet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.github.edricchan03.androidx.browser.ktx.enums

import androidx.browser.customtabs.CustomTabsIntent
import io.github.edricchan03.androidx.common.enums.EnumFromValue
import io.github.edricchan03.androidx.common.enums.ValueEnum

/**
* The type of the decoration that will be used to separate the side sheet from the
Expand All @@ -20,15 +21,17 @@ import io.github.edricchan03.androidx.common.enums.EnumFromValue
*
* @property value The numerical representation.
*
* From version 0.3.0, this enum class implements the [ValueEnum] interface, which
* contains the [ValueEnum.value] property.
* @since 0.3.0
* @see CustomTabsIntent.EXTRA_ACTIVITY_SIDE_SHEET_DECORATION_TYPE
* @see CustomTabsIntent.Builder.setActivitySideSheetDecorationType
* @see io.github.edricchan03.androidx.browser.ktx.setActivitySideSheetDecorationType
* @see io.github.edricchan03.androidx.browser.ktx.activitySideSheetDecorationType
*/
public enum class ActivitySideSheetDecorationType(
@CustomTabsIntent.ActivitySideSheetDecorationType public val value: Int
) {
@CustomTabsIntent.ActivitySideSheetDecorationType public override val value: Int
) : ValueEnum<Int> {
/**
* Side sheet's default decoration type.
* Same as [Shadow].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.github.edricchan03.androidx.browser.ktx.enums

import androidx.browser.customtabs.CustomTabsIntent
import io.github.edricchan03.androidx.common.enums.EnumFromValue
import io.github.edricchan03.androidx.common.enums.ValueEnum

/**
* Specifies the position of the side sheet.
Expand All @@ -18,15 +19,17 @@ import io.github.edricchan03.androidx.common.enums.EnumFromValue
*
* @property value The numerical representation.
*
* From version 0.3.0, this enum class implements the [ValueEnum] interface, which
* contains the [ValueEnum.value] property.
* @since 0.3.0
* @see CustomTabsIntent.EXTRA_ACTIVITY_SIDE_SHEET_POSITION
* @see CustomTabsIntent.Builder.setActivitySideSheetPosition
* @see io.github.edricchan03.androidx.browser.ktx.setActivitySideSheetPosition
* @see io.github.edricchan03.androidx.browser.ktx.activitySideSheetPosition
*/
public enum class ActivitySideSheetPosition(
@CustomTabsIntent.ActivitySideSheetPosition public val value: Int
) {
@CustomTabsIntent.ActivitySideSheetPosition public override val value: Int
) : ValueEnum<Int> {
/**
* Applies the default position for the Custom Tab Activity when it behaves as a side sheet.
* Same as [End].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.github.edricchan03.androidx.browser.ktx.enums

import androidx.browser.customtabs.CustomTabsIntent
import io.github.edricchan03.androidx.common.enums.EnumFromValue
import io.github.edricchan03.androidx.common.enums.ValueEnum

/**
* The type of rounded corners that will be used for the side sheet.
Expand All @@ -18,14 +19,16 @@ import io.github.edricchan03.androidx.common.enums.EnumFromValue
*
* @property value The numerical representation.
*
* From version 0.3.0, this enum class implements the [ValueEnum] interface, which
* contains the [ValueEnum.value] property.
* @since 0.3.0
* @see io.github.edricchan03.androidx.browser.ktx.activitySideSheetRoundedCornersPosition
* @see io.github.edricchan03.androidx.browser.ktx.setActivitySideSheetRoundedCornersPosition
* @see CustomTabsIntent.Builder.setActivitySideSheetRoundedCornersPosition
*/
public enum class ActivitySideSheetRoundedCornersPosition(
@CustomTabsIntent.ActivitySideSheetRoundedCornersPosition public val value: Int
) {
@CustomTabsIntent.ActivitySideSheetRoundedCornersPosition public override val value: Int
) : ValueEnum<Int> {
/**
* Side sheet's default rounded corner configuration.
* Same as [None].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.github.edricchan03.androidx.browser.ktx.enums

import androidx.browser.customtabs.CustomTabsIntent
import io.github.edricchan03.androidx.common.enums.EnumFromValue
import io.github.edricchan03.androidx.common.enums.ValueEnum

/**
* The position of the close button.
Expand All @@ -18,13 +19,15 @@ import io.github.edricchan03.androidx.common.enums.EnumFromValue
*
* @property value The numerical representation.
*
* From version 0.3.0, this enum class implements the [ValueEnum] interface, which
* contains the [ValueEnum.value] property.
* @since 0.0.1
* @see io.github.edricchan03.androidx.browser.ktx.setCloseButtonPosition
* @see CustomTabsIntent.Builder.setCloseButtonPosition
*/
public enum class CloseButtonPosition(
@CustomTabsIntent.CloseButtonPosition public val value: Int
) {
@CustomTabsIntent.CloseButtonPosition public override val value: Int
) : ValueEnum<Int> {
/**
* Same as [CloseButtonPosition.Start].
* @since 0.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.github.edricchan03.androidx.browser.ktx.enums

import androidx.browser.customtabs.CustomTabsIntent
import io.github.edricchan03.androidx.common.enums.EnumFromValue
import io.github.edricchan03.androidx.common.enums.ValueEnum

/**
* The colour scheme to use.
Expand All @@ -18,13 +19,15 @@ import io.github.edricchan03.androidx.common.enums.EnumFromValue
*
* @property value The numerical representation.
*
* From version 0.3.0, this enum class implements the [ValueEnum] interface, which
* contains the [ValueEnum.value] property.
* @since 0.0.1
* @see io.github.edricchan03.androidx.browser.ktx.setColorScheme
* @see CustomTabsIntent.Builder.setColorScheme
*/
public enum class ColorScheme(
@CustomTabsIntent.ColorScheme public val value: Int
) {
@CustomTabsIntent.ColorScheme public override val value: Int
) : ValueEnum<Int> {
/**
* Applies either a light or dark colour scheme to the user interface in
* the custom tab depending on the user's system settings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.github.edricchan03.androidx.browser.ktx.enums

import androidx.browser.customtabs.CustomTabsIntent
import io.github.edricchan03.androidx.common.enums.EnumFromValue
import io.github.edricchan03.androidx.common.enums.ValueEnum

/**
* The share state to use.
Expand All @@ -18,13 +19,15 @@ import io.github.edricchan03.androidx.common.enums.EnumFromValue
*
* @property value The numerical representation.
*
* From version 0.3.0, this enum class implements the [ValueEnum] interface, which
* contains the [ValueEnum.value] property.
* @since 0.0.1
* @see io.github.edricchan03.androidx.browser.ktx.setShareState
* @see CustomTabsIntent.Builder.setShareState
*/
public enum class ShareState(
@CustomTabsIntent.ShareState public val value: Int
) {
@CustomTabsIntent.ShareState public override val value: Int
) : ValueEnum<Int> {
/**
* Applies the default share settings depending on the browser.
* @since 0.0.1
Expand Down

0 comments on commit d82c4e1

Please sign in to comment.