Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c356ad4c authored by Miranda Kephart's avatar Miranda Kephart
Browse files

Revert "Fix shared transition offsets in landscape"

This reverts commit 455fa761.

Reason for revert: Obsolete now that the offset issue is fixed in the framework

Bug:190757843

Change-Id: I47dedda772d4b62dbf134f9ea5cc9293b27cb277
parent b628c937
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -130,13 +130,4 @@
        app:layout_constraintStart_toStartOf="@id/screenshot_preview"
        app:layout_constraintTop_toTopOf="@id/screenshot_preview"
        android:elevation="@dimen/screenshot_preview_elevation"/>
    <View
        android:id="@+id/screenshot_transition_view"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:visibility="invisible"
        app:layout_constraintStart_toStartOf="@id/screenshot_preview"
        app:layout_constraintTop_toTopOf="@id/screenshot_preview"
        app:layout_constraintEnd_toEndOf="@id/screenshot_preview"
        app:layout_constraintBottom_toBottomOf="@id/screenshot_preview"/>
</androidx.constraintlayout.widget.ConstraintLayout>
+1 −8
Original line number Diff line number Diff line
@@ -326,18 +326,11 @@ public class LongScreenshotActivity extends Activity {
                | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);

        mTransitionView.setImageBitmap(mOutputBitmap);
        mTransitionView.setVisibility(View.VISIBLE);
        mTransitionView.setTransitionName(
                ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME);
        // TODO: listen for transition completing instead of finishing onStop
        mTransitionStarted = true;
        int[] locationOnScreen = new int[2];
        mTransitionView.getLocationOnScreen(locationOnScreen);
        int[] locationInWindow = new int[2];
        mTransitionView.getLocationInWindow(locationInWindow);
        int deltaX = locationOnScreen[0] - locationInWindow[0];
        int deltaY = locationOnScreen[1] - locationInWindow[1];
        mTransitionView.setX(mTransitionView.getX() - deltaX);
        mTransitionView.setY(mTransitionView.getY() - deltaY);
        startActivity(intent,
                ActivityOptions.makeSceneTransitionAnimation(this, mTransitionView,
                        ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME).toBundle());
+1 −3
Original line number Diff line number Diff line
@@ -940,12 +940,10 @@ public class ScreenshotController {
     */
    private Supplier<ActionTransition> getActionTransitionSupplier() {
        return () -> {
            View preview = mScreenshotView.getTransitionView();
            preview.setX(preview.getX() - mScreenshotView.getStaticLeftMargin());
            Pair<ActivityOptions, ExitTransitionCoordinator> transition =
                    ActivityOptions.startSharedElementAnimation(
                            mWindow, new ScreenshotExitTransitionCallbacksSupplier(true).get(),
                            null, Pair.create(mScreenshotView.getTransitionView(),
                            null, Pair.create(mScreenshotView.getScreenshotPreview(),
                                    ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME));
            transition.second.startExit();

+3 −10
Original line number Diff line number Diff line
@@ -137,13 +137,11 @@ public class ScreenshotView extends FrameLayout implements
    private int mNavMode;
    private boolean mOrientationPortrait;
    private boolean mDirectionLTR;
    private int mStaticLeftMargin;

    private ScreenshotSelectorView mScreenshotSelectorView;
    private ImageView mScrollingScrim;
    private View mScreenshotStatic;
    private ImageView mScreenshotPreview;
    private View mTransitionView;
    private View mScreenshotPreviewBorder;
    private ImageView mScrollablePreview;
    private ImageView mScreenshotFlash;
@@ -341,7 +339,7 @@ public class ScreenshotView extends FrameLayout implements
        mScrollingScrim = requireNonNull(findViewById(R.id.screenshot_scrolling_scrim));
        mScreenshotStatic = requireNonNull(findViewById(R.id.screenshot_static));
        mScreenshotPreview = requireNonNull(findViewById(R.id.screenshot_preview));
        mTransitionView = requireNonNull(findViewById(R.id.screenshot_transition_view));

        mScreenshotPreviewBorder = requireNonNull(
                findViewById(R.id.screenshot_preview_border));
        mScreenshotPreview.setClipToOutline(true);
@@ -387,12 +385,8 @@ public class ScreenshotView extends FrameLayout implements
        requestFocus();
    }

    View getTransitionView() {
        return mTransitionView;
    }

    int getStaticLeftMargin() {
        return mStaticLeftMargin;
    View getScreenshotPreview() {
        return mScreenshotPreview;
    }

    /**
@@ -442,7 +436,6 @@ public class ScreenshotView extends FrameLayout implements
                        Math.max(navBarInsets.bottom, waterfall.bottom));
            }
        }
        mStaticLeftMargin = p.leftMargin;
        mScreenshotStatic.setLayoutParams(p);
        mScreenshotStatic.requestLayout();
    }