Merge pull request 'Nice Dates' (#50) from message_pane_ui into trunk
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
Reviewed-on: #50
This commit is contained in:
commit
2a484b7da5
|
@ -36,6 +36,16 @@
|
|||
"cycleColoursDesktop": "",
|
||||
"cycleMorphsAndroid": "",
|
||||
"cycleMorphsDesktop": "",
|
||||
"dateDaysAgo": "",
|
||||
"dateHoursAgo": "",
|
||||
"dateLastMonth": "",
|
||||
"dateLastYear": "",
|
||||
"dateMinutesAgo": "",
|
||||
"dateNever": "",
|
||||
"dateRightNow": "",
|
||||
"dateWeeksAgo": "",
|
||||
"dateYearsAgo": "",
|
||||
"dateYesterday": "",
|
||||
"defaultGroupName": "Tolle Gruppe",
|
||||
"defaultProfileName": "Alice",
|
||||
"defaultScalingText": "defaultmäßige Textgröße (Skalierungsfaktor:",
|
||||
|
|
|
@ -36,6 +36,16 @@
|
|||
"cycleColoursDesktop": "Click to cycle colours.\\nRight-click to reset.",
|
||||
"cycleMorphsAndroid": "Click to cycle morphs.\\nLong-press to reset.",
|
||||
"cycleMorphsDesktop": "Click to cycle morphs.\\nRight-click to reset.",
|
||||
"dateDaysAgo": "Days Ago",
|
||||
"dateHoursAgo": "Hours Ago",
|
||||
"dateLastMonth": "Last Month",
|
||||
"dateLastYear": "Last Year",
|
||||
"dateMinutesAgo": "Minutes Ago",
|
||||
"dateNever": "Never",
|
||||
"dateRightNow": "Right Now",
|
||||
"dateWeeksAgo": "Weeks Ago",
|
||||
"dateYearsAgo": "X Years Ago (displayed next to a contact row to indicate time of last action)",
|
||||
"dateYesterday": "Yesterday",
|
||||
"defaultGroupName": "Awesome Group",
|
||||
"defaultProfileName": "Alice",
|
||||
"defaultScalingText": "Default size text (scale factor:",
|
||||
|
|
|
@ -36,6 +36,16 @@
|
|||
"cycleColoursDesktop": "Click para cambiar colores. Click derecho para reiniciar.",
|
||||
"cycleMorphsAndroid": "Click para cambiar transformaciones. Mantenga pulsado para reiniciar.",
|
||||
"cycleMorphsDesktop": "Click para cambiar transformaciones. Click derecho para reiniciar.",
|
||||
"dateDaysAgo": "",
|
||||
"dateHoursAgo": "",
|
||||
"dateLastMonth": "",
|
||||
"dateLastYear": "",
|
||||
"dateMinutesAgo": "",
|
||||
"dateNever": "",
|
||||
"dateRightNow": "",
|
||||
"dateWeeksAgo": "",
|
||||
"dateYearsAgo": "",
|
||||
"dateYesterday": "",
|
||||
"defaultGroupName": "El Grupo Asombroso",
|
||||
"defaultProfileName": "Alicia",
|
||||
"defaultScalingText": "Tamaño predeterminado de texto (factor de escala:",
|
||||
|
|
|
@ -36,6 +36,16 @@
|
|||
"cycleColoursDesktop": "",
|
||||
"cycleMorphsAndroid": "",
|
||||
"cycleMorphsDesktop": "",
|
||||
"dateDaysAgo": "",
|
||||
"dateHoursAgo": "",
|
||||
"dateLastMonth": "",
|
||||
"dateLastYear": "",
|
||||
"dateMinutesAgo": "",
|
||||
"dateNever": "",
|
||||
"dateRightNow": "",
|
||||
"dateWeeksAgo": "",
|
||||
"dateYearsAgo": "",
|
||||
"dateYesterday": "",
|
||||
"defaultGroupName": "Un super groupe",
|
||||
"defaultProfileName": "",
|
||||
"defaultScalingText": "Taille par défaut du texte (échelle:",
|
||||
|
|
|
@ -36,6 +36,16 @@
|
|||
"cycleColoursDesktop": "Fare clic per scorrere i colori.\\nCliccare con il tasto destro per resettare.",
|
||||
"cycleMorphsAndroid": "Fare clic per scorrere i morph.\\nPressione lunga per resettare.",
|
||||
"cycleMorphsDesktop": "Fare clic per scorrere i morph.\\nCliccare con il tasto destro per resettare.",
|
||||
"dateDaysAgo": "",
|
||||
"dateHoursAgo": "",
|
||||
"dateLastMonth": "",
|
||||
"dateLastYear": "",
|
||||
"dateMinutesAgo": "",
|
||||
"dateNever": "",
|
||||
"dateRightNow": "",
|
||||
"dateWeeksAgo": "",
|
||||
"dateYearsAgo": "",
|
||||
"dateYesterday": "",
|
||||
"defaultGroupName": "Gruppo fantastico",
|
||||
"defaultProfileName": "Alice",
|
||||
"defaultScalingText": "Testo di dimensioni predefinite (fattore di scala:",
|
||||
|
|
|
@ -36,6 +36,16 @@
|
|||
"cycleColoursDesktop": "",
|
||||
"cycleMorphsAndroid": "",
|
||||
"cycleMorphsDesktop": "",
|
||||
"dateDaysAgo": "",
|
||||
"dateHoursAgo": "",
|
||||
"dateLastMonth": "",
|
||||
"dateLastYear": "",
|
||||
"dateMinutesAgo": "",
|
||||
"dateNever": "",
|
||||
"dateRightNow": "",
|
||||
"dateWeeksAgo": "",
|
||||
"dateYearsAgo": "",
|
||||
"dateYesterday": "",
|
||||
"defaultGroupName": "Grupo incrível",
|
||||
"defaultProfileName": "",
|
||||
"defaultScalingText": "Texto tamanho padrão (fator de escala: ",
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/painting.dart';
|
||||
import 'package:flutter_app/views/messageview.dart';
|
||||
import 'package:flutter_app/widgets/profileimage.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import '../main.dart';
|
||||
import '../model.dart';
|
||||
import '../opaque.dart';
|
||||
import '../settings.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class ContactRow extends StatefulWidget {
|
||||
@override
|
||||
|
@ -33,17 +34,20 @@ class _ContactRowState extends State<ContactRow> {
|
|||
border: contact.status == "Authenticated" ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor() : Provider.of<Settings>(context).theme.portraitOfflineBorderColor()),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
contact.nickname, //(contact.isInvitation ? "invite " : "non-invite ") + (contact.isBlocked ? "blokt" : "nonblokt"),//
|
||||
style: Provider.of<FlwtchState>(context).biggerFont,
|
||||
softWrap: true,
|
||||
overflow: TextOverflow.visible,
|
||||
),
|
||||
Text(contact.status),
|
||||
],
|
||||
)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
contact.nickname, //(contact.isInvitation ? "invite " : "non-invite ") + (contact.isBlocked ? "blokt" : "nonblokt"),//
|
||||
style: Provider.of<FlwtchState>(context).biggerFont,
|
||||
softWrap: true,
|
||||
overflow: TextOverflow.visible,
|
||||
),
|
||||
Text(contact.onion),
|
||||
],
|
||||
))),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: contact.isInvitation != null && contact.isInvitation
|
||||
|
@ -51,13 +55,13 @@ class _ContactRowState extends State<ContactRow> {
|
|||
IconButton(
|
||||
padding: EdgeInsets.zero,
|
||||
iconSize: 16,
|
||||
icon: Icon(Icons.favorite, color: Opaque.current().mainTextColor()),
|
||||
icon: Icon(Icons.favorite, color: Provider.of<Settings>(context).theme.mainTextColor()),
|
||||
onPressed: _btnApprove,
|
||||
),
|
||||
IconButton(
|
||||
padding: EdgeInsets.zero,
|
||||
iconSize: 16,
|
||||
icon: Icon(Icons.delete, color: Opaque.current().mainTextColor()),
|
||||
icon: Icon(Icons.delete, color: Provider.of<Settings>(context).theme.mainTextColor()),
|
||||
onPressed: _btnReject,
|
||||
)
|
||||
])
|
||||
|
@ -65,10 +69,10 @@ class _ContactRowState extends State<ContactRow> {
|
|||
? IconButton(
|
||||
padding: EdgeInsets.zero,
|
||||
iconSize: 16,
|
||||
icon: Icon(Icons.block, color: Opaque.current().mainTextColor()),
|
||||
icon: Icon(Icons.block, color: Provider.of<Settings>(context).theme.mainTextColor()),
|
||||
onPressed: () {},
|
||||
)
|
||||
: Text(contact.unreadMessages.toString())),
|
||||
: Text(dateToNiceString(contact.lastMessageTime))),
|
||||
),
|
||||
]),
|
||||
onTap: () {
|
||||
|
@ -109,4 +113,11 @@ class _ContactRowState extends State<ContactRow> {
|
|||
.cwtch
|
||||
.BlockContact(Provider.of<ContactInfoState>(context, listen: false).profileOnion, Provider.of<ContactInfoState>(context, listen: false).onion);
|
||||
}
|
||||
|
||||
String dateToNiceString(DateTime date) {
|
||||
if (date.millisecondsSinceEpoch == 0) {
|
||||
return AppLocalizations.of(context).dateNever;
|
||||
}
|
||||
return DateFormat.yMd().add_jm().format(date.toLocal());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue