diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-05-03 22:14:23 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-05-03 22:14:23 +0200 |
commit | 7d5c374fd09bdeaf3acd2dca653e618ecd3e2c71 (patch) | |
tree | 8219358cd0ce1736ea0032fd5ad851f275abcc30 /src/main/java/de/pixart/messenger/ui | |
parent | 75f7ec90466e6cbfc4220bd59b78a6230dc8fef7 (diff) |
add animations
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 8 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 253d27433..fdcbf29b3 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -1,6 +1,8 @@ package de.pixart.messenger.ui; import android.Manifest; +import android.animation.Animator; +import android.animation.AnimatorInflater; import android.annotation.SuppressLint; import android.app.Activity; import android.app.Fragment; @@ -1212,6 +1214,12 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke return binding.getRoot(); } + @Override + public Animator onCreateAnimator(int transit, boolean enter, int nextAnim) { + int animator = enter ? R.animator.fade_right_in : R.animator.fade_right_out; + return AnimatorInflater.loadAnimator(getActivity(), animator); + } + private void quoteText(String text) { if (binding.textinput.isEnabled()) { text = text.replaceAll("(\n *){2,}", "\n").replaceAll("(^|\n)", "$1> ").replaceAll("\n$", ""); diff --git a/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java index 63dc9b699..d2f7110f9 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java @@ -29,6 +29,8 @@ package de.pixart.messenger.ui; +import android.animation.Animator; +import android.animation.AnimatorInflater; import android.app.Activity; import android.app.Fragment; import android.content.Intent; @@ -217,6 +219,12 @@ public class ConversationsOverviewFragment extends XmppFragment { } @Override + public Animator onCreateAnimator(int transit, boolean enter, int nextAnim) { + int animator = enter ? R.animator.fade_left_in : R.animator.fade_left_out; + return AnimatorInflater.loadAnimator(getActivity(), animator); + } + + @Override void refresh() { if (this.binding == null || this.activity == null) { Log.d(Config.LOGTAG, "ConversationsOverviewFragment.refresh() skipped updated because view binding or activity was null"); |