Final code review nitpicks.

This commit is contained in:
akwizgran
2021-04-15 16:12:38 +01:00
parent 2fc6741c99
commit 8991762b0c
9 changed files with 23 additions and 41 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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();

View File

@@ -172,7 +172,7 @@
<string name="auto_delete_msg_you_enabled">Your messages will disappear after %1$s. %2$s</string>
<!-- The placeholder at the end will add "Tap to learn more." -->
<string name="auto_delete_msg_you_disabled">Your messages will not disappear. %1$s</string>
<!-- The second placeholder will show a duration like "7 days". The third placeholder at the end will add "Tap to learn more." -->
<!-- The first placeholder will show a contact's name. The second placeholder will show a duration like "7 days". The third placeholder at the end will add "Tap to learn more." -->
<string name="auto_delete_msg_contact_enabled">%1$s\'s messages will disappear after %2$s. %3$s</string>
<plurals name="duration_minutes">
<item quantity="one">%d minute</item>
@@ -186,7 +186,7 @@
<item quantity="one">%d day</item>
<item quantity="other">%d days</item>
</plurals>
<!-- The second placeholder at the end will add "Tap to learn more." -->
<!-- The first placeholder will show a contact's name. The second placeholder at the end will add "Tap to learn more." -->
<string name="auto_delete_msg_contact_disabled">%1$s\'s messages will not disappear. %2$s</string>
<string name="tap_to_learn_more">Tap to learn more.</string>
<string name="auto_delete_changed_warning_title">Disappearing messages changed</string>