Telerik-Verified-Plugins / NativePageTransitions

Native transitions like Slide and Flip for iOS, Android and Windows Phone
277 stars 107 forks source link

Android: so slow screenshot? #122

Open KODerFunk opened 8 years ago

KODerFunk commented 8 years ago
function prepareSlide(direction, callback) {
  var options = {
    "direction"        : direction, // 'left' or 'right'
    "iosdelay"         :   -1, 
    "androiddelay"     :   -1
  };
  console.log('PREPARESLIDE GO!', options);
  window.plugins.nativepagetransitions.slide(
    options,
    function () { console.log('PREPARESLIDE DONE'); callback(); }, // NOT FIRED
    function (msg) {console.error("!!! slide !!! error: " + msg)} // NOT FIRED
  );
}

function startSlide() {
  window.plugins.nativepagetransitions.executePendingTransition(
    function (msg) {console.info("!!! executePendingTransition !!! success: " + msg)},  // FIRED
    function (msg) {console.error("!!! executePendingTransition !!! error: " + msg)}
  );
}

Works well on iOS and bad on Android. This may be due to the fact that startSlide() is executed earlier than the callback?

EddyVerbruggen commented 8 years ago

What's in your console? I'm not sure which callbacks you're referring to.

KODerFunk commented 8 years ago

I used something like a promises and organized asynchronous rendering life cycle in my application when changing react route. Now i have correct callbacks chain. All fired. Just at the beginning of issue have asynchronous problems on android, slowly makes its first phase (a screenshot of disappearing screen). I want to achieve maximum fast jumping by callbacks. But when doing back (right animation), have a glitch, old page-component is visible a few milliseconds. Using his time-out in the 50-100 ms saves but very slow reaction to the mainstream Android-smartphones. Really it is only in this way? It can not be done more responsive?