Skip to content

Commit

Permalink
UI functionality fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimowner committed Jan 8, 2020
1 parent 539df9c commit 4c9e550
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ext.versions = [

def versionMajor = 0
def versionMinor = 7
def versionPatch = 13
def versionPatch = 14

android {
compileSdkVersion versions.targetSdkVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ public void showPlayPause() {
@Override
public void showPlayStop() {
btnPlay.setImageResource(R.drawable.ic_play);
// waveformView.setPlayback(-1);
waveformView.moveToStart();
btnRecord.setEnabled(true);
playProgress.setProgress(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ public void showPlayPause() {

@Override
public void showPlayStop() {
waveformView.setPlayback(-1);
waveformView.moveToStart();
btnPlay.setImageResource(R.drawable.ic_play_64);
playProgress.setProgress(0);
adapter.setActiveItem(-1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,19 @@ public void run() {
view.showActiveRecord(rec.getId());
}
}

//Set player position is audio player is paused.
if (audioPlayer.isPause()) {
long duration = rec.getDuration() / 1000;
if (duration > 0) {
long playProgressMills = audioPlayer.getPauseTime();
view.onPlayProgress(playProgressMills, AndroidUtils.convertMillsToPx(playProgressMills,
AndroidUtils.dpToPx(dpPerSecond)), (int) (1000 * playProgressMills / duration));
}
view.showPlayerPanel();
view.showPlayPause();
}

view.hideProgress();
view.hidePanelProgress();
view.bookmarksUnselected();
Expand Down Expand Up @@ -488,17 +501,6 @@ public void run() {
} else {
view.bookmarksUnselected();
}
//Set player position is audio player is paused.
if (audioPlayer.isPause()) {
long duration = rec.getDuration() / 1000;
if (duration > 0) {
long playProgressMills = audioPlayer.getPauseTime();
view.onPlayProgress(playProgressMills, AndroidUtils.convertMillsToPx(playProgressMills,
AndroidUtils.dpToPx(dpPerSecond)), (int) (1000 * playProgressMills / duration));
}
view.showPlayerPanel();
view.showPlayPause();
}
}
view.hideProgress();
view.hidePanelProgress();
Expand Down

0 comments on commit 4c9e550

Please sign in to comment.