Skip to content

Commit

Permalink
Tint audio controls to be visible in dark theme
Browse files Browse the repository at this point in the history
Fixes signalapp#4353
Closes signalapp#4466
// FREEBIE
  • Loading branch information
moxie0 committed Nov 12, 2015
1 parent b136fed commit fb9ba8c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/org/thoughtcrime/securesms/ConversationItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.recipients.Recipients;
import org.thoughtcrime.securesms.util.DateUtils;
import org.thoughtcrime.securesms.util.DynamicTheme;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.thoughtcrime.securesms.util.Util;

import java.util.HashSet;
Expand Down Expand Up @@ -231,7 +233,12 @@ private void setBubbleState(MessageRecord messageRecord, Recipient recipient) {
if (messageRecord.isOutgoing()) {
bodyBubble.getBackground().setColorFilter(defaultBubbleColor, PorterDuff.Mode.MULTIPLY);
mediaThumbnail.setBackgroundColorHint(defaultBubbleColor);
audioView.setTint(conversationRecipients.getColor().toConversationColor(context));

if (DynamicTheme.LIGHT.equals(TextSecurePreferences.getTheme(context))) {
audioView.setTint(conversationRecipients.getColor().toConversationColor(context));
} else {
audioView.setTint(Color.WHITE);
}
} else {
int color = recipient.getColor().toConversationColor(context);
bodyBubble.getBackground().setColorFilter(color, PorterDuff.Mode.MULTIPLY);
Expand Down
7 changes: 5 additions & 2 deletions src/org/thoughtcrime/securesms/audio/AudioSlidePlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ public void onCompletion(MediaPlayer mp) {
Log.w(TAG, "onComplete");
synchronized (AudioSlidePlayer.this) {
mediaPlayer = null;
audioAttachmentServer.stop();
audioAttachmentServer = null;

if (audioAttachmentServer != null) {
audioAttachmentServer.stop();
audioAttachmentServer = null;
}
}

notifyOnStop();
Expand Down
5 changes: 4 additions & 1 deletion src/org/thoughtcrime/securesms/util/DynamicTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

public class DynamicTheme {

public static final String DARK = "dark";
public static final String LIGHT = "light";

private int currentTheme;

public void onCreate(Activity activity) {
Expand All @@ -27,7 +30,7 @@ public void onResume(Activity activity) {
protected int getSelectedTheme(Activity activity) {
String theme = TextSecurePreferences.getTheme(activity);

if (theme.equals("dark")) return R.style.TextSecure_DarkTheme;
if (theme.equals(DARK)) return R.style.TextSecure_DarkTheme;

return R.style.TextSecure_LightTheme;
}
Expand Down

0 comments on commit fb9ba8c

Please sign in to comment.