Commit 14d0d71c authored by Wei Han's avatar Wei Han

code update

parent 81ec60ad
......@@ -9,9 +9,9 @@
/* Begin PBXBuildFile section */
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
44006126336D83DB220E7214 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };
4EC822DE2B433513F31AFB3E /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 40EB36954DDA100CF0424A89 /* libPods-example.a */; };
761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
EEFB98A2480FDDBFC790E56F /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 574BB54B207C088196A9FBBB /* libPods-example.a */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
......@@ -19,11 +19,11 @@
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = "<group>"; };
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = example/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
574BB54B207C088196A9FBBB /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
31FDB50C78AE137D41CF411D /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
40EB36954DDA100CF0424A89 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = example/AppDelegate.swift; sourceTree = "<group>"; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example/LaunchScreen.storyboard; sourceTree = "<group>"; };
85CE699693EE18A8E1C24E42 /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
B696EC4DAEE5EDE78A1EEB18 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; };
824AEC708BA04F5AD482851A /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
......@@ -32,7 +32,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
EEFB98A2480FDDBFC790E56F /* libPods-example.a in Frameworks */,
4EC822DE2B433513F31AFB3E /* libPods-example.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -55,7 +55,7 @@
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
574BB54B207C088196A9FBBB /* libPods-example.a */,
40EB36954DDA100CF0424A89 /* libPods-example.a */,
);
name = Frameworks;
sourceTree = "<group>";
......@@ -92,8 +92,8 @@
BBD78D7AC51CEA395F1C20DB /* Pods */ = {
isa = PBXGroup;
children = (
85CE699693EE18A8E1C24E42 /* Pods-example.debug.xcconfig */,
B696EC4DAEE5EDE78A1EEB18 /* Pods-example.release.xcconfig */,
31FDB50C78AE137D41CF411D /* Pods-example.debug.xcconfig */,
824AEC708BA04F5AD482851A /* Pods-example.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
......@@ -105,13 +105,13 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */;
buildPhases = (
C87E7C1B2ADF35B0CBBA26BF /* [CP] Check Pods Manifest.lock */,
B87419CC63186335BB42ACC9 /* [CP] Check Pods Manifest.lock */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
DE4DC932E04B9540533EF987 /* [CP] Embed Pods Frameworks */,
9DEA634DDB892A12B25520B4 /* [CP] Copy Pods Resources */,
7EA22330F9EEADB32B8DCA0C /* [CP] Embed Pods Frameworks */,
CF5916958D0840FF3C063407 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
......@@ -183,24 +183,24 @@
shellPath = /bin/sh;
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
};
9DEA634DDB892A12B25520B4 /* [CP] Copy Pods Resources */ = {
7EA22330F9EEADB32B8DCA0C /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
C87E7C1B2ADF35B0CBBA26BF /* [CP] Check Pods Manifest.lock */ = {
B87419CC63186335BB42ACC9 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
......@@ -222,21 +222,21 @@
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;
};
DE4DC932E04B9540533EF987 /* [CP] Embed Pods Frameworks */ = {
CF5916958D0840FF3C063407 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
......@@ -255,7 +255,7 @@
/* Begin XCBuildConfiguration section */
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 85CE699693EE18A8E1C24E42 /* Pods-example.debug.xcconfig */;
baseConfigurationReference = 31FDB50C78AE137D41CF411D /* Pods-example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
......@@ -283,7 +283,7 @@
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B696EC4DAEE5EDE78A1EEB18 /* Pods-example.release.xcconfig */;
baseConfigurationReference = 824AEC708BA04F5AD482851A /* Pods-example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
......
......@@ -8,32 +8,32 @@
<key>BinaryPath</key>
<string>QmsPluginFramework.framework/QmsPluginFramework</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>QmsPluginFramework.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>QmsPluginFramework.framework/QmsPluginFramework</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>QmsPluginFramework.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
......
......@@ -409,6 +409,10 @@
self.repInputsContainer.spacing = 8;
self.repInputsContainer.translatesAutoresizingMaskIntoConstraints = NO;
self.repInputsContainer.hidden = YES; // Initially hidden
self.repInputsContainer.clipsToBounds = YES;
self.repInputsHeightConstraint =
[self.repInputsContainer.heightAnchor constraintEqualToConstant:0];
self.repInputsHeightConstraint.active = YES;
[self.contentView addSubview:self.repInputsContainer];
// --- Constraints ---
......@@ -500,19 +504,28 @@
self.icPhotoView.hidden = NO;
self.letterPhotoView.hidden = NO;
[UIView animateWithDuration:0.3 animations:^{
[self.contentView layoutIfNeeded];
// Calculate height (approx. safe fixed height)
CGFloat expandedHeight = 120 // image row
+ 8*4 // titles + fields spacing
+ 40*4; // estimated textfield heights
self.repInputsHeightConstraint.constant = expandedHeight;
[UIView animateWithDuration:0.25 animations:^{
[self.view layoutIfNeeded];
}];
}
- (void)hideRepresentativeInputs {
[UIView animateWithDuration:0.3 animations:^{
self.repInputsHeightConstraint.constant = 0;
self.icPhotoView.hidden = YES;
self.letterPhotoView.hidden = YES;
[UIView animateWithDuration:0.25 animations:^{
self.repInputsContainer.hidden = YES;
self.icPhotoView.hidden = YES;
self.letterPhotoView.hidden = YES;
[self.contentView layoutIfNeeded];
[self.view layoutIfNeeded];
}];
// Optional: clear fields
self.repNameField.text = @"";
self.repICField.text = @"";
......@@ -520,7 +533,6 @@
self.repContactField.text = @"";
}
#pragma mark - helpers
- (void)cancelPressed:(id)sender {
UIAlertController *a = [UIAlertController alertControllerWithTitle:@"Cancel"
......
// DashboardHeaderView.h
#import <UIKit/UIKit.h>
@interface DashboardHeaderView : UIView
@property (nonatomic, strong) UIImageView *backgroundImageView;
@property (nonatomic, strong) UIImageView *overlayImageView;
@property (nonatomic, strong) UILabel *projectNameLabel;
@property (nonatomic, strong) UILabel *unitNameLabel;
@property (nonatomic, strong) UIButton *infoButton;
- (void)configureWithProjectName:(NSString *)projectName
unitName:(NSString *)unitName
backgroundImage:(UIImage *)backgroundImage
overlayImage:(UIImage *)overlayImage;
@end
//DashboardHeaderView.mm
#import "DashboardHeaderView.h"
@implementation DashboardHeaderView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.backgroundColor = [UIColor colorWithRed:0.0 green:0.43 blue:0.55 alpha:1.0]; // #006D8D
// Background image
_backgroundImageView = [[UIImageView alloc] initWithFrame:self.bounds];
_backgroundImageView.contentMode = UIViewContentModeScaleAspectFill;
_backgroundImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self addSubview:_backgroundImageView];
// Overlay image
_overlayImageView = [[UIImageView alloc] initWithFrame:self.bounds];
_overlayImageView.contentMode = UIViewContentModeScaleAspectFill;
_overlayImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
_overlayImageView.alpha = 0.4;
[self addSubview:_overlayImageView];
// Header container (for back, title, menu)
UIView *headerBar = [[UIView alloc] init];
headerBar.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:headerBar];
// Back button part of header now
// Project name (center title)
_projectNameLabel = [[UILabel alloc] init];
_projectNameLabel.textColor = [UIColor whiteColor];
_projectNameLabel.font = [UIFont boldSystemFontOfSize:18];
_projectNameLabel.textAlignment = NSTextAlignmentCenter;
_projectNameLabel.translatesAutoresizingMaskIntoConstraints = NO;
[headerBar addSubview:_projectNameLabel];
// Menu button
// Unit name (bottom left)
_unitNameLabel = [[UILabel alloc] init];
_unitNameLabel.textColor = [UIColor whiteColor];
_unitNameLabel.font = [UIFont boldSystemFontOfSize:20];
_unitNameLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_unitNameLabel];
// Info button (bottom right)
// _infoButton = [UIButton buttonWithType:UIButtonTypeCustom];
// _infoButton.translatesAutoresizingMaskIntoConstraints = NO;
// [_infoButton setImage:[UIImage systemImageNamed:@"info.circle"] forState:UIControlStateNormal];
// _infoButton.tintColor = [UIColor whiteColor];
// [self addSubview:_infoButton];
// Layout constraints
[NSLayoutConstraint activateConstraints:@[
// Header bar top
[headerBar.topAnchor constraintEqualToAnchor:self.safeAreaLayoutGuide.topAnchor constant:0],
[headerBar.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:0],
[headerBar.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:0],
[headerBar.heightAnchor constraintEqualToConstant:44],
// Back button
// Menu button
// Title centered
[_projectNameLabel.centerXAnchor constraintEqualToAnchor:headerBar.centerXAnchor],
[_projectNameLabel.centerYAnchor constraintEqualToAnchor:headerBar.centerYAnchor],
// Unit name bottom-left
[_unitNameLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:16],
[_unitNameLabel.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-16],
// Info button bottom-right
// [_infoButton.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-16],
// [_infoButton.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-18],
// [_infoButton.widthAnchor constraintEqualToConstant:24],
// [_infoButton.heightAnchor constraintEqualToConstant:24],
]];
}
- (void)configureWithProjectName:(NSString *)projectName
unitName:(NSString *)unitName
backgroundImage:(UIImage *)backgroundImage
overlayImage:(UIImage *)overlayImage {
self.projectNameLabel.text = projectName ?: @"Project Name";
self.unitNameLabel.text = unitName ?: @"Unit Name";
self.backgroundImageView.image = backgroundImage ?: [UIImage imageNamed:@"placeholder_header"];
self.overlayImageView.image = overlayImage ?: [UIImage imageNamed:@"placeholder_overlay"];
}
@end
// GeneralInfoViewController.h
#import <UIKit/UIKit.h>
@interface GeneralInfoViewController : UIViewController
@property (nonatomic, strong) NSString *unitID;
@property (nonatomic, strong) NSString *unitName;
@end
......@@ -8,32 +8,32 @@
<key>BinaryPath</key>
<string>QmsPluginFramework.framework/QmsPluginFramework</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>QmsPluginFramework.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>QmsPluginFramework.framework/QmsPluginFramework</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>QmsPluginFramework.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
......
......@@ -4036,13 +4036,13 @@ __metadata:
languageName: node
linkType: hard
"QmsPlugin@git+http://convep.ddns.me:20000/WeiHan/weihan-plugin.git":
"QmsPlugin@file:../::locator=qms-plugin-example%40workspace%3Aexample":
version: 0.1.0
resolution: "QmsPlugin@git+http://convep.ddns.me:20000/WeiHan/weihan-plugin.git#commit=1eec3cd3c23eb7eff0cfdfd7fb189aed9b5d14fc"
resolution: "QmsPlugin@file:../#../::hash=af21c5&locator=qms-plugin-example%40workspace%3Aexample"
peerDependencies:
react: "*"
react-native: "*"
checksum: 2fb7968faaef90c557836de22e96ea10ec933db7d570e09bf5cac2cc73fb84aaf0fb4a0978328e1f3b86a32d06992861798bed9ffe3c53f8735e746dbaffde3f
checksum: 62359d48e334f58417817ce08cbadbc903d955edfcec23fcd1f25e51a95155b0465958c08490b7333e72f4e1272fd5bd0678dd812a5805f8c5daeb7d6c891213
languageName: node
linkType: hard
......@@ -10563,7 +10563,7 @@ __metadata:
"@types/jest": ^29.5.13
"@types/react": ^19.1.0
"@types/react-test-renderer": ^19.1.0
QmsPlugin: "git+http://convep.ddns.me:20000/WeiHan/weihan-plugin.git"
QmsPlugin: "file:../"
eslint: ^8.19.0
jest: ^29.6.3
prettier: 2.8.8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment