Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 426a7689 authored by George Mount's avatar George Mount Committed by Android (Google) Code Review
Browse files

Merge "Make more descriptive exception for null viewName."

parents e089d061 d5f9d735
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -394,8 +394,18 @@ public class ActivityOptions {
        if (sharedElements != null) {
            for (int i = 0; i < sharedElements.length; i++) {
                Pair<View, String> sharedElement = sharedElements[i];
                names.add(sharedElement.second);
                mappedNames.add(sharedElement.first.getViewName());
                String sharedElementName = sharedElement.second;
                if (sharedElementName == null) {
                    throw new IllegalArgumentException("Shared element name must not be null");
                }
                String viewName = sharedElement.first.getViewName();
                if (viewName == null) {
                    throw new IllegalArgumentException("Shared elements must have non-null " +
                            "viewNames");
                }

                names.add(sharedElementName);
                mappedNames.add(viewName);
            }
        }

+4 −0
Original line number Diff line number Diff line
@@ -347,6 +347,10 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
                String name = mAllSharedElementNames.get(i);
                View sharedElement = sharedElements.get(name);
                if (sharedElement != null) {
                    if (sharedElement.getViewName() == null) {
                        throw new IllegalArgumentException("Shared elements must have " +
                                "non-null viewNames");
                    }
                    mSharedElementNames.add(name);
                    mSharedElements.add(sharedElement);
                }