Skip to content

Commit

Permalink
Merge pull request #83 from Carifio24/v4-0-2
Browse files Browse the repository at this point in the history
Fix animation bug on some phones
  • Loading branch information
Carifio24 authored Jun 1, 2024
2 parents 33026dd + ba6b1d1 commit 2691f7f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId "dnd.jon.spellbook"
minSdkVersion 24
targetSdkVersion 33
versionCode 4000001
versionName "4.0.1"
versionCode 4000002
versionName "4.0.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.release
}
Expand Down
12 changes: 9 additions & 3 deletions app/src/main/java/dnd/jon/spellbook/CenterReveal.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class CenterReveal {
PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, cY)
);
viewAlpha = ObjectAnimator.ofFloat(view, View.ALPHA, 0f);
containerAlpha = ObjectAnimator.ofFloat(container, View.ALPHA, 0f, 1f);
containerAlpha = container != null ? ObjectAnimator.ofFloat(container, View.ALPHA, 0f, 1f) : null;
viewScale = ObjectAnimator.ofPropertyValuesHolder(view,
PropertyValuesHolder.ofFloat(View.SCALE_X, 10f),
PropertyValuesHolder.ofFloat(View.SCALE_Y, 10f)
Expand Down Expand Up @@ -82,7 +82,11 @@ public void onAnimationRepeat(Animator animator) {

final AnimatorSet secondAnimatorSet = new AnimatorSet();
secondAnimatorSet.setDuration(duration);
secondAnimatorSet.playTogether(viewAlpha, viewScale, containerAlpha);
if (containerAlpha != null) {
secondAnimatorSet.playTogether(viewAlpha, viewScale, containerAlpha);
} else {
secondAnimatorSet.playTogether(viewAlpha, viewScale);
}

final AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playSequentially(firstAnimatorSet, secondAnimatorSet);
Expand Down Expand Up @@ -162,7 +166,9 @@ public void onAnimationRepeat(Animator animator) {
});
viewScale.setDuration(duration).reverse();
viewAlpha.setDuration(duration).reverse();
containerAlpha.setDuration(duration).reverse();
if (containerAlpha != null) {
containerAlpha.setDuration(duration).reverse();
}
}

}
2 changes: 1 addition & 1 deletion app/src/main/java/dnd/jon/spellbook/GlobalInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class GlobalInfo {

static final Version VERSION = new Version(4,0,1);
static final Version VERSION = new Version(4,0,2);
static final String VERSION_CODE = VERSION.string();

// We don't always want to show an update message
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/dnd/jon/spellbook/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,6 @@ private void setupFAB() {
openedSpellSlotsFromFAB = true;
try {
fabCenterReveal = new CenterReveal(binding.fab, null);
//fabCenterReveal = new CenterReveal(binding.fab, binding.phoneFragmentContainer);
fabCenterReveal.start(() -> globalNavigateTo(id.spellSlotManagerFragment));
} catch (Exception e) {
globalNavigateTo(id.spellSlotManagerFragment);
Expand Down

0 comments on commit 2691f7f

Please sign in to comment.