Skip to content

Commit

Permalink
Update DateCell for storyboards (#41).
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueRiverInteractive committed May 19, 2015
1 parent 9278692 commit fd240f7
Show file tree
Hide file tree
Showing 30 changed files with 491 additions and 205 deletions.
31 changes: 4 additions & 27 deletions DateCell/Info.plist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
<string>${app.build}</string>
<key>LSRequiresIPhoneOS</key>
<true />
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
Expand All @@ -46,32 +50,5 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Icon-Small</string>
<string>Icon-Small-40</string>
<string>Icon</string>
<string>Icon-60</string>
<string>Icon-72</string>
</array>
</dict>
</dict>
<key>CFBundleIcons~ipad</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Icon-Small</string>
<string>Icon-Small-40</string>
<string>Icon-72</string>
<string>Icon-76</string>
</array>
</dict>
</dict>
</dict>
</plist>
136 changes: 136 additions & 0 deletions DateCell/resources/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="EHN-0N-tTT">
<dependencies>
<deployment version="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
</dependencies>
<scenes>
<!--DateCell-->
<scene sceneID="CJd-AB-dcG">
<objects>
<tableViewController id="fV5-Xa-ywr" customClass="MyTableViewController" sceneMemberID="viewController">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="singleLineEtched" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="1Gn-5u-oAN">
<rect key="frame" x="0.0" y="64" width="320" height="460"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="10" reuseIdentifier="dateCell" textLabel="mSV-so-p3w" detailTextLabel="Pnv-OT-hyb" style="IBUITableViewCellStyleValue1" id="wJd-oH-PbC">
<rect key="frame" x="0.0" y="55" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="wJd-oH-PbC" id="HAj-qB-Msp">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="mSV-so-p3w">
<rect key="frame" x="15" y="11" width="34" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</label>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Pnv-OT-hyb">
<rect key="frame" x="264" y="11" width="41" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.2196078431372549" green="0.32941176470588235" blue="0.52941176470588236" alpha="1" colorSpace="calibratedRGB"/>
<color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="datePicker" rowHeight="216" id="sfQ-F6-ID2">
<rect key="frame" x="0.0" y="99" width="320" height="216"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="sfQ-F6-ID2" id="BOE-cd-gdr">
<rect key="frame" x="0.0" y="0.0" width="320" height="215"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<datePicker tag="99" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="date" minuteInterval="1" translatesAutoresizingMaskIntoConstraints="NO" id="crH-vJ-sfY">
<rect key="frame" x="0.0" y="0.0" width="320" height="216"/>
<date key="date" timeIntervalSinceReferenceDate="393205466.33293098">
<!--2013-06-17 23:44:26 +0000-->
</date>
<connections>
<action selector="dateAction:" destination="fV5-Xa-ywr" eventType="valueChanged" id="UtD-zm-bOg"/>
</connections>
</datePicker>
</subviews>
</tableViewCellContentView>
<constraints>
<constraint firstItem="crH-vJ-sfY" firstAttribute="centerY" secondItem="sfQ-F6-ID2" secondAttribute="centerY" id="HBE-sJ-FOW"/>
<constraint firstItem="crH-vJ-sfY" firstAttribute="leading" secondItem="sfQ-F6-ID2" secondAttribute="leading" id="oYF-OA-vXj"/>
<constraint firstItem="crH-vJ-sfY" firstAttribute="top" secondItem="sfQ-F6-ID2" secondAttribute="top" id="ozc-Jj-WIt"/>
<constraint firstItem="crH-vJ-sfY" firstAttribute="trailing" secondItem="sfQ-F6-ID2" secondAttribute="trailing" id="vTV-nr-fMF"/>
</constraints>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="10" reuseIdentifier="otherCell" textLabel="bI4-8Q-5SD" style="IBUITableViewCellStyleDefault" id="4YR-2s-Kkt">
<rect key="frame" x="0.0" y="315" width="320" height="45"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="4YR-2s-Kkt" id="svr-Rl-qfK">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="bI4-8Q-5SD">
<rect key="frame" x="15" y="0.0" width="290" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
</tableView>
<extendedEdge key="edgesForExtendedLayout"/>
<toolbarItems/>
<navigationItem key="navigationItem" title="DateCell" id="VSr-Gr-Klm"/>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="doneButton" destination="hvs-2A-vZU" id="3LA-7U-2lU"/>
<outlet property="pickerView" destination="cd3-Cq-5zY" id="LVj-W2-06g"/>
<outlet property="view" destination="1Gn-5u-oAN" id="Q0y-hb-KvU"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="v7Y-Ds-8hz" userLabel="First Responder" sceneMemberID="firstResponder"/>
<datePicker contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="date" minuteInterval="1" id="cd3-Cq-5zY">
<rect key="frame" x="0.0" y="0.0" width="320" height="216"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<date key="date" timeIntervalSinceReferenceDate="377204788.09288597">
<!--2012-12-14 19:06:28 +0000-->
</date>
<connections>
<action selector="dateAction:" destination="fV5-Xa-ywr" eventType="valueChanged" id="A9q-nU-0K3"/>
</connections>
</datePicker>
<barButtonItem title="Done" style="done" id="hvs-2A-vZU" userLabel="Done Button">
<connections>
<action selector="doneAction:" destination="fV5-Xa-ywr" id="nuR-DF-2in"/>
</connections>
</barButtonItem>
</objects>
<point key="canvasLocation" x="141" y="48"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="sQq-d4-Jq0">
<objects>
<navigationController definesPresentationContext="YES" id="EHN-0N-tTT" sceneMemberID="viewController">
<extendedEdge key="edgesForExtendedLayout"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="JuR-V6-Xdm">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="fV5-Xa-ywr" kind="relationship" relationship="rootViewController" id="lkt-1t-bFk"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="m4T-ed-RTw" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-283" y="48"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
Binary file removed DateCell/resources/Default-667h@2x~iphone.png
Binary file not shown.
Binary file removed DateCell/resources/Default-736h@3x~iphone.png
Binary file not shown.
Binary file removed DateCell/resources/Icon-72.png
Binary file not shown.
Binary file removed DateCell/resources/[email protected]
Binary file not shown.
Binary file removed DateCell/resources/Icon.png
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"images" : [
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-Small.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-Small-40.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"filename" : "Default@2x~iphone.png",
"scale" : "2x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "retina4",
"filename" : "Default-568h@2x~iphone.png",
"minimum-system-version" : "7.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"filename" : "Default-Portrait~ipad.png",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"filename" : "Default-Landscape~ipad.png",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"filename" : "Default-Portrait@2x~ipad.png",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"filename" : "Default-Landscape@2x~ipad.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
File renamed without changes
4 changes: 2 additions & 2 deletions DateCell/robovm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<mainClass>${app.mainclass}</mainClass>
<os>ios</os>
<arch>thumbv7</arch>
<target>ios</target>
<iosInfoPList>Info.plist.xml</iosInfoPList>
<resources>
<resource>
<directory>resources</directory>
</resource>
</resources>
<target>ios</target>
<iosInfoPList>Info.plist.xml</iosInfoPList>
</config>
37 changes: 6 additions & 31 deletions DateCell/src/main/java/org/robovm/samples/datecell/DateCell.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 RoboVM AB
* Copyright (C) 2013-2015 RoboVM AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,48 +16,23 @@
* Portions of this code is based on Apple Inc's DateCell sample (v1.6)
* which is copyright (C) 2009-2014 Apple Inc.
*/

package org.robovm.samples.datecell;

import org.robovm.apple.foundation.NSAutoreleasePool;
import org.robovm.apple.uikit.UIApplication;
import org.robovm.apple.uikit.UIApplicationDelegateAdapter;
import org.robovm.apple.uikit.UIApplicationLaunchOptions;
import org.robovm.apple.uikit.UINavigationController;
import org.robovm.apple.uikit.UIScreen;
import org.robovm.apple.uikit.UIWindow;
import org.robovm.samples.datecell.viewcontrollers.MyTableViewController;

public class DateCell extends UIApplicationDelegateAdapter {
private UIWindow window;
private MyTableViewController rootViewController;
private UINavigationController navController;

@Override
public boolean didFinishLaunching (UIApplication application, UIApplicationLaunchOptions launchOptions) {
// Set up the view controller.
rootViewController = new MyTableViewController();
navController = new UINavigationController(rootViewController);

// Create a new window at screen size.
window = new UIWindow(UIScreen.getMainScreen().getBounds());
// Set our viewcontroller as the root controller for the window.
window.setRootViewController(navController);
// Make the window visible.
window.makeKeyAndVisible();

/*
* Retains the window object until the application is deallocated. Prevents Java GC from collecting the window object too
* early.
*/
addStrongRef(window);

public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
return true;
}

public static void main (String[] args) {
NSAutoreleasePool pool = new NSAutoreleasePool();
UIApplication.main(args, null, DateCell.class);
pool.close();
public static void main(String[] args) {
try (NSAutoreleasePool pool = new NSAutoreleasePool()) {
UIApplication.main(args, null, DateCell.class);
}
}
}
Loading

0 comments on commit fd240f7

Please sign in to comment.