android - Lollipop transitions - Fragment to Activity -


i trying figure out how activity(or fragment??) transitions in lollipop. using appcompat v7 - v21.

here scenario:

enter image description here

when item in gridview(inside fragment) clicked, wish image make transition in link here. how achieve it? , there way can using styles? , if through code, can have sample of how fragment activity?

[edit]

this achieved till now:

styles.xml: values-v21

<?xml version="1.0" encoding="utf-8"?> <resources>      <style name="appbasetheme" parent="theme.appcompat.light.darkactionbar">          <!-- api 21 theme customizations can go here. -->         <item name="windowactionbar">false</item>         <item name="android:colorprimary">@color/dark_grey</item>         <item name="android:colorprimarydark">@color/dark_grey</item>         <item name="android:coloraccent">@color/dark_grey</item>         <item name="android:colorcontrolnormal">@color/white</item>          <!-- enable window content transitions -->         <item name="android:windowcontenttransitions">true</item>         <item name="android:windowallowentertransitionoverlap">true</item>         <item name="android:windowallowreturntransitionoverlap">true</item>         <item name="android:windowsharedelemententertransition">@android:transition/move</item>         <item name="android:windowsharedelementexittransition">@android:transition/move</item>     </style>  </resources> 

onitemclick() in mainactivity:

    intent = new intent(this, detailactivity.class);     i.putextra("url", url);     i.putextra("twopane", false);     i.putextra("title", title);     i.putextra("imageurl", imageurl);     // startactivity(i);      activityoptionscompat options = activityoptionscompat             .makescenetransitionanimation(this,                     v.findviewbyid(r.id.item_imageview), imageurl);     activitycompat.startactivity(this, i, options.tobundle()); 

in detailactivity:

    imageview = (squareimageview) findviewbyid(r.id.imageview_detail);     viewcompat.settransitionname(imageview, imageurl);     imageview.setimageurl(imageurl, imagecachemanager.getinstance()             .getimageloader());          getwindow().getentertransition().addlistener(new transitionlistener() {             @override             public void ontransitionend(transition transition) {                  if (const.debugging_int)                     log.d(const.debug, "ontransitionend");                  //fadeoutandhideimage(imageview);                  if (mdetailfragment == null)                     mdetailfragment = new detailfragment();                 getsupportfragmentmanager()                         .begintransaction()                         .replace(r.id.detail_fragment_container,                                 mdetailfragment).commit();                  mdetailfragment.setparameters(bundle);              } } 

this giving me transition, but, transition not smooth enough expected. still working on it.

can these transitions in pre-lollipop devices? when try run code in lower versions, ex., 2.3.6, crashes , says, nosuchmethoddef getentertransition() . these transitions related lollipop?


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -