diff options
author | Andrew Lee <anwlee@google.com> | 2015-08-26 16:27:12 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-08-26 16:55:03 -0700 |
commit | a119bca4948fcf0e8289f137f402417ea18caedb (patch) | |
tree | fb0fda7313b483e603fb5d00ccf7105f63c2ddc7 /src/com | |
parent | 903ebbdd718d1ea6ee10c3ffa68c2ba8c45624eb (diff) |
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
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java | 8 | ||||
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java index 158ed5834..755460114 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java @@ -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) { diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index 7270af787..056dcc64e 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -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) { |