Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b38ecae authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a bug where messages could be invisible

Because the layout could be faded away, but not
made visible anymore, the messaginglinearlayout
could stay hidden or halfway faded.

Change-Id: I2d517a2b9d4e1e4eecb1b865569a3449c2f52d31
Fixes: 69433427
Test: drag down on message, turn screen off during transition, ensure everything visible and working stills
parent 2871beff
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ public class MessagingLayoutTransformState extends TransformState {

    private void transformViewInternal(MessagingLayoutTransformState mlt,
            float transformationAmount, boolean to) {
        ensureVisible();
        ArrayList<MessagingGroup> ownGroups = filterHiddenGroups(
                mMessagingLayout.getMessagingGroups());
        ArrayList<MessagingGroup> otherGroups = filterHiddenGroups(
@@ -332,6 +333,7 @@ public class MessagingLayoutTransformState extends TransformState {

    @Override
    public void setVisible(boolean visible, boolean force) {
        super.setVisible(visible, force);
        resetTransformedView();
        ArrayList<MessagingGroup> ownGroups = mMessagingLayout.getMessagingGroups();
        for (int i = 0; i < ownGroups.size(); i++) {
+10 −6
Original line number Diff line number Diff line
@@ -95,16 +95,20 @@ public class TransformState {
    public void transformViewFrom(TransformState otherState, float transformationAmount) {
        mTransformedView.animate().cancel();
        if (sameAs(otherState)) {
            ensureVisible();
        } else {
            CrossFadeHelper.fadeIn(mTransformedView, transformationAmount);
        }
        transformViewFullyFrom(otherState, transformationAmount);
    }

    protected void ensureVisible() {
        if (mTransformedView.getVisibility() == View.INVISIBLE
                || mTransformedView.getAlpha() != 1.0f) {
            // We have the same content, lets show ourselves
            mTransformedView.setAlpha(1.0f);
            mTransformedView.setVisibility(View.VISIBLE);
        }
        } else {
            CrossFadeHelper.fadeIn(mTransformedView, transformationAmount);
        }
        transformViewFullyFrom(otherState, transformationAmount);
    }

    public void transformViewFullyFrom(TransformState otherState, float transformationAmount) {