mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Final code review nitpicks.
This commit is contained in:
@@ -26,6 +26,7 @@ import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import static java.util.logging.Level.INFO;
|
||||
import static org.briarproject.briar.android.conversation.ConversationActivity.CONTACT_ID;
|
||||
import static org.briarproject.briar.api.autodelete.AutoDeleteConstants.NO_AUTO_DELETE_TIMER;
|
||||
|
||||
@@ -102,7 +103,9 @@ public class ConversationSettingsDialog extends DialogFragment {
|
||||
|
||||
viewModel.getAutoDeleteTimer()
|
||||
.observe(getViewLifecycleOwner(), timer -> {
|
||||
LOG.info("Received auto delete timer: " + timer);
|
||||
if (LOG.isLoggable(INFO)) {
|
||||
LOG.info("Received auto delete timer: " + timer);
|
||||
}
|
||||
boolean disappearingMessages =
|
||||
timer != NO_AUTO_DELETE_TIMER;
|
||||
switchDisappearingMessages
|
||||
|
||||
@@ -176,7 +176,7 @@ public class ConversationViewModel extends DbViewModel
|
||||
} else if (e instanceof AutoDeleteTimerMirroredEvent) {
|
||||
AutoDeleteTimerMirroredEvent a = (AutoDeleteTimerMirroredEvent) e;
|
||||
if (a.getContactId().equals(contactId)) {
|
||||
autoDeleteTimer.postValue(a.getNewTimer());
|
||||
autoDeleteTimer.setValue(a.getNewTimer());
|
||||
}
|
||||
} else if (e instanceof AvatarUpdatedEvent) {
|
||||
AvatarUpdatedEvent a = (AvatarUpdatedEvent) e;
|
||||
|
||||
@@ -170,8 +170,7 @@ public class UiUtils {
|
||||
|
||||
/**
|
||||
* Returns the given duration in a human-friendly format. For example,
|
||||
* "7 days" or "1 hour". Returns only the largest meaningful unit of time,
|
||||
* from days up to minutes.
|
||||
* "7 days" or "1 hour 3 minutes".
|
||||
*/
|
||||
public static String formatDuration(Context ctx, long millis) {
|
||||
Resources r = ctx.getResources();
|
||||
|
||||
Reference in New Issue
Block a user