diff options
author | ByteHamster <info@bytehamster.com> | 2019-12-24 00:06:32 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-12-24 10:17:42 +0100 |
commit | f17aa9b4ebbbe96774b9350e941de10c9cc188dc (patch) | |
tree | d02c0ccedb95eb045e9074ff8d7637c0afea7abf /app | |
parent | 7e2fc2c4a2afd0dca3ea6935a5f1556cb4de6b88 (diff) | |
download | AntennaPod-f17aa9b4ebbbe96774b9350e941de10c9cc188dc.zip |
Switched to less demanding animation
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java | 10 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java | 19 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java | 4 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java | 4 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/TransitionEffect.java | 2 | ||||
-rw-r--r-- | app/src/main/res/anim/card_flip_left_in.xml | 25 | ||||
-rw-r--r-- | app/src/main/res/anim/card_flip_left_out.xml | 18 | ||||
-rw-r--r-- | app/src/main/res/anim/card_flip_right_in.xml | 25 | ||||
-rw-r--r-- | app/src/main/res/anim/card_flip_right_out.xml | 18 | ||||
-rw-r--r-- | app/src/main/res/anim/fade_in.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/anim/fade_out.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/anim/slide_left_in.xml | 8 | ||||
-rw-r--r-- | app/src/main/res/anim/slide_left_out.xml | 8 | ||||
-rw-r--r-- | app/src/main/res/anim/slide_right_in.xml | 8 | ||||
-rw-r--r-- | app/src/main/res/anim/slide_right_out.xml | 8 | ||||
-rw-r--r-- | app/src/main/res/values/integers.xml | 5 |
16 files changed, 52 insertions, 114 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 0023e6d7f..fab84078e 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -383,12 +383,12 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi case FADE: transaction.setCustomAnimations(R.anim.fade_in, R.anim.fade_out); break; - case FLIP: + case SLIDE: transaction.setCustomAnimations( - R.anim.card_flip_left_in, - R.anim.card_flip_left_out, - R.anim.card_flip_right_in, - R.anim.card_flip_right_out); + R.anim.slide_right_in, + R.anim.slide_left_out, + R.anim.slide_left_in, + R.anim.slide_right_out); break; } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java index 79637d79a..3949172bb 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java @@ -76,7 +76,7 @@ public class FeedInfoFragment extends Fragment { private final View.OnClickListener copyUrlToClipboard = new View.OnClickListener() { @Override public void onClick(View v) { - if(feed != null && feed.getDownload_url() != null) { + if (feed != null && feed.getDownload_url() != null) { String url = feed.getDownload_url(); ClipData clipData = ClipData.newPlainText(url, url); android.content.ClipboardManager cm = (android.content.ClipboardManager) getContext() @@ -91,12 +91,13 @@ public class FeedInfoFragment extends Fragment { @Override public void onResume() { super.onResume(); - ((MainActivity)getActivity()).getSupportActionBar().setTitle(R.string.feed_info_label); + ((MainActivity) getActivity()).getSupportActionBar().setTitle(R.string.feed_info_label); } @Nullable @Override - public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, + @Nullable Bundle savedInstanceState) { View root = inflater.inflate(R.layout.feedinfo, null); setHasOptionsMenu(true); @@ -118,7 +119,6 @@ public class FeedInfoFragment extends Fragment { txtvUrl = root.findViewById(R.id.txtvUrl); txtvUrl.setOnClickListener(copyUrlToClipboard); - postponeEnterTransition(); return root; } @@ -136,10 +136,9 @@ public class FeedInfoFragment extends Fragment { .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(result -> { - feed = result; - showFeed(); - }, error -> Log.d(TAG, Log.getStackTraceString(error)), - this::startPostponedEnterTransition); + feed = result; + showFeed(); + }, error -> Log.d(TAG, Log.getStackTraceString(error)), () -> { }); } private void showFeed() { @@ -208,8 +207,8 @@ public class FeedInfoFragment extends Fragment { public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); menu.findItem(R.id.share_link_item).setVisible(feed != null && feed.getLink() != null); - menu.findItem(R.id.visit_website_item).setVisible(feed != null && feed.getLink() != null && - IntentUtils.isCallable(getContext(), new Intent(Intent.ACTION_VIEW, Uri.parse(feed.getLink())))); + menu.findItem(R.id.visit_website_item).setVisible(feed != null && feed.getLink() != null + && IntentUtils.isCallable(getContext(), new Intent(Intent.ACTION_VIEW, Uri.parse(feed.getLink())))); } @Override diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java index 33343948f..94aa7291e 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java @@ -515,7 +515,7 @@ public class FeedItemlistFragment extends ListFragment { butShowSettings.setOnClickListener(v -> { if (feed != null) { FeedSettingsFragment fragment = FeedSettingsFragment.newInstance(feed); - ((MainActivity) getActivity()).loadChildFragment(fragment, TransitionEffect.FLIP); + ((MainActivity) getActivity()).loadChildFragment(fragment, TransitionEffect.SLIDE); } }); headerCreated = true; @@ -524,7 +524,7 @@ public class FeedItemlistFragment extends ListFragment { private void showFeedInfo() { if (feed != null) { FeedInfoFragment fragment = FeedInfoFragment.newInstance(feed); - ((MainActivity) getActivity()).loadChildFragment(fragment, TransitionEffect.FLIP); + ((MainActivity) getActivity()).loadChildFragment(fragment, TransitionEffect.SLIDE); } } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java index 7c1555e66..bb1f8f8e9 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java @@ -54,7 +54,6 @@ public class FeedSettingsFragment extends PreferenceFragmentCompat { setupAutoDownloadGlobalPreference(); // To prevent transition animation because of summary update - postponeEnterTransition(); long feedId = getArguments().getLong(EXTRA_FEED_ID); disposable = Maybe.create((MaybeOnSubscribe<Feed>) emitter -> { Feed feed = DBReader.getFeed(feedId); @@ -81,8 +80,7 @@ public class FeedSettingsFragment extends PreferenceFragmentCompat { updateAutoDeleteSummary(); updateAutoDownloadEnabled(); updatePlaybackSpeedPreference(); - }, error -> Log.d(TAG, Log.getStackTraceString(error)), - this::startPostponedEnterTransition); + }, error -> Log.d(TAG, Log.getStackTraceString(error)), () -> { }); } @Override diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/TransitionEffect.java b/app/src/main/java/de/danoeh/antennapod/fragment/TransitionEffect.java index 461fa9da3..e3ec14890 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/TransitionEffect.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/TransitionEffect.java @@ -1,5 +1,5 @@ package de.danoeh.antennapod.fragment; public enum TransitionEffect { - NONE, FLIP, FADE + NONE, FADE, SLIDE } diff --git a/app/src/main/res/anim/card_flip_left_in.xml b/app/src/main/res/anim/card_flip_left_in.xml deleted file mode 100644 index 0ffc85aec..000000000 --- a/app/src/main/res/anim/card_flip_left_in.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<set xmlns:android="http://schemas.android.com/apk/res/android"> - <!-- Before rotating, immediately set the alpha to 0. --> - <objectAnimator - android:valueFrom="1.0" - android:valueTo="0.0" - android:propertyName="alpha" - android:duration="0" /> - - <!-- Rotate. --> - <objectAnimator - android:valueFrom="-180" - android:valueTo="0" - android:propertyName="rotationY" - android:interpolator="@android:interpolator/accelerate_decelerate" - android:duration="@integer/card_flip_time_full" /> - - <!-- Half-way through the rotation (see startOffset), set the alpha to 1. --> - <objectAnimator - android:valueFrom="0.0" - android:valueTo="1.0" - android:propertyName="alpha" - android:startOffset="@integer/card_flip_time_half" - android:duration="1" /> -</set>
\ No newline at end of file diff --git a/app/src/main/res/anim/card_flip_left_out.xml b/app/src/main/res/anim/card_flip_left_out.xml deleted file mode 100644 index 817f0d3fc..000000000 --- a/app/src/main/res/anim/card_flip_left_out.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<set xmlns:android="http://schemas.android.com/apk/res/android"> - <!-- Rotate. --> - <objectAnimator - android:valueFrom="0" - android:valueTo="180" - android:propertyName="rotationY" - android:interpolator="@android:interpolator/accelerate_decelerate" - android:duration="@integer/card_flip_time_full" /> - - <!-- Half-way through the rotation (see startOffset), set the alpha to 0. --> - <objectAnimator - android:valueFrom="1.0" - android:valueTo="0.0" - android:propertyName="alpha" - android:startOffset="@integer/card_flip_time_half" - android:duration="1" /> -</set>
\ No newline at end of file diff --git a/app/src/main/res/anim/card_flip_right_in.xml b/app/src/main/res/anim/card_flip_right_in.xml deleted file mode 100644 index 31ff1dde5..000000000 --- a/app/src/main/res/anim/card_flip_right_in.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<set xmlns:android="http://schemas.android.com/apk/res/android"> - <!-- Before rotating, immediately set the alpha to 0. --> - <objectAnimator - android:valueFrom="1.0" - android:valueTo="0.0" - android:propertyName="alpha" - android:duration="0" /> - - <!-- Rotate. --> - <objectAnimator - android:valueFrom="180" - android:valueTo="0" - android:propertyName="rotationY" - android:interpolator="@android:interpolator/accelerate_decelerate" - android:duration="@integer/card_flip_time_full" /> - - <!-- Half-way through the rotation (see startOffset), set the alpha to 1. --> - <objectAnimator - android:valueFrom="0.0" - android:valueTo="1.0" - android:propertyName="alpha" - android:startOffset="@integer/card_flip_time_half" - android:duration="1" /> -</set>
\ No newline at end of file diff --git a/app/src/main/res/anim/card_flip_right_out.xml b/app/src/main/res/anim/card_flip_right_out.xml deleted file mode 100644 index b57113fea..000000000 --- a/app/src/main/res/anim/card_flip_right_out.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<set xmlns:android="http://schemas.android.com/apk/res/android"> - <!-- Rotate. --> - <objectAnimator - android:valueFrom="0" - android:valueTo="-180" - android:propertyName="rotationY" - android:interpolator="@android:interpolator/accelerate_decelerate" - android:duration="@integer/card_flip_time_full" /> - - <!-- Half-way through the rotation (see startOffset), set the alpha to 0. --> - <objectAnimator - android:valueFrom="1.0" - android:valueTo="0.0" - android:propertyName="alpha" - android:startOffset="@integer/card_flip_time_half" - android:duration="1" /> -</set>
\ No newline at end of file diff --git a/app/src/main/res/anim/fade_in.xml b/app/src/main/res/anim/fade_in.xml index d3567dc31..fa1ba9ade 100644 --- a/app/src/main/res/anim/fade_in.xml +++ b/app/src/main/res/anim/fade_in.xml @@ -2,7 +2,7 @@ <set xmlns:android="http://schemas.android.com/apk/res/android" > <alpha - android:duration="500" + android:duration="@android:integer/config_mediumAnimTime" android:fromAlpha="0.0" android:interpolator="@android:anim/accelerate_interpolator" android:toAlpha="1.0" /> diff --git a/app/src/main/res/anim/fade_out.xml b/app/src/main/res/anim/fade_out.xml index ddf12d13f..392ec4277 100644 --- a/app/src/main/res/anim/fade_out.xml +++ b/app/src/main/res/anim/fade_out.xml @@ -2,7 +2,7 @@ <set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha - android:duration="500" + android:duration="@android:integer/config_mediumAnimTime" android:fromAlpha="1.0" android:interpolator="@android:anim/accelerate_interpolator" android:toAlpha="0.0" /> diff --git a/app/src/main/res/anim/slide_left_in.xml b/app/src/main/res/anim/slide_left_in.xml new file mode 100644 index 000000000..6effe70f4 --- /dev/null +++ b/app/src/main/res/anim/slide_left_in.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:shareInterpolator="false"> + <translate + android:fromXDelta="-100%" android:toXDelta="0%" + android:fromYDelta="0%" android:toYDelta="0%" + android:duration="@android:integer/config_mediumAnimTime"/> +</set> diff --git a/app/src/main/res/anim/slide_left_out.xml b/app/src/main/res/anim/slide_left_out.xml new file mode 100644 index 000000000..ee28900e9 --- /dev/null +++ b/app/src/main/res/anim/slide_left_out.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:shareInterpolator="false"> + <translate + android:fromXDelta="0%" android:toXDelta="-100%" + android:fromYDelta="0%" android:toYDelta="0%" + android:duration="@android:integer/config_mediumAnimTime" /> +</set> diff --git a/app/src/main/res/anim/slide_right_in.xml b/app/src/main/res/anim/slide_right_in.xml new file mode 100644 index 000000000..368927438 --- /dev/null +++ b/app/src/main/res/anim/slide_right_in.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:shareInterpolator="false"> + <translate + android:fromXDelta="100%" android:toXDelta="0%" + android:fromYDelta="0%" android:toYDelta="0%" + android:duration="@android:integer/config_mediumAnimTime"/> +</set> diff --git a/app/src/main/res/anim/slide_right_out.xml b/app/src/main/res/anim/slide_right_out.xml new file mode 100644 index 000000000..13567b256 --- /dev/null +++ b/app/src/main/res/anim/slide_right_out.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:shareInterpolator="false"> + <translate + android:fromXDelta="0%" android:toXDelta="100%" + android:fromYDelta="0%" android:toYDelta="0%" + android:duration="@android:integer/config_mediumAnimTime" /> +</set> diff --git a/app/src/main/res/values/integers.xml b/app/src/main/res/values/integers.xml deleted file mode 100644 index 8c444ee8b..000000000 --- a/app/src/main/res/values/integers.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <integer name="card_flip_time_full">400</integer> - <integer name="card_flip_time_half">200</integer> -</resources>
\ No newline at end of file |