Skip to content

Commit

Permalink
fix fragment transitions flickering
Browse files Browse the repository at this point in the history
  • Loading branch information
solrudev committed Jun 6, 2024
1 parent 529631c commit 188a7e3
Show file tree
Hide file tree
Showing 7 changed files with 232 additions and 0 deletions.
53 changes: 53 additions & 0 deletions app/src/main/res/animator-v23/slide_transition_enter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Okkei Patcher
~ Copyright (C) 2024 Ilya Fomichev
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/slide_transition_enter_duration">

<propertyValuesHolder android:propertyName="alpha">
<keyframe
android:fraction="0"
android:value="0f" />
<keyframe
android:fraction="0.286"
android:value="0f" />
<keyframe
android:fraction="0.643"
android:interpolator="@android:anim/decelerate_interpolator"
android:value="1f" />
<keyframe
android:fraction="1"
android:value="1f" />
</propertyValuesHolder>

<propertyValuesHolder
android:propertyName="x"
android:valueType="floatType">
<keyframe
android:fraction="0"
android:value="@integer/slide_transition_enter_translate" />
<keyframe
android:fraction="0.286"
android:value="@integer/slide_transition_enter_translate" />
<keyframe
android:fraction="1"
android:interpolator="@anim/slide_transition_translate_interpolator"
android:value="0f" />
</propertyValuesHolder>

</objectAnimator>
47 changes: 47 additions & 0 deletions app/src/main/res/animator-v23/slide_transition_exit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Okkei Patcher
~ Copyright (C) 2024 Ilya Fomichev
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/slide_transition_exit_duration">

<propertyValuesHolder android:propertyName="alpha">
<keyframe
android:fraction="0"
android:value="1f" />
<keyframe
android:fraction="0.5"
android:interpolator="@android:anim/decelerate_interpolator"
android:value="0f" />
<keyframe
android:fraction="1"
android:value="0f" />
</propertyValuesHolder>

<propertyValuesHolder
android:propertyName="x"
android:valueType="floatType">
<keyframe
android:fraction="0"
android:value="0f" />
<keyframe
android:fraction="1"
android:interpolator="@anim/slide_transition_translate_interpolator"
android:value="@integer/slide_transition_exit_translate" />
</propertyValuesHolder>

</objectAnimator>
53 changes: 53 additions & 0 deletions app/src/main/res/animator-v23/slide_transition_pop_enter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Okkei Patcher
~ Copyright (C) 2024 Ilya Fomichev
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/slide_transition_enter_duration">

<propertyValuesHolder android:propertyName="alpha">
<keyframe
android:fraction="0"
android:value="0f" />
<keyframe
android:fraction="0.286"
android:value="0f" />
<keyframe
android:fraction="0.643"
android:interpolator="@android:anim/decelerate_interpolator"
android:value="1f" />
<keyframe
android:fraction="1"
android:value="1f" />
</propertyValuesHolder>

<propertyValuesHolder
android:propertyName="x"
android:valueType="floatType">
<keyframe
android:fraction="0"
android:value="@integer/slide_transition_exit_translate" />
<keyframe
android:fraction="0.286"
android:value="@integer/slide_transition_exit_translate" />
<keyframe
android:fraction="1"
android:interpolator="@anim/slide_transition_translate_interpolator"
android:value="0f" />
</propertyValuesHolder>

</objectAnimator>
47 changes: 47 additions & 0 deletions app/src/main/res/animator-v23/slide_transition_pop_exit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Okkei Patcher
~ Copyright (C) 2024 Ilya Fomichev
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/slide_transition_exit_duration">

<propertyValuesHolder android:propertyName="alpha">
<keyframe
android:fraction="0"
android:value="1f" />
<keyframe
android:fraction="0.5"
android:interpolator="@android:anim/decelerate_interpolator"
android:value="0f" />
<keyframe
android:fraction="1"
android:value="0f" />
</propertyValuesHolder>

<propertyValuesHolder
android:propertyName="x"
android:valueType="floatType">
<keyframe
android:fraction="0"
android:value="0f" />
<keyframe
android:fraction="1"
android:interpolator="@anim/slide_transition_translate_interpolator"
android:value="@integer/slide_transition_enter_translate" />
</propertyValuesHolder>

</objectAnimator>
15 changes: 15 additions & 0 deletions app/src/main/res/animator/slide_transition_enter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:ordering="together">

<objectAnimator
android:duration="0"
android:propertyName="alpha"
android:startOffset="0"
android:valueFrom="0f"
android:valueTo="0f" />

<objectAnimator
android:duration="0"
android:propertyName="x"
android:startOffset="0"
android:valueFrom="@integer/slide_transition_enter_translate"
android:valueTo="@integer/slide_transition_enter_translate"
android:valueType="floatType" />

<objectAnimator
android:duration="@integer/slide_transition_alpha_duration"
android:interpolator="@android:anim/decelerate_interpolator"
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/res/animator/slide_transition_pop_enter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:ordering="together">

<objectAnimator
android:duration="0"
android:propertyName="alpha"
android:startOffset="0"
android:valueFrom="0f"
android:valueTo="0f" />

<objectAnimator
android:duration="0"
android:propertyName="x"
android:startOffset="0"
android:valueFrom="@integer/slide_transition_exit_translate"
android:valueTo="@integer/slide_transition_exit_translate"
android:valueType="floatType" />

<objectAnimator
android:duration="@integer/material_motion_duration_short_2"
android:interpolator="@android:anim/decelerate_interpolator"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/integers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<integer name="slide_transition_alpha_duration">150</integer>
<integer name="slide_transition_enter_alpha_offset">120</integer>
<integer name="slide_transition_translate_duration">300</integer>
<integer name="slide_transition_enter_duration">420</integer>
<integer name="slide_transition_exit_duration">300</integer>
<integer name="slide_transition_enter_translate">80</integer>
<integer name="slide_transition_exit_translate">-80</integer>
<integer name="permissions_span_count">1</integer>
Expand Down

0 comments on commit 188a7e3

Please sign in to comment.