java - Android: speeding up shared element transition between activities -


i have shared element transition between 2 activities works in following way:

intent someintent = new intent(this, someclass.class);          if (build.version.sdk_int >= 21) {              activityoptions options = activityoptions.makescenetransitionanimation(this                     , new pair<>(viewclicked.findviewbyid(r.id.someimage), "someimage")                     , new pair<>(viewclicked.findviewbyid(r.id.someicon), "someicon")             );             startactivity(someintent, options.tobundle());         }         else {             startactivity(someintent);         } 

this works fine, transition agonisingly slow. when image first clicked on seems stall second or 2 before transition takes place. due "weight" of activity being loaded or delay configurable?

did try change duration of entertransition , returntransition:

    private transition entertransition() {         changebounds bounds = new changebounds();         bounds.setduration(2000);          return bounds;     }      private transition returntransition() {         changebounds bounds = new changebounds();         bounds.setinterpolator(new decelerateinterpolator());         bounds.setduration(2000);          return bounds;     } 

and in oncreate:

getwindow().setsharedelemententertransition(entertransition()); getwindow().setsharedelementreturntransition(returntransition()); 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -