Skip to content

Commit

Permalink
Updated MessageComposer sample (#41).
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueRiverInteractive committed Apr 26, 2015
1 parent b65343a commit 647ebaf
Show file tree
Hide file tree
Showing 33 changed files with 416 additions and 320 deletions.
35 changes: 8 additions & 27 deletions MessageComposer/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 @@ -36,38 +40,15 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<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>
3 changes: 0 additions & 3 deletions MessageComposer/build.gradle

This file was deleted.

32 changes: 0 additions & 32 deletions MessageComposer/pom.xml

This file was deleted.

70 changes: 70 additions & 0 deletions MessageComposer/resources/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" variant="6xAndEarlier" propertyAccessControl="none" promptedForUpgradeToXcode5="NO" initialViewController="XuP-8k-bAW">
<dependencies>
<development version="4600" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
</dependencies>
<scenes>
<!--Message Composer View Controller-->
<scene sceneID="gq1-0a-PtU">
<objects>
<viewController id="XuP-8k-bAW" customClass="MessageComposerViewController" sceneMemberID="viewController">
<view key="view" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="pml-bs-pos">
<rect key="frame" x="0.0" y="20" width="320" height="548"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="sAp-Fw-aOK">
<rect key="frame" x="20" y="197" width="135" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="Helvetica-Bold" family="Helvetica" pointSize="15"/>
<state key="normal" title="Compose Mail">
<color key="titleColor" red="0.19607843137254902" green="0.30980392156862746" blue="0.52156862745098043" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="showMailPicker" destination="XuP-8k-bAW" eventType="touchUpInside" id="uAb-4o-9OC"/>
</connections>
</button>
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="Jlk-gk-De8">
<rect key="frame" x="163" y="197" width="137" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="Helvetica-Bold" family="Helvetica" pointSize="15"/>
<state key="normal" title="Compose SMS">
<color key="titleColor" red="0.19607843137254902" green="0.30980392156862746" blue="0.52156862745098043" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="showSMSPicker" destination="XuP-8k-bAW" eventType="touchUpInside" id="ZHh-pe-g2v"/>
</connections>
</button>
<label hidden="YES" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" text="Error" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="7" minimumFontSize="10" id="wzD-60-fv0">
<rect key="frame" x="20" y="269" width="280" height="117"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="Helvetica" family="Helvetica" pointSize="15"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.75" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<connections>
<outlet property="feedbackMsg" destination="wzD-60-fv0" id="dyJ-PX-vZC"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="51O-A1-vAW" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="169" y="275"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
Binary file not shown.
Binary file removed MessageComposer/resources/Default-736h@3x~iphone.png
Binary file not shown.
Binary file removed MessageComposer/resources/Icon-72.png
Binary file not shown.
Binary file removed MessageComposer/resources/[email protected]
Binary file not shown.
Binary file removed MessageComposer/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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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"
}
}
3 changes: 0 additions & 3 deletions MessageComposer/robovm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@
</resources>
<target>ios</target>
<iosInfoPList>Info.plist.xml</iosInfoPList>
<frameworks>
<framework>MessageUI</framework>
</frameworks>
</config>
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,42 +16,23 @@
* Portions of this code is based on Apple Inc's MessageComposer sample (v1.2)
* which is copyright (C) 2010-2013 Apple Inc.
*/

package org.robovm.samples.messagecomposer;

import org.robovm.apple.foundation.NSAutoreleasePool;
import org.robovm.apple.uikit.UIApplication;
import org.robovm.apple.uikit.UIApplicationDelegateAdapter;
import org.robovm.apple.uikit.UIScreen;
import org.robovm.apple.uikit.UIWindow;
import org.robovm.samples.messagecomposer.viewcontrollers.MessageComposerViewController;
import org.robovm.apple.uikit.UIApplicationLaunchOptions;

public class MessageComposer extends UIApplicationDelegateAdapter {
private UIWindow window;
private MessageComposerViewController viewController;

@Override
public void didFinishLaunching (UIApplication application) {
// Set up the view controller.
viewController = new MessageComposerViewController();

// 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(viewController);
// 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, MessageComposer.class);
pool.close();
public static void main(String[] args) {
try (NSAutoreleasePool pool = new NSAutoreleasePool()) {
UIApplication.main(args, null, MessageComposer.class);
}
}
}
Loading

0 comments on commit 647ebaf

Please sign in to comment.