Skip to content

Commit

Permalink
- Fixed bug with occasional crash with stop
Browse files Browse the repository at this point in the history
- Implement MediaRecorderState handling
- Fixed lifecycle bug - recording and locked UI now ends after app exits
- Saves Waveform to storage after initial loading
- Fixes File caption crashes
- A couple other bugs

Signed-off-by: Julius Linus <[email protected]>
  • Loading branch information
rapterjet2004 committed Nov 27, 2023
1 parent d73798a commit 98f854e
Show file tree
Hide file tree
Showing 9 changed files with 221 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public void onBind(@NonNull ChatMessage message) {
) {
Spanned processedMessageText = null;
binding.incomingPreviewMessageBubble.setBackgroundResource(R.drawable.shape_grouped_incoming_message);
binding.incomingPreviewMessageBubble.setOnClickListener(null);
if (viewThemeUtils != null ) {
processedMessageText = messageUtils.enrichChatMessageText(
binding.messageCaption.getContext(),
Expand All @@ -76,8 +75,9 @@ public void onBind(@NonNull ChatMessage message) {
viewThemeUtils,
processedMessageText,
message,
itemView);
binding.incomingPreviewMessageBubble);
}
binding.incomingPreviewMessageBubble.setOnClickListener(null);

float textSize = 0;
if (context != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) :
this.message = message
sharedApplication!!.componentApplication.inject(this)

val filename = message.selectedIndividualHashMap!!["name"]
val retrieved = appPreferences!!.getWaveFormFromFile(filename)
if (retrieved.isNotEmpty() &&
message.voiceMessageFloatArray == null ||
message.voiceMessageFloatArray?.isEmpty() == true
) {
message.voiceMessageFloatArray = retrieved.toFloatArray()
binding.seekbar.setWaveData(message.voiceMessageFloatArray!!)
}
binding.messageTime.text = dateUtils.getLocalTimeStringFromTimestamp(message.timestamp)

setAvatarAndAuthorOnMessageItem(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
package com.nextcloud.talk.adapters.messages;

import android.text.Spanned;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import android.widget.ImageView;
Expand Down Expand Up @@ -60,7 +59,6 @@ public void onBind(@NonNull ChatMessage message) {
) {
Spanned processedMessageText = null;
binding.outgoingPreviewMessageBubble.setBackgroundResource(R.drawable.shape_grouped_outcoming_message);
binding.outgoingPreviewMessageBubble.setOnClickListener(null);
if (viewThemeUtils != null) {
processedMessageText = messageUtils.enrichChatMessageText(
binding.messageCaption.getContext(),
Expand All @@ -76,8 +74,9 @@ public void onBind(@NonNull ChatMessage message) {
viewThemeUtils,
processedMessageText,
message,
itemView);
binding.outgoingPreviewMessageBubble);
}
binding.outgoingPreviewMessageBubble.setOnClickListener(null);

float textSize = 0;
if (context != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ class OutcomingVoiceMessageViewHolder(outcomingView: View) :
this.message = message
sharedApplication!!.componentApplication.inject(this)
viewThemeUtils.platform.colorTextView(binding.messageTime, ColorRole.ON_SURFACE_VARIANT)

val filename = message.selectedIndividualHashMap!!["name"]
val retrieved = appPreferences!!.getWaveFormFromFile(filename)
if (retrieved.isNotEmpty() &&
message.voiceMessageFloatArray == null ||
message.voiceMessageFloatArray?.isEmpty() == true
) {
message.voiceMessageFloatArray = retrieved.toFloatArray()
binding.seekbar.setWaveData(message.voiceMessageFloatArray!!)
}

binding.messageTime.text = dateUtils.getLocalTimeStringFromTimestamp(message.timestamp)

colorizeMessageBubble(message)
Expand Down
Loading

0 comments on commit 98f854e

Please sign in to comment.