Android Daydream not properly reading rotation -
I have an animation that is dreaming while scrolling an ImageView layer and I want to scroll it in the thin side of the screen ( I.e. on the 720 × 1280 x 720 screen) I get a display variable which is in the display landscape rotation. Sometimes it does not respond right and it will scroll on the wrong axis. I have tried to solve this issue in several ways, the image view is running, including dragging the dimensions of the frame, it still randomly makes the width and height mistake It seems almost like if the screen was spent properly this axis posts were put (in the scenario X is still the least side and y is the longest). Kilter is properly and I do not understand why.
Private Wide Initiative Album ArtScroll () {albumArtwork.setX (0); AlbumArtwork.setY (0); MAnimator = albumArtwork.animate (). X (0) .y (0) .setDuration (1) .setStartDelay (0) .setInterpolator (sInterpolator) .withEndAction (New Runnable) {@Override Public Zero Run () {if (inPortrait) {Log.i (TAg , "Scroll Portrait"); startAlbumArtLeftScroll ();} else {Log.i (TAG, "Scroll Landscape"); startAlbumArtUpScroll ();}}}); // start animation mnimator.start; Left * / Private Zero startAlbumArtLeftScroll () {albumArtwork.setX (0) to the right of the screen} / ** * Album art book albumArtwork.setY (0); MAnimator = albumArtwork.animate () .x (-albumArtwork.getWidth) + screenwidth). (0) .setDuration .setStartDelay (500) .setInterpolator (sInterpolator) .withAndAction (New Runnabal) {@Override Public Zero Run () {startAlbumArtRightScroll ();}}); // start animation mnimator.start; } DaydreamFrame.addOnLayoutChangeListener (new view onLayoutChangeListener) {@Override Layer Change on Public Zero (see V, Int Left, Ent Top, Intra Rights, Int short, Int Old Left, Int OldTop, Int Old Record, Int Old Bottle) {If ((Display .getRotation () == Surface.ROTATION_0 || display.getRotation () == Surface.ROTATION_180) & amp;; inPortrait} {Log.i (TAG, "now in the picture") ;! If (mAnimator = null) {MAnimator.cancel ();} Portport = true; Initialize album ArtScroll ();} and if ((display.getRotation () == surface .ROTATION_270 || display.getRotation () == surface .ROTATION_90) & amp; amp; amp; {Log.i (TAG, "Now In the scenario "); if (monititor! = Null) {mAnimator.cancel ();} InPortrait = false; initializeAlbumArtScroll ();}}});
Comments
Post a Comment