Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[menu-bar] Migrate ProgressIndicator to Expo Modules #150

Merged
merged 4 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

### 🎉 New features

- Add support for launching Expo updates. ([#134](https://github.com/expo/orbit/pull/134), [#137](https://github.com/expo/orbit/pull/137), [#138](https://github.com/expo/orbit/pull/138), [#144](https://github.com/expo/orbit/pull/144) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Add support for launching Expo updates. ([#134](https://github.com/expo/orbit/pull/134), [#137](https://github.com/expo/orbit/pull/137), [#138](https://github.com/expo/orbit/pull/138), [#144](https://github.com/expo/orbit/pull/144), [#148](https://github.com/expo/orbit/pull/148) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Add support for Snack EAS Update URLs to support SDK 50. ([#147](https://github.com/expo/orbit/pull/147) by [@bycedric](https://github.com/byCedric))

Expand All @@ -20,6 +19,7 @@
- Migrate FilePicker to Expo Modules. ([#132](https://github.com/expo/orbit/pull/132) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Upgrade `react-native` to 0.73.2. ([#143](https://github.com/expo/orbit/pull/143) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Upgrade `react-native-svg` to 14.1.0. ([#143](https://github.com/expo/orbit/pull/143) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Migrate ProgressIndicator to Expo Modules. ([#150](https://github.com/expo/orbit/pull/150) by [@gabrieldonadel](https://github.com/gabrieldonadel))

## 1.0.2 — 2024-01-17

Expand Down

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions apps/menu-bar/macos/ExpoMenuBar-macOS/ProgressIndicatorView.h

This file was deleted.

98 changes: 0 additions & 98 deletions apps/menu-bar/macos/ExpoMenuBar-macOS/ProgressIndicatorView.m

This file was deleted.

12 changes: 0 additions & 12 deletions apps/menu-bar/macos/ExpoMenuBar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
514201552437B4B40078DB4F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 514201532437B4B40078DB4F /* Main.storyboard */; };
514201582437B4B40078DB4F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 514201572437B4B40078DB4F /* main.m */; };
77818F2A6E488E8B68D317B2 /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = B02E22FAC6ED05060D31BB51 /* ExpoModulesProvider.swift */; };
C0271C582A602CDE0065AB11 /* ProgressIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C0271C572A602CDE0065AB11 /* ProgressIndicatorManager.m */; };
C0271C5B2A602FF60065AB11 /* ProgressIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = C0271C5A2A602FF60065AB11 /* ProgressIndicatorView.m */; };
C032EDB72A1FE6F300FBC597 /* orbit-cli-arm64 in Resources */ = {isa = PBXBuildFile; fileRef = C032EDB62A1FE6F300FBC597 /* orbit-cli-arm64 */; };
C051E6B62A83577800C6D615 /* orbit-cli-x64 in Resources */ = {isa = PBXBuildFile; fileRef = C051E6B52A83577800C6D615 /* orbit-cli-x64 */; };
C051E6BB2A991C4200C6D615 /* WebAuthenticationSession.m in Sources */ = {isa = PBXBuildFile; fileRef = C051E6BA2A991C4200C6D615 /* WebAuthenticationSession.m */; };
Expand Down Expand Up @@ -69,10 +67,6 @@
9D32DFD059D5DB6DDEF38881 /* Pods-Shared-ExpoMenuBar-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Shared-ExpoMenuBar-iOS.debug.xcconfig"; path = "Target Support Files/Pods-Shared-ExpoMenuBar-iOS/Pods-Shared-ExpoMenuBar-iOS.debug.xcconfig"; sourceTree = "<group>"; };
A82DFB63B157C65E5D698CA2 /* Pods-Shared-ExpoMenuBar-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Shared-ExpoMenuBar-iOS.release.xcconfig"; path = "Target Support Files/Pods-Shared-ExpoMenuBar-iOS/Pods-Shared-ExpoMenuBar-iOS.release.xcconfig"; sourceTree = "<group>"; };
B02E22FAC6ED05060D31BB51 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-ExpoMenuBar-macOS/ExpoModulesProvider.swift"; sourceTree = "<group>"; };
C0271C562A602CCB0065AB11 /* ProgressIndicatorManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProgressIndicatorManager.h; sourceTree = "<group>"; };
C0271C572A602CDE0065AB11 /* ProgressIndicatorManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ProgressIndicatorManager.m; sourceTree = "<group>"; };
C0271C592A602FEC0065AB11 /* ProgressIndicatorView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProgressIndicatorView.h; sourceTree = "<group>"; };
C0271C5A2A602FF60065AB11 /* ProgressIndicatorView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ProgressIndicatorView.m; sourceTree = "<group>"; };
C032EDB62A1FE6F300FBC597 /* orbit-cli-arm64 */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = "orbit-cli-arm64"; path = "../../cli/orbit-cli-arm64"; sourceTree = "<group>"; };
C051E6B32A83408800C6D615 /* ExpoMenuBar-macOSRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "ExpoMenuBar-macOSRelease.entitlements"; sourceTree = "<group>"; };
C051E6B42A8340AF00C6D615 /* AutoLauncherRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AutoLauncherRelease.entitlements; sourceTree = "<group>"; };
Expand Down Expand Up @@ -205,10 +199,6 @@
C0523ECF2A55980D003371AF /* WindowWithDeallocCallback.m */,
C08E65332A5D04910079E3A9 /* WindowNavigator.m */,
C08E65352A5D0A580079E3A9 /* WindowNavigator.h */,
C0271C562A602CCB0065AB11 /* ProgressIndicatorManager.h */,
C0271C572A602CDE0065AB11 /* ProgressIndicatorManager.m */,
C0271C592A602FEC0065AB11 /* ProgressIndicatorView.h */,
C0271C5A2A602FF60065AB11 /* ProgressIndicatorView.m */,
C051E6B92A991C0A00C6D615 /* WebAuthenticationSession.h */,
C051E6BA2A991C4200C6D615 /* WebAuthenticationSession.m */,
C051EC0D2AA227C600C6D615 /* SwifterWrapper.swift */,
Expand Down Expand Up @@ -512,11 +502,9 @@
C06B8F8A2AAA9024009F2BB5 /* FileHandler.m in Sources */,
C0523ED02A55980D003371AF /* WindowWithDeallocCallback.m in Sources */,
C06B8F902AAB77D0009F2BB5 /* DragDropStatusItemView.m in Sources */,
C0271C582A602CDE0065AB11 /* ProgressIndicatorManager.m in Sources */,
C0B36EA32A65E25A004F2D8C /* CheckboxManager.m in Sources */,
C0C820022AB8E5EE003D75AF /* SparkleModule.m in Sources */,
C06B8F8D2AAA9058009F2BB5 /* FileHandlerManager.m in Sources */,
C0271C5B2A602FF60065AB11 /* ProgressIndicatorView.m in Sources */,
C051EC0E2AA227C600C6D615 /* SwifterWrapper.swift in Sources */,
C051E6BB2A991C4200C6D615 /* WebAuthenticationSession.m in Sources */,
C0523ECC2A550983003371AF /* WindowManager.m in Sources */,
Expand Down
6 changes: 6 additions & 0 deletions apps/menu-bar/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ PODS:
- MMKV (1.3.0):
- MMKVCore (~> 1.3.0)
- MMKVCore (1.3.0)
- ProgressIndicator (1.0.0):
- ExpoModulesCore
- RCT-Folly (2022.05.16.00):
- boost
- DoubleConversion
Expand Down Expand Up @@ -1105,6 +1107,7 @@ DEPENDENCIES:
- hermes-engine (from `../../../node_modules/react-native-macos/sdks/hermes-engine/hermes-engine.podspec`)
- libevent (~> 2.1.12)
- MenuBar (from `../modules/menu-bar/ios`)
- ProgressIndicator (from `../modules/progress-indicator/ios`)
- RCT-Folly (from `../../../node_modules/react-native-macos/third-party-podspecs/RCT-Folly.podspec`)
- RCT-Folly/Fabric (from `../../../node_modules/react-native-macos/third-party-podspecs/RCT-Folly.podspec`)
- RCTRequired (from `../../../node_modules/react-native-macos/Libraries/RCTRequired`)
Expand Down Expand Up @@ -1195,6 +1198,8 @@ EXTERNAL SOURCES:
:tag: hermes-2023-11-17-RNv0.73.0-21043a3fc062be445e56a2c10ecd8be028dd9cc5
MenuBar:
:path: "../modules/menu-bar/ios"
ProgressIndicator:
:path: "../modules/progress-indicator/ios"
RCT-Folly:
:podspec: "../../../node_modules/react-native-macos/third-party-podspecs/RCT-Folly.podspec"
RCTRequired:
Expand Down Expand Up @@ -1305,6 +1310,7 @@ SPEC CHECKSUMS:
MenuBar: d81681b6da1a7ab4bb05a9b3d08357754b908d34
MMKV: 9c6c3fa4ddd849f28c7b9a5c9d23aab84f14ee35
MMKVCore: 9bb7440b170181ac5b81f542ac258103542e693d
ProgressIndicator: 3244d7c774e6f665494acef41a9937a93147ad43
RCT-Folly: 270f9eebb5a7d757382d0438ea993e4d7aa85932
RCTRequired: 47fe8eedbbc5a1869b4b6327daa196c740fbd644
RCTTypeSafety: 1b7ac43d753fa2957f693e129d7000f2f9df76a6
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"platforms": ["apple", "web"],
"apple": {
"modules": ["ProgressIndicatorModule"]
}
}
3 changes: 3 additions & 0 deletions apps/menu-bar/modules/progress-indicator/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ProgressIndicator from './src/ProgressIndicatorView';

