Visibility events not working when using Animation with shared element transition
up vote
-1
down vote
favorite
I want to implement an animation where there is an ImageView rotating animation and after finishing it, want to start a new activity with shared element transition.
This is the following code i've done
Animation animation = AnimationUtils.loadAnimation(this, R.anim.rotate);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
Log.e("Animation", "Start");
}
@Override
public void onAnimationEnd(Animation animation) {
companyLogo.clearAnimation();
isFinished = true;
Intent intent = new Intent(SplashscreenActivity.this, LoginActivity.class);
ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(SplashscreenActivity.this,
companyLogo, ViewCompat.getTransitionName(companyLogo));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
startActivity(intent, optionsCompat.toBundle());
}
else {
startActivity(intent);
}
}
@Override
public void onAnimationRepeat(Animation animation) {
Log.e("Animation", "Repeat");
}
});
companyLogo.startAnimation(animation);
The problem occures when in the Login activity.
In login activity, i've 3 buttons and on click, i show a particular view for the same but it is not working with animation. When i remove the animation and load the same, it works.
This is the code for button click
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
create_with_email_btn = findViewById(R.id.create_with_email_btn);
create_with_email_btn.setOnClickListener(this);
callbackManager = CallbackManager.Factory.create();
}
public void onClick(View v) {
switch (v.getId()){
case R.id.create_with_email_btn:
isLogin = true;
login_type_layout.setVisibility(View.GONE);
create_with_email_layout.setVisibility(View.VISIBLE);
break;
}
}
The visibility events are not working when using shared element transition with animation. Without it, it works fine.


add a comment |
up vote
-1
down vote
favorite
I want to implement an animation where there is an ImageView rotating animation and after finishing it, want to start a new activity with shared element transition.
This is the following code i've done
Animation animation = AnimationUtils.loadAnimation(this, R.anim.rotate);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
Log.e("Animation", "Start");
}
@Override
public void onAnimationEnd(Animation animation) {
companyLogo.clearAnimation();
isFinished = true;
Intent intent = new Intent(SplashscreenActivity.this, LoginActivity.class);
ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(SplashscreenActivity.this,
companyLogo, ViewCompat.getTransitionName(companyLogo));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
startActivity(intent, optionsCompat.toBundle());
}
else {
startActivity(intent);
}
}
@Override
public void onAnimationRepeat(Animation animation) {
Log.e("Animation", "Repeat");
}
});
companyLogo.startAnimation(animation);
The problem occures when in the Login activity.
In login activity, i've 3 buttons and on click, i show a particular view for the same but it is not working with animation. When i remove the animation and load the same, it works.
This is the code for button click
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
create_with_email_btn = findViewById(R.id.create_with_email_btn);
create_with_email_btn.setOnClickListener(this);
callbackManager = CallbackManager.Factory.create();
}
public void onClick(View v) {
switch (v.getId()){
case R.id.create_with_email_btn:
isLogin = true;
login_type_layout.setVisibility(View.GONE);
create_with_email_layout.setVisibility(View.VISIBLE);
break;
}
}
The visibility events are not working when using shared element transition with animation. Without it, it works fine.


1
Please post your code. What you have already achieved.
– webianks
6 hours ago
Possible duplicate of Animate ImageView between two activities using shared element transitions with ChangeImageTransform
– Jantzilla
5 hours ago
@webianks Please check the same, i've updated the question.
– Saikiran Bait
4 hours ago
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I want to implement an animation where there is an ImageView rotating animation and after finishing it, want to start a new activity with shared element transition.
This is the following code i've done
Animation animation = AnimationUtils.loadAnimation(this, R.anim.rotate);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
Log.e("Animation", "Start");
}
@Override
public void onAnimationEnd(Animation animation) {
companyLogo.clearAnimation();
isFinished = true;
Intent intent = new Intent(SplashscreenActivity.this, LoginActivity.class);
ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(SplashscreenActivity.this,
companyLogo, ViewCompat.getTransitionName(companyLogo));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
startActivity(intent, optionsCompat.toBundle());
}
else {
startActivity(intent);
}
}
@Override
public void onAnimationRepeat(Animation animation) {
Log.e("Animation", "Repeat");
}
});
companyLogo.startAnimation(animation);
The problem occures when in the Login activity.
In login activity, i've 3 buttons and on click, i show a particular view for the same but it is not working with animation. When i remove the animation and load the same, it works.
This is the code for button click
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
create_with_email_btn = findViewById(R.id.create_with_email_btn);
create_with_email_btn.setOnClickListener(this);
callbackManager = CallbackManager.Factory.create();
}
public void onClick(View v) {
switch (v.getId()){
case R.id.create_with_email_btn:
isLogin = true;
login_type_layout.setVisibility(View.GONE);
create_with_email_layout.setVisibility(View.VISIBLE);
break;
}
}
The visibility events are not working when using shared element transition with animation. Without it, it works fine.


