diff --git a/app/src/main/java/dev/arkbuilders/arkmemo/ui/adapters/NotesListAdapter.kt b/app/src/main/java/dev/arkbuilders/arkmemo/ui/adapters/NotesListAdapter.kt index 504ef131..dad5d6ca 100644 --- a/app/src/main/java/dev/arkbuilders/arkmemo/ui/adapters/NotesListAdapter.kt +++ b/app/src/main/java/dev/arkbuilders/arkmemo/ui/adapters/NotesListAdapter.kt @@ -74,7 +74,7 @@ class NotesListAdapter( holder.btnPlayPause.setOnClickListener { onPlayPauseClick(note.path.toString(), position) { stopPos -> - showPlayIcon(holder) + showPlaybackIdleState(holder) (notes[position] as VoiceNote).isPlaying = false notifyItemChanged(position) } @@ -83,9 +83,9 @@ class NotesListAdapter( } if (note.isPlaying) { - showPauseIcon(holder) + showPlayingState(holder) } else { - showPlayIcon(holder) + showPlaybackIdleState(holder) } } else if (note is GraphicNote) { @@ -108,36 +108,38 @@ class NotesListAdapter( ) { when (effect) { is ArkMediaPlayerSideEffect.StartPlaying -> { - showPauseIcon(holder) + showPlayingState(holder) } is ArkMediaPlayerSideEffect.PausePlaying -> { - showPlayIcon(holder) + showPlaybackIdleState(holder) } is ArkMediaPlayerSideEffect.StopPlaying -> { - showPlayIcon(holder) + showPlaybackIdleState(holder) } is ArkMediaPlayerSideEffect.ResumePlaying -> { - showPauseIcon(holder) + showPlayingState(holder) } } } - private fun showPlayIcon(holder: NoteViewHolder) { + private fun showPlaybackIdleState(holder: NoteViewHolder) { val playIcon = ResourcesCompat.getDrawable( activity.resources, R.drawable.ic_play_circle, null ) holder.btnPlayPause.setImageDrawable(playIcon) + holder.layoutAudioView.animAudioPlaying.pauseAnimation() } - private fun showPauseIcon(holder: NoteViewHolder) { + private fun showPlayingState(holder: NoteViewHolder) { val playIcon = ResourcesCompat.getDrawable( activity.resources, R.drawable.ic_pause_circle, null ) holder.btnPlayPause.setImageDrawable(playIcon) + holder.layoutAudioView.animAudioPlaying.playAnimation() } fun updateData(newNotes: List, fromSearch: Boolean? = null, keyword: String? = null) { diff --git a/app/src/main/java/dev/arkbuilders/arkmemo/ui/fragments/EditTextNotesFragment.kt b/app/src/main/java/dev/arkbuilders/arkmemo/ui/fragments/EditTextNotesFragment.kt index a46537a5..9674737e 100644 --- a/app/src/main/java/dev/arkbuilders/arkmemo/ui/fragments/EditTextNotesFragment.kt +++ b/app/src/main/java/dev/arkbuilders/arkmemo/ui/fragments/EditTextNotesFragment.kt @@ -95,7 +95,7 @@ class EditTextNotesFragment: BaseEditNoteFragment() { hostActivity.showProgressBar(show) } } - enableSaveText(false) + enableSaveText(noteStr?.isNotBlank() == true) binding.tvPaste.setOnClickListener(pasteNoteClickListener) diff --git a/app/src/main/res/layout/media_player_view_v2.xml b/app/src/main/res/layout/media_player_view_v2.xml index 270af946..355784da 100644 --- a/app/src/main/res/layout/media_player_view_v2.xml +++ b/app/src/main/res/layout/media_player_view_v2.xml @@ -6,7 +6,6 @@ android:layout_height="wrap_content" android:background="@drawable/bg_audio_view" android:paddingHorizontal="13dp" - android:visibility="visible" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent">