Skip to content

Commit

Permalink
fixup! TW-2099: Update padding in chat
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev committed Oct 24, 2024
1 parent 57ec515 commit f73c3e3
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 66 deletions.
8 changes: 4 additions & 4 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ target 'Runner' do

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))

target 'Twake Share' do
inherit! :search_paths
end
# target 'Twake Share' do
# inherit! :search_paths
# end
end

post_install do |installer|
Expand Down Expand Up @@ -66,4 +66,4 @@ post_install do |installer|
end
end
flutter_post_install(installer) if defined?(flutter_post_install)
end
end
74 changes: 28 additions & 46 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 60;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -86,7 +86,6 @@
C1005C45261071B5002F4F32 /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1005C44261071B5002F4F32 /* ShareViewController.swift */; };
C1005C4C261071B5002F4F32 /* Twake Share.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = C1005C42261071B5002F4F32 /* Twake Share.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
C149567C25C7274F00A16396 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C149567B25C7274F00A16396 /* GoogleService-Info.plist */; };
E388818A944B178F69E4431D /* Pods_Twake_Share.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB50B9422955BF92FC0FEB3C /* Pods_Twake_Share.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -271,8 +270,6 @@
1B6C59111A74FF0BB750A10A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
216064C73ECC2AECB9F0A1FA /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3D818CE626126D8D1C67A3C9 /* Pods-Twake Share.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Twake Share.release.xcconfig"; path = "Target Support Files/Pods-Twake Share/Pods-Twake Share.release.xcconfig"; sourceTree = "<group>"; };
48F3E70A44AA65D69E70C12D /* Pods-Twake Share.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Twake Share.profile.xcconfig"; path = "Target Support Files/Pods-Twake Share/Pods-Twake Share.profile.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
Expand All @@ -284,14 +281,12 @@
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B16AB66899BBD65C9BFB2599 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
BD7FC81DBDE4B0D093DEFFCB /* Pods-Twake Share.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Twake Share.debug.xcconfig"; path = "Target Support Files/Pods-Twake Share/Pods-Twake Share.debug.xcconfig"; sourceTree = "<group>"; };
C1005C42261071B5002F4F32 /* Twake Share.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Twake Share.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
C1005C44261071B5002F4F32 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = "<group>"; };
C1005C49261071B5002F4F32 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C1005C53261072D4002F4F32 /* Twake Share.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Twake Share.entitlements"; sourceTree = "<group>"; };
C149567B25C7274F00A16396 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
C149567D25C7276200A16396 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
DB50B9422955BF92FC0FEB3C /* Pods_Twake_Share.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Twake_Share.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FDBA7311CF00074CB7786C33 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -325,7 +320,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E388818A944B178F69E4431D /* Pods_Twake_Share.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -458,7 +452,6 @@
isa = PBXGroup;
children = (
B16AB66899BBD65C9BFB2599 /* Pods_Runner.framework */,
DB50B9422955BF92FC0FEB3C /* Pods_Twake_Share.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -531,9 +524,6 @@
1B6C59111A74FF0BB750A10A /* Pods-Runner.debug.xcconfig */,
FDBA7311CF00074CB7786C33 /* Pods-Runner.release.xcconfig */,
216064C73ECC2AECB9F0A1FA /* Pods-Runner.profile.xcconfig */,
BD7FC81DBDE4B0D093DEFFCB /* Pods-Twake Share.debug.xcconfig */,
3D818CE626126D8D1C67A3C9 /* Pods-Twake Share.release.xcconfig */,
48F3E70A44AA65D69E70C12D /* Pods-Twake Share.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
Expand Down Expand Up @@ -583,6 +573,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
5F91C032622C7759B233FC58 /* [CP] Embed Pods Frameworks */,
8A612791CBA199A3967BDAEC /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -599,7 +590,6 @@
isa = PBXNativeTarget;
buildConfigurationList = C1005C51261071B5002F4F32 /* Build configuration list for PBXNativeTarget "Twake Share" */;
buildPhases = (
265995452BC4DC2D49CADCC6 /* [CP] Check Pods Manifest.lock */,
C1005C3E261071B5002F4F32 /* Sources */,
C1005C3F261071B5002F4F32 /* Frameworks */,
C1005C40261071B5002F4F32 /* Resources */,
Expand All @@ -623,7 +613,7 @@
New,
);
LastSwiftUpdateCheck = 1500;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
06EA9C142B21CDE000351529 = {
Expand Down Expand Up @@ -674,9 +664,9 @@
mainGroup = 97C146E51CF9000F007C117D;
packageReferences = (
06EA9CA02B21CFC000351529 /* XCRemoteSwiftPackageReference "DTCoreText" */,
06EA9CA32B21D09D00351529 /* XCRemoteSwiftPackageReference "DeviceKit" */,
06EA9CA32B21D09D00351529 /* XCRemoteSwiftPackageReference "DeviceKit.git" */,
06EA9CA62B21D13300351529 /* XCRemoteSwiftPackageReference "matrix-rust-components-swift" */,
06EA9CA92B21D17200351529 /* XCLocalSwiftPackageReference "NSE/DesignKit" */,
06EA9CA92B21D17200351529 /* XCLocalSwiftPackageReference "DesignKit" */,
06EA9CAC2B21D2CA00351529 /* XCRemoteSwiftPackageReference "LRUCache" */,
06EA9CAF2B21D2FE00351529 /* XCRemoteSwiftPackageReference "KeychainAccess" */,
06EA9CB22B21D33700351529 /* XCRemoteSwiftPackageReference "Kingfisher" */,
Expand Down Expand Up @@ -727,28 +717,6 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
265995452BC4DC2D49CADCC6 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Twake Share-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
Expand Down Expand Up @@ -782,6 +750,23 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
8A612791CBA199A3967BDAEC /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
Expand Down Expand Up @@ -1192,7 +1177,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -1290,7 +1275,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -1340,7 +1325,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -1436,7 +1421,6 @@
};
C1005C4E261071B5002F4F32 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BD7FC81DBDE4B0D093DEFFCB /* Pods-Twake Share.debug.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down Expand Up @@ -1477,7 +1461,6 @@
};
C1005C4F261071B5002F4F32 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3D818CE626126D8D1C67A3C9 /* Pods-Twake Share.release.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down Expand Up @@ -1515,7 +1498,6 @@
};
C1005C50261071B5002F4F32 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 48F3E70A44AA65D69E70C12D /* Pods-Twake Share.profile.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down Expand Up @@ -1597,7 +1579,7 @@
/* End XCConfigurationList section */

/* Begin XCLocalSwiftPackageReference section */
06EA9CA92B21D17200351529 /* XCLocalSwiftPackageReference "NSE/DesignKit" */ = {
06EA9CA92B21D17200351529 /* XCLocalSwiftPackageReference "DesignKit" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = NSE/DesignKit;
};
Expand Down Expand Up @@ -1636,7 +1618,7 @@
version = 1.6.26;
};
};
06EA9CA32B21D09D00351529 /* XCRemoteSwiftPackageReference "DeviceKit" */ = {
06EA9CA32B21D09D00351529 /* XCRemoteSwiftPackageReference "DeviceKit.git" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/devicekit/DeviceKit.git";
requirement = {
Expand Down Expand Up @@ -1701,7 +1683,7 @@
};
06EA9CA42B21D09D00351529 /* DeviceKit */ = {
isa = XCSwiftPackageProductDependency;
package = 06EA9CA32B21D09D00351529 /* XCRemoteSwiftPackageReference "DeviceKit" */;
package = 06EA9CA32B21D09D00351529 /* XCRemoteSwiftPackageReference "DeviceKit.git" */;
productName = DeviceKit;
};
06EA9CA72B21D13300351529 /* MatrixRustSDK */ = {
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/chat/chat_loading_view.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:math';

import 'package:fluffychat/pages/chat/chat_loading_view_style.dart';
import 'package:fluffychat/pages/chat/chat_view_body_style.dart';
import 'package:flutter/material.dart';
import 'package:skeletons/skeletons.dart';
Expand All @@ -23,7 +24,7 @@ class ChatLoadingView extends StatelessWidget {
itemBuilder: (context, index) {
if (index < 3) {
return Padding(
padding: const EdgeInsets.all(8.0),
padding: ChatLoadingViewStyle.padding(context),
child: SkeletonItem(
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
Expand Down
12 changes: 12 additions & 0 deletions lib/pages/chat/chat_loading_view_style.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:fluffychat/di/global/get_it_initializer.dart';
import 'package:fluffychat/utils/responsive/responsive_utils.dart';
import 'package:flutter/material.dart';

class ChatLoadingViewStyle {
static ResponsiveUtils responsive = getIt.get<ResponsiveUtils>();

static EdgeInsets padding(BuildContext context) => EdgeInsets.symmetric(
vertical: 8,
horizontal: responsive.isMobile(context) ? 8 : 16,
);
}
34 changes: 20 additions & 14 deletions lib/pages/chat/events/message/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -317,22 +317,28 @@ class _MessageState extends State<Message> {
}

if (sameSender && !ownMessage) {
return FutureBuilder<User?>(
future: event.fetchSenderUser(),
builder: (context, snapshot) {
final user = snapshot.data ?? event.senderFromMemoryOrFallback;
return Avatar(
size: MessageStyle.avatarSize,
fontSize: MessageStyle.fontSize,
mxContent: user.avatarUrl,
name: user.calcDisplayname(),
onTap: () => widget.onAvatarTap!(event),
);
},
return Padding(
padding: MessageStyle.paddingAvatar,
child: FutureBuilder<User?>(
future: event.fetchSenderUser(),
builder: (context, snapshot) {
final user = snapshot.data ?? event.senderFromMemoryOrFallback;
return Avatar(
size: MessageStyle.avatarSize,
fontSize: MessageStyle.fontSize,
mxContent: user.avatarUrl,
name: user.calcDisplayname(),
onTap: () => widget.onAvatarTap!(event),
);
},
),
);
}

return const SizedBox(width: MessageStyle.avatarSize);
return const Padding(
padding: MessageStyle.paddingAvatar,
child: SizedBox(width: MessageStyle.avatarSize),
);
}

Widget _messageSelectedWidget(
Expand All @@ -342,7 +348,7 @@ class _MessageState extends State<Message> {
) {
return Container(
padding: EdgeInsets.only(
left: Message.responsiveUtils.isMobile(context) ? 8.0 : 16.0,
left: Message.responsiveUtils.isMobile(context) ? 8.0 : 0,
),
color: widget.selected
? LinagoraSysColors.material().secondaryContainer
Expand Down
5 changes: 4 additions & 1 deletion lib/pages/chat/events/message/message_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ class MessageStyle {
top: 4.0 * AppConfig.bubbleSizeFactor,
);

static const EdgeInsets paddingAvatar = EdgeInsets.only(
right: 8.0,
);

static EdgeInsetsDirectional paddingMessageContainer(
bool displayTime,
BuildContext context,
Expand All @@ -117,7 +121,6 @@ class MessageStyle {
nextEvent,
event,
),
start: 8,
end: selected || responsiveUtils.isDesktop(context) ? 8 : 0,
);
}
Expand Down

0 comments on commit f73c3e3

Please sign in to comment.