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

Commit 6b77ccf0 authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Update phonetic name in QuickContact only when it's changed

Avoid calling MultiShrinkScroller.initialize() every time when load finished.

Bug 27348939

Change-Id: I889adc9784ca9f4a1f521eca8bad0906787a1941
parent b82d0d14
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -408,16 +408,27 @@ public class MultiShrinkScroller extends FrameLayout {
    }

    public void setPhoneticName(String phoneticName) {
        // Set phonetic name only when it was gone before or got changed.
        if (mPhoneticNameView.getVisibility() == View.VISIBLE
                && phoneticName.equals(mPhoneticNameView.getText())) {
            return;
        }
        mPhoneticNameView.setText(phoneticName);
        // Every time the phonetic name is changed, set mPhoneticNameView as visible,
        // in case it just changed from Visibility=GONE.
        mPhoneticNameView.setVisibility(View.VISIBLE);
        // TODO try not using initialize() to refresh phonetic name view: b/27410518
        initialize(mListener, mIsOpenContactSquare);
    }

    public void setPhoneticNameGone() {
        // Remove phonetic name only when it was visible before.
        if (mPhoneticNameView.getVisibility() == View.GONE) {
            return;
        }
        mPhoneticNameView.setVisibility(View.GONE);
        // Initialize to make Visibility work.
        // TODO try not using initialize() to refresh phonetic name view: b/27410518
        initialize(mListener, mIsOpenContactSquare);
    }