Merge pull request #4661 from pangeachat/activity_text_background
Activity text background
This commit is contained in:
commit
c526b99db9
3 changed files with 78 additions and 65 deletions
|
|
@ -56,28 +56,25 @@ class ActivityRolesEvent extends StatelessWidget {
|
|||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 4.0),
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Material(
|
||||
color: theme.colorScheme.surface.withAlpha(128),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 3),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8.0,
|
||||
vertical: 4.0,
|
||||
),
|
||||
child: Text(
|
||||
"${role.stateEventMessage(displayName, L10n.of(context))}",
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 12 * AppConfig.fontSizeFactor,
|
||||
decoration:
|
||||
event.redacted ? TextDecoration.lineThrough : null,
|
||||
),
|
||||
child: Material(
|
||||
color: theme.colorScheme.surface.withAlpha(128),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 3),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8.0,
|
||||
vertical: 4.0,
|
||||
),
|
||||
child: Text(
|
||||
"${role.stateEventMessage(displayName, L10n.of(context))}",
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 12 * AppConfig.fontSizeFactor,
|
||||
decoration:
|
||||
event.redacted ? TextDecoration.lineThrough : null,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class ActivitySummary extends StatelessWidget {
|
|||
),
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surface.withAlpha(220),
|
||||
color: theme.colorScheme.surface.withAlpha(128),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
child: Padding(
|
||||
|
|
@ -101,7 +101,7 @@ class ActivitySummary extends StatelessWidget {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
InkWell(
|
||||
hoverColor: theme.colorScheme.surfaceTint.withAlpha(200),
|
||||
hoverColor: theme.colorScheme.surfaceTint.withAlpha(55),
|
||||
onTap: toggleInstructions,
|
||||
child: Column(
|
||||
spacing: 4.0,
|
||||
|
|
|
|||
|
|
@ -28,51 +28,67 @@ class ActivityUserSummaries extends StatelessWidget {
|
|||
final summary = room.activitySummary?.summary;
|
||||
if (summary == null) return const SizedBox();
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
spacing: 4.0,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
L10n.of(context).activityFinishedMessage,
|
||||
),
|
||||
Text(
|
||||
summary.summary,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 8.0,
|
||||
return Column(
|
||||
spacing: 4.0,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 4.0),
|
||||
child: Center(
|
||||
child: Material(
|
||||
color: Theme.of(context).colorScheme.surface.withAlpha(128),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 3),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
|
||||
child: Column(
|
||||
spacing: 4.0,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
L10n.of(context).activityFinishedMessage,
|
||||
),
|
||||
Text(
|
||||
summary.summary,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
ButtonControlledCarouselView(
|
||||
summary: summary,
|
||||
controller: controller,
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 8.0,
|
||||
),
|
||||
// Row(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
// children: userSummaries.map((p) {
|
||||
// final user = room.getParticipants().firstWhereOrNull(
|
||||
// (u) => u.id == p.participantId,
|
||||
// );
|
||||
// final userRole = assignedRoles.values.firstWhere(
|
||||
// (role) => role.userId == p.participantId,
|
||||
// );
|
||||
// final userRoleInfo = availableRoles[userRole.id]!;
|
||||
// return ActivityParticipantIndicator(
|
||||
// availableRole: userRoleInfo,
|
||||
// assignedRole: userRole,
|
||||
// avatarUrl:
|
||||
// userRoleInfo.avatarUrl ?? user?.avatarUrl?.toString(),
|
||||
// borderRadius: BorderRadius.circular(4),
|
||||
// selected: controller.highlightedRole?.id == userRole.id,
|
||||
// onTap: () => controller.highlightRole(userRole),
|
||||
// );
|
||||
// }).toList(),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
ButtonControlledCarouselView(
|
||||
summary: summary,
|
||||
controller: controller,
|
||||
),
|
||||
// Row(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
// children: userSummaries.map((p) {
|
||||
// final user = room.getParticipants().firstWhereOrNull(
|
||||
// (u) => u.id == p.participantId,
|
||||
// );
|
||||
// final userRole = assignedRoles.values.firstWhere(
|
||||
// (role) => role.userId == p.participantId,
|
||||
// );
|
||||
// final userRoleInfo = availableRoles[userRole.id]!;
|
||||
// return ActivityParticipantIndicator(
|
||||
// availableRole: userRoleInfo,
|
||||
// assignedRole: userRole,
|
||||
// avatarUrl:
|
||||
// userRoleInfo.avatarUrl ?? user?.avatarUrl?.toString(),
|
||||
// borderRadius: BorderRadius.circular(4),
|
||||
// selected: controller.highlightedRole?.id == userRole.id,
|
||||
// onTap: () => controller.highlightRole(userRole),
|
||||
// );
|
||||
// }).toList(),
|
||||
// ),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue