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

Commit a119bca4 authored by Andrew Lee's avatar Andrew Lee
Browse files

Populate TextViews with 00:00 after inflation.

But, set them to INVISIBLE, so they layout, but don't appear.

This prevents jank caused by the seekbar resizing later on when
times are set for the first time.

Bug: 22333980
Change-Id: I8523659b837008bae1789c1beaccc7edf9c15554
parent 903ebbdd
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -240,6 +240,11 @@ public class VoicemailPlaybackLayout extends LinearLayout
        mStartStopButton.setOnClickListener(mStartStopButtonListener);
        mPlaybackSpeakerphone.setOnClickListener(mSpeakerphoneListener);
        mDeleteButton.setOnClickListener(mDeleteButtonListener);

        mPositionText.setText(formatAsMinutesAndSeconds(0));
        mPositionText.setVisibility(View.INVISIBLE);
        mTotalDurationText.setText(formatAsMinutesAndSeconds(0));
        mTotalDurationText.setVisibility(View.INVISIBLE);
    }

    @Override
@@ -355,6 +360,9 @@ public class VoicemailPlaybackLayout extends LinearLayout
        mStartStopButton.setEnabled(true);
        mPlaybackSpeakerphone.setEnabled(true);
        mPlaybackSeek.setEnabled(true);

        mPositionText.setVisibility(View.VISIBLE);
        mTotalDurationText.setVisibility(View.VISIBLE);
    }

    private String getString(int resId) {
+1 −1
Original line number Diff line number Diff line
@@ -515,9 +515,9 @@ public class VoicemailPlaybackPresenter
        mDuration.set(mMediaPlayer.getDuration());
        mPosition = mMediaPlayer.getCurrentPosition();

        mView.enableUiElements();
        Log.d(TAG, "onPrepared: mPosition=" + mPosition);
        mView.setClipPosition(mPosition, mDuration.get());
        mView.enableUiElements();
        mMediaPlayer.seekTo(mPosition);

        if (mIsPlaying) {