3

I am having a small problem using Shared Element Transition for Android fragments. I am trying to move a TextView between two fragments. I manage to get it successfully to transition, however, the Textview android:gravity seems to stick when I try to return to the source fragment. In the source fragment, the textview gravity is defined as:

android:gravity="end"

Whereas in the target fragment, whe textview gravity is defined as:

android:gravity="center"

When I go from the source to the destination fragment, everything works fine. However, when I hit the back button, the shared textview moves to the center location instead.

Can someone please advise? Thanks.

The transition is defined as:

<?xml version="1.0" encoding="utf-8"?>

<transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
<changeTransform/>
<changeBounds/>
</transitionSet>
AndroidP
  • 751
  • 1
  • 10
  • 19

1 Answers1

1

Nevermind! Figured it out. I wrapped the textview in a horizontal linear layout. The textview's width and height set to "wrap_content".

AndroidP
  • 751
  • 1
  • 10
  • 19