2
I’m trying to make a transition effect when I open a DialogFragment
but for that I need the photo(CircleImageView
) of DialogFragment
is in the same place as the photo of Activity
which opens it. If it is not clear I will explain with the images:
This is the image I want to use as a positioning base for the other DialogFragment
. Clicking on this photo opens an DialogFragment
with this screen:
Disregard the buttons, my focus is just the image. How do I position this image in exactly the same place as the other programmatically?
First I thought: if the second image has a white background, why doesn’t it create an image the size of the first one with a white background? Then I thought: how to ensure that the first image will always be in the same place depending on the various screen resolutions between the devices?
– Reginaldo Rigo
Exactly, I could not recreate the same layout because the first is a header of a Drawerlayout and would not end up in the same proportions.
– Bruno Romualdo
This link shows you how to position the image. I don’t know how to guarantee that the first image will always be in the same place. http://stackoverflow.com/questions/6418726/android-setting-x-y-of-image-programmatically http://stackoverflow.com/questions/6535648/how-can-i-dynamically-set-the-position-of-view-in-android http:///stackoverf.com/questions/19328756/set-position-programmatically-created-imageview-android
– Reginaldo Rigo
First you would have to center according to the device, so that in the
fragment
remain centralized.– viana
I want to position the second photo according to the first and not the other way around.
– Bruno Romualdo
@Brunoromualdo then, try to position your photo inside a
LinearLayout
, then you use thisLinear
in hisfragment
.– viana
Just understand that there is no way to put the two in the same position using xml, so at the end of the question is written programmatically.
– Bruno Romualdo