This repository has been archived by the owner on Jun 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding image expression * Changing the image component and adding tests * small modification * change navigation type screen * implement context tab bar + navigationbar * adding image test * adding test to navigationBar item with context * change demo + remove deprecated * renaming typealias + fixes * fixing comment * updating snapshot test * just reducing snapshot image size * code indentation * image configure binding fix * fix markDirty * refactoring tab bar * adding image black hole * fixing some bugs + tests * fix indicator * fixing size * organize methods * fixing item size and tests * undoing expression test change * undoing expression test change * removing unecessary condition * removing unecessary function * different approach instead of using addBindin * apply style improvements * removing unecessary code * adding scrollView to the image screen * change in animation of the component * change in animation of the component * remove swiftlint:disable * fix image-tests * change tabbar scroll Co-authored-by: theffc <[email protected]> Co-authored-by: Gabriela Coelho <[email protected]> Co-authored-by: Daniel Tes Carrasque <[email protected]> Co-authored-by: Lucas Araújo <[email protected]>
- Loading branch information
1 parent
19b3500
commit 56874de
Showing
56 changed files
with
966 additions
and
649 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
iOS/Example/BeagleDemo/BeagleDemo/Assets.xcassets/beagle.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "beagle.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} | ||
} |
Binary file added
BIN
+34.4 KB
iOS/Example/BeagleDemo/BeagleDemo/Assets.xcassets/beagle.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+36.8 KB
iOS/Example/BeagleDemo/BeagleDemo/Assets.xcassets/beagle.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
iOS/Example/BeagleDemo/BeagleDemo/Assets.xcassets/blackHole.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "buracoNegro.jpg", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+7.63 KB
...xample/BeagleDemo/BeagleDemo/Assets.xcassets/blackHole.imageset/buracoNegro.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
iOS/Example/BeagleDemo/BeagleDemo/CodeGeneration/Generated/AutoDecodable.generated.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
iOS/Example/BeagleDemo/BeagleDemo/CodeGeneration/Generated/Equality.generated.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
iOS/Example/BeagleDemo/BeagleDemo/Screens/ImageScreen.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/* | ||
* Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import UIKit | ||
import Beagle | ||
import BeagleSchema | ||
|
||
struct ImageScreen: DeeplinkScreen { | ||
|
||
init(path: String, data: [String: String]?) { | ||
// Intentionally unimplemented... | ||
} | ||
|
||
func screenController() -> UIViewController { | ||
return Beagle.screen(.declarative(screen)) | ||
} | ||
|
||
var screen: Screen { | ||
return Screen( | ||
navigationBar: NavigationBar(title: "Image"), | ||
child: container() | ||
) | ||
} | ||
|
||
private let sizeImage = WidgetProperties( | ||
style: Style( | ||
size: Size().height(100).width(100), | ||
flex: Flex().alignSelf(.center) | ||
) | ||
) | ||
|
||
private func container() -> Container { | ||
return Container(context: Context( | ||
id: "img", | ||
value: [ | ||
"remote": .string(.networkImageBeagle), | ||
"local": "imageBeagle", | ||
"pathLocal": ["_beagleImagePath_": "local", "mobileId": "imageBeagle"], | ||
"pathRemote": ["_beagleImagePath_": "remote", "url": .string(.networkImageBeagle)] | ||
] | ||
)) { | ||
ScrollView { | ||
createText(text: "Image url with context!") | ||
Image( | ||
.remote(Image.Remote(url: "@{img.remote}")), | ||
widgetProperties: sizeImage | ||
) | ||
|
||
createText(text: "Image mobileId with context!") | ||
Image( | ||
.local("@{img.local}"), | ||
widgetProperties: sizeImage | ||
) | ||
createText(text: "Image with type remote path with context!") | ||
Image( | ||
"@{img.pathRemote}", | ||
widgetProperties: sizeImage | ||
) | ||
createText(text: "Image with type local path with context!") | ||
Image( | ||
"@{img.pathLocal}", | ||
widgetProperties: sizeImage | ||
) | ||
createText(text: "Image url without context!") | ||
Image( | ||
.remote(.init(url: .networkImageBeagle)), | ||
widgetProperties: sizeImage | ||
) | ||
|
||
createText(text: "Image mobileId without context!") | ||
Image( | ||
.local("beagle"), | ||
widgetProperties: sizeImage | ||
) | ||
|
||
Button( | ||
text: "Chage Context", | ||
onPress: [ | ||
SetContext( | ||
contextId: "img", | ||
value: [ | ||
"remote": "https://cdn.eso.org/images/screen/eso1907a.jpg", | ||
"local": "beagle", | ||
"pathLocal": ["_beagleImagePath_": "local", "mobileId": "beagle"], | ||
"pathRemote": ["_beagleImagePath_": "remote", "url": "https://cdn.eso.org/images/screen/eso1907a.jpg"] | ||
] | ||
) | ||
] | ||
) | ||
} | ||
} | ||
} | ||
|
||
private func createText(text: String) -> Text { | ||
return Text( | ||
.value(text), | ||
widgetProperties: WidgetProperties( | ||
style: Style( | ||
margin: EdgeValue().vertical(10), | ||
flex: Flex().alignSelf(.center) | ||
) | ||
) | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.