Short snooze time

This commit is contained in:
M66B 2019-01-08 18:27:24 +00:00
parent f5805b34da
commit b07bae8676
3 changed files with 10 additions and 5 deletions

View File

@ -780,9 +780,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
}
private void onShowSnoozed(TupleMessageEx message) {
if (message.ui_snoozed != null)
Toast.makeText(context, SimpleDateFormat.getDateTimeInstance()
.format(message.ui_snoozed), Toast.LENGTH_LONG).show();
if (message.ui_snoozed != null) {
DateFormat df = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.MEDIUM, SimpleDateFormat.SHORT);
Toast.makeText(context, df.format(message.ui_snoozed), Toast.LENGTH_LONG).show();
}
}
private void onToggleFlag(TupleMessageEx message) {

View File

@ -99,6 +99,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
@ -735,7 +736,8 @@ public class FragmentCompose extends FragmentEx {
int days = npDays.getValue();
long duration = (hours + days * 24) * HOUR_MS;
long time = new Date().getTime() / HOUR_MS * HOUR_MS + duration;
tvTime.setText(SimpleDateFormat.getDateTimeInstance().format(time));
DateFormat df = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.MEDIUM, SimpleDateFormat.SHORT);
tvTime.setText(df.format(time));
tvTime.setVisibility(duration == 0 ? View.INVISIBLE : View.VISIBLE);
}
};

View File

@ -52,6 +52,7 @@ import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@ -1220,7 +1221,8 @@ public class FragmentMessages extends FragmentEx {
int days = npDays.getValue();
long duration = (hours + days * 24) * HOUR_MS;
long time = new Date().getTime() / HOUR_MS * HOUR_MS + duration;
tvTime.setText(SimpleDateFormat.getDateTimeInstance().format(time));
DateFormat df = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.MEDIUM, SimpleDateFormat.SHORT);
tvTime.setText(df.format(time));
tvTime.setVisibility(duration == 0 ? View.INVISIBLE : View.VISIBLE);
}
};