Skip to content

Commit

Permalink
fixed web
Browse files Browse the repository at this point in the history
  • Loading branch information
crane-hiromu committed Feb 16, 2020
1 parent 371ac19 commit 36f93cb
Show file tree
Hide file tree
Showing 15 changed files with 515 additions and 22 deletions.
18 changes: 9 additions & 9 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ ios:
certificate: /Users/admin/Scade/profile/appscade.p12
icons:
iphone: # or ipad, sizes: 20X20, 29X29, 40X40, 60X60, 76X76, 83.5X83.5
60X60_2X:
76X76_2X:
76X76_3X:
83.5X83.5_2X:
60X60_2X: /Users/admin/Scade/ScadeKaigi2020/res/AppIcon/icon_60.png
76X76_2X: /Users/admin/Scade/ScadeKaigi2020/res/AppIcon/icon_76.png
76X76_3X: /Users/admin/Scade/ScadeKaigi2020/res/AppIcon/icon_76.png
83.5X83.5_2X: /Users/admin/Scade/ScadeKaigi2020/res/AppIcon/icon_83_5.png
marketing:
1024X1024_1X:
1024X1024_1X: /Users/admin/Scade/ScadeKaigi2020/res/AppIcon/icon_1024.png
plist:
- key: CFBundleShortVersionString
type: string # string, bool, int, list or dict
Expand Down Expand Up @@ -101,7 +101,7 @@ android:
scheme:
categories: []
icons:
mdpi:
hdpi:
xhdpi:
xxhdpi:
mdpi: /Users/admin/Scade/ScadeKaigi2020/res/AppIcon/icon_60.png
hdpi: /Users/admin/Scade/ScadeKaigi2020/res/AppIcon/icon_60.png
xhdpi: /Users/admin/Scade/ScadeKaigi2020/res/AppIcon/icon_60.png
xxhdpi: /Users/admin/Scade/ScadeKaigi2020/res/AppIcon/icon_60.png
Binary file added res/AppIcon/icon_1024.png
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 res/AppIcon/icon_60.png
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 res/AppIcon/icon_76.png
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 res/AppIcon/icon_83_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/extensions/EObjectExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ extension EObject {
return self as? SCDWidgetsSidebar
}

var asWebView: SCDWidgetsWebView? {
return self as? SCDWidgetsWebView
}

var asClikable: SCDWidgetsClickable? {
return self as? SCDWidgetsClickable
}
Expand Down
43 changes: 36 additions & 7 deletions src/pages/menu/sponsor/SponsorPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ScadeKit
protocol SponsorPageDelegate: SCDLatticePageAdapter {
func onBackClicked()
func onItemSelected(with event: SCDWidgetsItemEvent?)
func onSponsorClicked(by type: SponsorType)
}


