0

I have a transitionSet and I want to set an order in which the views will be animated, but I don't find any example on how to use matchOrder correctly.

<transitionSet xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:interpolator/linear_out_slow_in"
    android:duration="800"
    android:transitionOrdering="together">

    <fade></fade>

    <slide android:slideEdge="top" android:matchOrder="?????">
    </slide>

</transitionSet>

I always receive this RuntimeException:

Unknown match type in matchOrder
manfcas
  • 1,933
  • 7
  • 28
  • 47
Victor
  • 1,818
  • 13
  • 16

2 Answers2

1

Martins response is technically correct but fails to answer the question directly. The documentation here is particularly unclear due to lack of emphasis. It seems that it wants you to use the camel case for the field. MATCH_INSTANCE, MATCH_NAME, MATCH_ITEM_ID, and MATCH_ID. map to instance, name, itemId, id as string values.

So for your example you would put

<slide android:slideEdge="top" android:matchOrder="itemId"/>
Travis Castillo
  • 1,807
  • 1
  • 20
  • 23
0

Perhaps you can take a look at the Android Documentation for that XML attribute.

The match order to use for the transition. This is a comma-separated list of values, containing one or more of the following: id, itemId, name, instance. These correspond to MATCH_ID, MATCH_ITEM_ID, MATCH_NAME, and MATCH_INSTANCE, respectively. This corresponds to setMatchOrder(int).

Must be a string value, using '\;' to escape characters such as '\n' or '\uxxxx' for a unicode character.

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.

Community
  • 1
  • 1
Martin Marconcini
  • 26,875
  • 19
  • 106
  • 144