@Override public void onMapSharedElements(List<String> names,Map<String,View> sharedElements){
  if (sharedElements.size() != names.size()) {
    final View sharedShot=sharedElements.get(shotTransitionName);
    if (sharedShot != null) {
      sharedElements.put(shotBackgroundTransitionName,sharedShot);
    }
  }
}

@ Override public void onMapSharedElements ( List < String > names , Map < String , View > sharedElements ) { if ( sharedElements . size ( ) != names . size ( ) ) { final View sharedShot = sharedElements . get ( shotTransitionName ) ; if ( sharedShot != null ) { sharedElements . put ( shotBackgroundTransitionName , sharedShot ) ; } } }
we ' re performing a slightly unusual shared element transition i . e . from one view ( image in the grid ) to two views ( the image & also the background of the details view , to produce the expand effect ) . after changing orientation , the transition system seems unable to map both shared elements ( only seems to map the shot , not the background ) so in this situation we manually map the background to the same view .