export { ProgressIndicator };
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Pod::Spec.new do |s|
s.name = 'ProgressIndicator'
s.version = '1.0.0'
s.summary = 'A sample project summary'
s.description = 'A sample project description'
s.author = ''
s.homepage = 'https://docs.expo.dev/modules/'
s.platform = :osx, '10.15'
s.source = { git: '' }
s.static_framework = true

s.dependency 'ExpoModulesCore'

# Swift/Objective-C compatibility
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'SWIFT_COMPILATION_MODE' => 'wholemodule'
}

s.source_files = "**/*.{h,m,mm,swift,hpp,cpp}"
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import ExpoModulesCore

public class ProgressIndicatorModule: Module {
public func definition() -> ModuleDefinition {
Name("ProgressIndicator")

View(ProgressIndicatorView.self) {
Prop("indeterminate") { (view, isIndeterminate: Bool?) in
if let isIndeterminate {
view.setIndeterminate(isIndeterminate)
} else {
view.setIndeterminate(false)
}
}

Prop("progress") { (view, progress: Double) in
view.setProgress(progress)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import ExpoModulesCore

class ProgressIndicatorView: ExpoView {
let progressIndicatorView = NSProgressIndicator()

required init(appContext: AppContext? = nil) {
super.init(appContext: appContext)
clipsToBounds = true

progressIndicatorView.style = .bar
progressIndicatorView.minValue = 0.0
progressIndicatorView.maxValue = 100.0
addSubview(progressIndicatorView)
}

override func layoutSubviews() {
progressIndicatorView.frame = bounds
}

func setIndeterminate(_ indeterminate: Bool) {
progressIndicatorView.isIndeterminate = indeterminate
if indeterminate {
progressIndicatorView.startAnimation(nil)
} else {
progressIndicatorView.stopAnimation(self)
}
}

func setProgress(_ progress: Double) {
progressIndicatorView.doubleValue = progress

if progressIndicatorView.isIndeterminate {
setIndeterminate(false)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { ViewProps } from 'react-native';

export type ProgressIndicatorViewProps = ViewProps & {
progress?: number;
indeterminate?: boolean;
size?: 'small' | 'large';
};
Loading
Loading