SplitPairFilter


class SplitPairFilter


Filter for SplitPairRule and used to find if a pair of activities should be put in a split. It is used when a new activity is started from the primary activity. If the filter matches the primary Activity.getComponentName and the new started activity Intent, it matches the SplitPairRule that holds this filter.

Summary

Public constructors

SplitPairFilter(
    primaryActivityName: ComponentName,
    secondaryActivityName: ComponentName,
    secondaryActivityIntentAction: String?
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
Boolean
matchesActivityIntentPair(
    primaryActivity: Activity,
    secondaryActivityIntent: Intent
)

Returns true if this SplitPairFilter matches the primaryActivity and the secondaryActivityIntent If the SplitPairFilter is created with secondaryActivityIntentAction, the filter will also compare it with Intent.getAction of the secondaryActivityIntent.

Boolean
matchesActivityPair(
    primaryActivity: Activity,
    secondaryActivity: Activity
)

Returns true if this SplitPairFilter matches primaryActivity and secondaryActivity.

open String

Public constructors

SplitPairFilter

Added in 1.0.0
SplitPairFilter(
    primaryActivityName: ComponentName,
    secondaryActivityName: ComponentName,
    secondaryActivityIntentAction: String?
)
Parameters
primaryActivityName: ComponentName

Component name of the primary activity in the split. Must be non-empty. Can contain a single wildcard at the end. Supported formats:

  • package/class

  • package/*

  • package/suffix.*

  • */*

secondaryActivityName: ComponentName

Component name of the secondary activity in the split. Must be non-empty. Can contain a single wildcard at the end. Supported formats:

  • package/class

  • package/*

  • package/suffix.*

  • */*

secondaryActivityIntentAction: String?

action used for secondary activity launch Intent. If it is not null, the SplitPairFilter will check the activity Intent.getAction besides the component name. If it is null, Intent.getAction will be ignored.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

matchesActivityIntentPair

Added in 1.0.0
fun matchesActivityIntentPair(
    primaryActivity: Activity,
    secondaryActivityIntent: Intent
): Boolean

Returns true if this SplitPairFilter matches the primaryActivity and the secondaryActivityIntent If the SplitPairFilter is created with secondaryActivityIntentAction, the filter will also compare it with Intent.getAction of the secondaryActivityIntent.

Parameters
primaryActivity: Activity

the Activity to test against with the primaryActivityName

secondaryActivityIntent: Intent

the Intent to test against with the secondaryActivityName

matchesActivityPair

Added in 1.0.0
fun matchesActivityPair(
    primaryActivity: Activity,
    secondaryActivity: Activity
): Boolean

Returns true if this SplitPairFilter matches primaryActivity and secondaryActivity. If the SplitPairFilter is created with secondaryActivityIntentAction, the filter will also compare it with Intent.getAction of Activity.getIntent of secondaryActivity.

Parameters
primaryActivity: Activity

the Activity to test against with the primaryActivityName

secondaryActivity: Activity

the Activity to test against with the secondaryActivityName

toString

open fun toString(): String

Public properties

primaryActivityName

Added in 1.0.0
val primaryActivityNameComponentName

secondaryActivityIntentAction

Added in 1.0.0
val secondaryActivityIntentActionString?

secondaryActivityName

Added in 1.0.0
val secondaryActivityNameComponentName