mirror of
https://github.com/oxen-io/session-android.git
synced 2025-03-16 06:20:54 +00:00
Tint audio controls to be visible in dark theme
Fixes #4353 Closes #4466 // FREEBIE
This commit is contained in:
parent
b136fed6f7
commit
fb9ba8cb8d
@ -63,6 +63,8 @@ import org.thoughtcrime.securesms.mms.SlideClickListener;
|
|||||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||||
import org.thoughtcrime.securesms.recipients.Recipients;
|
import org.thoughtcrime.securesms.recipients.Recipients;
|
||||||
import org.thoughtcrime.securesms.util.DateUtils;
|
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 org.thoughtcrime.securesms.util.Util;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -231,7 +233,12 @@ public class ConversationItem extends LinearLayout
|
|||||||
if (messageRecord.isOutgoing()) {
|
if (messageRecord.isOutgoing()) {
|
||||||
bodyBubble.getBackground().setColorFilter(defaultBubbleColor, PorterDuff.Mode.MULTIPLY);
|
bodyBubble.getBackground().setColorFilter(defaultBubbleColor, PorterDuff.Mode.MULTIPLY);
|
||||||
mediaThumbnail.setBackgroundColorHint(defaultBubbleColor);
|
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 {
|
} else {
|
||||||
int color = recipient.getColor().toConversationColor(context);
|
int color = recipient.getColor().toConversationColor(context);
|
||||||
bodyBubble.getBackground().setColorFilter(color, PorterDuff.Mode.MULTIPLY);
|
bodyBubble.getBackground().setColorFilter(color, PorterDuff.Mode.MULTIPLY);
|
||||||
|
@ -95,8 +95,11 @@ public class AudioSlidePlayer {
|
|||||||
Log.w(TAG, "onComplete");
|
Log.w(TAG, "onComplete");
|
||||||
synchronized (AudioSlidePlayer.this) {
|
synchronized (AudioSlidePlayer.this) {
|
||||||
mediaPlayer = null;
|
mediaPlayer = null;
|
||||||
audioAttachmentServer.stop();
|
|
||||||
audioAttachmentServer = null;
|
if (audioAttachmentServer != null) {
|
||||||
|
audioAttachmentServer.stop();
|
||||||
|
audioAttachmentServer = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyOnStop();
|
notifyOnStop();
|
||||||
|
@ -7,6 +7,9 @@ import org.thoughtcrime.securesms.R;
|
|||||||
|
|
||||||
public class DynamicTheme {
|
public class DynamicTheme {
|
||||||
|
|
||||||
|
public static final String DARK = "dark";
|
||||||
|
public static final String LIGHT = "light";
|
||||||
|
|
||||||
private int currentTheme;
|
private int currentTheme;
|
||||||
|
|
||||||
public void onCreate(Activity activity) {
|
public void onCreate(Activity activity) {
|
||||||
@ -27,7 +30,7 @@ public class DynamicTheme {
|
|||||||
protected int getSelectedTheme(Activity activity) {
|
protected int getSelectedTheme(Activity activity) {
|
||||||
String theme = TextSecurePreferences.getTheme(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;
|
return R.style.TextSecure_LightTheme;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user