mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 21:45:20 +00:00
Fix media button visibility issue on older Android versions.
Turns out setVisibility doesn't work unless you call clearAnimation() first on older Android versions. Isn't that grand?
This commit is contained in:
parent
148cfd1b53
commit
8e86c7d81a
@ -411,7 +411,7 @@ public class MediaSendActivity extends PassphraseRequiredActionBarActivity imple
|
|||||||
if (oldVisibility == newVisibility) return;
|
if (oldVisibility == newVisibility) return;
|
||||||
|
|
||||||
if (button.getAnimation() != null) {
|
if (button.getAnimation() != null) {
|
||||||
button.getAnimation().cancel();
|
button.clearAnimation();
|
||||||
button.setVisibility(newVisibility);
|
button.setVisibility(newVisibility);
|
||||||
} else if (newVisibility == View.VISIBLE) {
|
} else if (newVisibility == View.VISIBLE) {
|
||||||
button.setVisibility(View.VISIBLE);
|
button.setVisibility(View.VISIBLE);
|
||||||
@ -427,6 +427,7 @@ public class MediaSendActivity extends PassphraseRequiredActionBarActivity imple
|
|||||||
animation.setAnimationListener(new SimpleAnimationListener() {
|
animation.setAnimationListener(new SimpleAnimationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animation animation) {
|
public void onAnimationEnd(Animation animation) {
|
||||||
|
button.clearAnimation();
|
||||||
button.setVisibility(View.GONE);
|
button.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -437,7 +438,7 @@ public class MediaSendActivity extends PassphraseRequiredActionBarActivity imple
|
|||||||
|
|
||||||
private void animateButtonTextChange(@NonNull View button) {
|
private void animateButtonTextChange(@NonNull View button) {
|
||||||
if (button.getAnimation() != null) {
|
if (button.getAnimation() != null) {
|
||||||
button.getAnimation().cancel();
|
button.clearAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
Animation grow = new ScaleAnimation(1f, 1.3f, 1f, 1.3f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
|
Animation grow = new ScaleAnimation(1f, 1.3f, 1f, 1.3f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
|
||||||
|
Loading…
Reference in New Issue
Block a user