I want to implement an animation where there is an ImageView rotating animation and after finishing it, want to start a new activity with shared element transition.
This is the following code i've done
Animation animation = AnimationUtils.loadAnimation(this, R.anim.rotate);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
Log.e("Animation", "Start");
}
@Override
public void onAnimationEnd(Animation animation) {
companyLogo.clearAnimation();
isFinished = true;
Intent intent = new Intent(SplashscreenActivity.this, LoginActivity.class);
ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(SplashscreenActivity.this,
companyLogo, ViewCompat.getTransitionName(companyLogo));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
startActivity(intent, optionsCompat.toBundle());
}
else {
startActivity(intent);
}
}
@Override
public void onAnimationRepeat(Animation animation) {
Log.e("Animation", "Repeat");
}
});
companyLogo.startAnimation(animation);
The problem occures when in the Login activity.
In login activity, i've 3 buttons and on click, i show a particular view for the same but it is not working with animation. When i remove the animation and load the same, it works.
This is the code for button click
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
create_with_email_btn = findViewById(R.id.create_with_email_btn);
create_with_email_btn.setOnClickListener(this);
callbackManager = CallbackManager.Factory.create();
}
public void onClick(View v) {
switch (v.getId()){
case R.id.create_with_email_btn:
isLogin = true;
login_type_layout.setVisibility(View.GONE);
create_with_email_layout.setVisibility(View.VISIBLE);
break;
}
}
The visibility events are not working when using shared element transition with animation. Without it, it works fine.




edited 4 hours ago
asked 6 hours ago
Saikiran Bait
98
98
1
Please post your code. What you have already achieved.
– webianks
6 hours ago
Possible duplicate of Animate ImageView between two activities using shared element transitions with ChangeImageTransform
– Jantzilla
5 hours ago
@webianks Please check the same, i've updated the question.
– Saikiran Bait
4 hours ago
add a comment |
1
Please post your code. What you have already achieved.
– webianks
6 hours ago
Possible duplicate of Animate ImageView between two activities using shared element transitions with ChangeImageTransform
– Jantzilla
5 hours ago
@webianks Please check the same, i've updated the question.
– Saikiran Bait
4 hours ago
1
1
Please post your code. What you have already achieved.
– webianks
6 hours ago
Please post your code. What you have already achieved.
– webianks
6 hours ago
Possible duplicate of Animate ImageView between two activities using shared element transitions with ChangeImageTransform
– Jantzilla
5 hours ago
Possible duplicate of Animate ImageView between two activities using shared element transitions with ChangeImageTransform
– Jantzilla
5 hours ago
@webianks Please check the same, i've updated the question.
– Saikiran Bait
4 hours ago
@webianks Please check the same, i've updated the question.
– Saikiran Bait
4 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53369213%2fvisibility-events-not-working-when-using-animation-with-shared-element-transitio%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Please post your code. What you have already achieved.
– webianks
6 hours ago
Possible duplicate of Animate ImageView between two activities using shared element transitions with ChangeImageTransform
– Jantzilla
5 hours ago
@webianks Please check the same, i've updated the question.
– Saikiran Bait
4 hours ago