Expand All @@ -27,7 +28,7 @@ final class SponsorPage {

// MARK: Widgets

lazy var backButton: SCDWidgetsButton! = {
private lazy var backButton: SCDWidgetsButton! = {
let btn = adapter?.page?.getWidgetByName("backButton")?.asButton
btn?.onClick.append(SCDWidgetsEventHandler { [weak self] event in
self?.sponsorPageDelegate?.onBackClicked()
Expand All @@ -37,27 +38,55 @@ final class SponsorPage {

private lazy var goldList: SCDWidgetsList! = {
let list = adapter?.page?.getWidgetByName("goldList")?.asList
list?.onItemSelected.append(SCDWidgetsItemSelectedEventHandler { [weak self] event in
self?.sponsorPageDelegate?.onItemSelected(with: event)
})
// list?.onItemSelected.append(SCDWidgetsItemSelectedEventHandler { [weak self] event in
// self?.sponsorPageDelegate?.onItemSelected(with: event)
// })
return list
}()

private lazy var supporterList: SCDWidgetsList! = {
let list = adapter?.page?.getWidgetByName("supporterList")?.asList
list?.onItemSelected.append(SCDWidgetsItemSelectedEventHandler { [weak self] event in
self?.sponsorPageDelegate?.onItemSelected(with: event)
})
// list?.onItemSelected.append(SCDWidgetsItemSelectedEventHandler { [weak self] event in
// self?.sponsorPageDelegate?.onItemSelected(with: event)
// })
return list
}()

private lazy var zozoButton: SCDWidgetsButton! = {
let btn = adapter?.page?.getWidgetByName("zozoButton")?.asButton
btn?.onClick.append(SCDWidgetsEventHandler { [weak self] event in
self?.sponsorPageDelegate?.onSponsorClicked(by: .platinum(.zozo))
})
return btn
}()

private lazy var yappliButton: SCDWidgetsButton! = {
let btn = adapter?.page?.getWidgetByName("yappliButton")?.asButton
btn?.onClick.append(SCDWidgetsEventHandler { [weak self] event in
self?.sponsorPageDelegate?.onSponsorClicked(by: .platinum(.yappli))
})
return btn
}()

private lazy var yumemiButton: SCDWidgetsButton! = {
let btn = adapter?.page?.getWidgetByName("yumemiButton")?.asButton
btn?.onClick.append(SCDWidgetsEventHandler { [weak self] event in
self?.sponsorPageDelegate?.onSponsorClicked(by: .platinum(.yumemi))
})
return btn
}()


// MARK: Initializer

init(adapter: SponsorPageAdapter?) {
self.adapter = adapter

/// todo access
backButton.isVisible = true
zozoButton.isVisible = true
yappliButton.isVisible = true
yumemiButton.isVisible = true
}

deinit {
Expand Down
91 changes: 91 additions & 0 deletions src/pages/menu/sponsor/SponsorType.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import ScadeKit

// MARK: - Type

enum SponsorType {
case platinum(PlatinumType)
case gold(GoldType)
case supporter(SupporterType)

var name: String {
switch self {
case let .platinum(type): return type.name
case let .gold(type): return type.name
case let .supporter(type): return type.name
}
}

var url: String {
switch self {
case let .platinum(type): return type.url
case let .gold(type): return type.url
case let .supporter(type): return type.url
}
}

var logo: String {
switch self {
case let .platinum(type): return type.logo
case let .gold(type): return type.logo
case let .supporter(type): return type.logo
}
}
}

enum PlatinumType {
case zozo, yappli, yumemi

var name: String {
switch self {
case .zozo: return "株式会社ZOZOテクノロジーズ"
case .yappli: return "株式会社ヤプリ"
case .yumemi: return "株式会社ゆめみ"
}
}

var url: String {
switch self {
case .zozo: return "https://corp.zozo.com/"
case .yappli: return "https://yappli.co.jp/"
case .yumemi: return "https://www.yumemi.co.jp/ja"
}
}

var logo: String {
switch self {
case .zozo: return ""
case .yappli: return ""
case .yumemi: return ""
}
}
}

enum GoldType {

var name: String {
return ""
}

var url: String {
return ""
}

var logo: String {
return ""
}
}

enum SupporterType {

var name: String {
return ""
}

var url: String {
return ""
}

var logo: String {
return ""
}
}
8 changes: 7 additions & 1 deletion src/pages/start.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,15 @@ final class ScadeKaigi2020: SCDApplication {
return adapter
}()

private lazy var webAdapter: WebPageAdapter = {
let adapter = WebPageAdapter()
return adapter
}()


// MARK: Overrides

override func onFinishLaunching() {
override func onFinishLaunching() {
debugPrint("---\(#function)---")

DataManager.shared.call()
Expand All @@ -65,6 +70,7 @@ final class ScadeKaigi2020: SCDApplication {
aboutAdapter.load(type: .about)
mapAdapter.load(type: .map)
sponsorAdapter.load(type: .sponsor)
webAdapter.load(type: .web)

timeTableAdapter.show(window)
}
Expand Down
55 changes: 55 additions & 0 deletions src/pages/web/WebPage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import ScadeKit

// MARK: - Delegate

protocol WebPageDelegate: SCDLatticePageAdapter {
func onBackClicked()
}


// MARK: - View

final class WebPage {

// MARK: Properties

weak var webPageDelegate: WebPageDelegate?
private weak var adapter: WebPageAdapter?

// MARK: Widgets

lazy var backButton: SCDWidgetsButton! = {
let btn = adapter?.page?.getWidgetByName("backButton")?.asButton
btn?.onClick.append(SCDWidgetsEventHandler { [weak self] event in
self?.webPageDelegate?.onBackClicked()
})
return btn
}()

lazy var webView: SCDWidgetsWebView! = {
let web = adapter?.page?.getWidgetByName("webView")?.asWebView
return web
}()


// MARK: Initializer

init(adapter: WebPageAdapter?) {
self.adapter = adapter

/// todo access
backButton.isVisible = true

webView.onLoaded.append(SCDWidgetsLoadEventHandler { event in
print("Page Loaded: \(event)")
})
webView.onLoadFailed.append(SCDWidgetsLoadFailedEventHandler { event in
print("Page failed to load \(event)")
})
}

deinit {
adapter = nil
webPageDelegate = nil
}
}
5 changes: 5 additions & 0 deletions src/sponsor.page.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ extension SponsorPageAdapter: SponsorPageDelegate {

func onItemSelected(with event: SCDWidgetsItemEvent?) {
// todo open url
print(event?.item)
}

func onSponsorClicked(by type: SponsorType) {
navigation?.push(type: .web, data: type.url, transition: .forward)
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/timeTable.page
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,12 @@
<constraints source="/0/@children.1" target="/0" active="true"/>
<constraints source="/0/@children.1" sourceAnchor="BOTTOM" target="/0" targetAnchor="BOTTOM" active="true"/>
</layoutData>
<size width="290" height="896"/>
<size width="40" height="896"/>
<location/>
<layout xsi:type="com.scade.sdk.layout:GridLayout"/>
<minArea/>
<maxArea width="-1" height="-1"/>
<panel xsi:type="com.scade.sdk.view:GridView" name="sidebarView" drawing="/3/@children.1/@children.1/@children.2">
<panel xsi:type="com.scade.sdk.view:GridView" name="sidebarView" drawing="/3/@children.1/@children.1/@children.2" visible="false">
<backgroundColor Red="255" Green="255" Blue="255"/>
<size width="200" height="896"/>
<location/>
Expand Down Expand Up @@ -1462,11 +1462,11 @@
<path>w</path>
</expression>
</constraints>
<width value="290.0"/>
<width value="40.0"/>
<height value="896.0"/>
</children>
<children xsi:type="svg:Group" attributes="{&quot;template-id&quot;:&quot;content&quot;}"/>
<children xsi:type="svg:Group">
<children xsi:type="svg:Group" visible="false">
<children xsi:type="svg:Box" attributes="{&quot;template-id&quot;:&quot;background&quot;}">
<constraints xsi:type="svg_1:DirectConstraint" exprStr="size.h">
<feature xsi:type="ecore:EReference" href="http://scade.com/svg#//draw/Box/height"/>
Expand Down
3 changes: 2 additions & 1 deletion src/utils/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ struct Constants {
}

enum PageType: String {
case timeTable, speakersList, profile, session, info, about, map, sponsor, contributors, setting, questionnaire
case timeTable, speakersList, profile, session, web
case info, about, map, sponsor, contributors, setting, questionnaire // menu

var page: String {
return "\(rawValue).page"
Expand Down
Loading

0 comments on commit 36f93cb

Please sign in to comment.