├── .gitignore
├── LICENSE
├── README.md
├── address
├── android
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── prt2121
│ │ │ └── address
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ └── com
│ │ │ └── prt2121
│ │ │ └── address
│ │ │ └── AddressBookActivity.kt
│ │ └── res
│ │ ├── layout
│ │ └── activity_my.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── core
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prt2121
│ │ └── address
│ │ └── CounterStore.kt
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ios
│ ├── Info.plist.xml
│ ├── build.gradle
│ ├── resources
│ │ ├── Base.lproj
│ │ │ └── Main.storyboard
│ │ └── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-60@2x.png
│ │ │ ├── Icon-60@3x.png
│ │ │ ├── Icon-76.png
│ │ │ ├── Icon-76@2x.png
│ │ │ ├── Icon-Small-40.png
│ │ │ ├── Icon-Small-40@2x.png
│ │ │ ├── Icon-Small-40@3x.png
│ │ │ ├── Icon-Small.png
│ │ │ ├── Icon-Small@2x.png
│ │ │ └── Icon-Small@3x.png
│ │ │ └── LaunchImage.launchimage
│ │ │ ├── Contents.json
│ │ │ ├── Default-568h@2x~iphone.png
│ │ │ ├── Default-667h@2x~iphone.png
│ │ │ ├── Default-736h@3x~iphone.png
│ │ │ ├── Default-Landscape-736h@3x~iphone.png
│ │ │ ├── Default-Landscape@2x~ipad.png
│ │ │ ├── Default-Landscape~ipad.png
│ │ │ ├── Default-Portrait@2x~ipad.png
│ │ │ ├── Default-Portrait~ipad.png
│ │ │ └── Default@2x~iphone.png
│ ├── robovm.properties
│ ├── robovm.xml
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prt2121
│ │ └── address
│ │ ├── AddressBook.kt
│ │ └── MyViewController.kt
└── settings.gradle
├── contacts
├── android
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── prat
│ │ │ └── tablesearch
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ └── com
│ │ │ └── prat
│ │ │ └── tablesearch
│ │ │ └── TableSearchActivity.kt
│ │ └── res
│ │ ├── layout
│ │ └── activity_my.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── core
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prat
│ │ └── tablesearch
│ │ └── CounterStore.kt
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ios
│ ├── Info.plist.xml
│ ├── build.gradle
│ ├── resources
│ │ ├── Base.lproj
│ │ │ ├── Main.storyboard
│ │ │ └── TableCell.xib
│ │ └── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-60@2x.png
│ │ │ ├── Icon-60@3x.png
│ │ │ ├── Icon-76.png
│ │ │ ├── Icon-76@2x.png
│ │ │ ├── Icon-Small-40.png
│ │ │ ├── Icon-Small-40@2x.png
│ │ │ ├── Icon-Small-40@3x.png
│ │ │ ├── Icon-Small.png
│ │ │ ├── Icon-Small@2x.png
│ │ │ └── Icon-Small@3x.png
│ │ │ └── LaunchImage.launchimage
│ │ │ ├── Contents.json
│ │ │ ├── Default-568h@2x~iphone.png
│ │ │ ├── Default-667h@2x~iphone.png
│ │ │ ├── Default-736h@3x~iphone.png
│ │ │ ├── Default-Landscape-736h@3x~iphone.png
│ │ │ ├── Default-Landscape@2x~ipad.png
│ │ │ ├── Default-Landscape~ipad.png
│ │ │ ├── Default-Portrait@2x~ipad.png
│ │ │ ├── Default-Portrait~ipad.png
│ │ │ └── Default@2x~iphone.png
│ ├── robovm.properties
│ ├── robovm.xml
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prat
│ │ └── tablesearch
│ │ ├── BaseTableViewController.kt
│ │ ├── DetailViewController.kt
│ │ ├── MainTableViewController.kt
│ │ ├── ResultsTableViewController.kt
│ │ └── TableSearch.kt
└── settings.gradle
├── current-address
├── android
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── prt2121
│ │ │ └── currentaddress
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ └── com
│ │ │ └── prt2121
│ │ │ └── currentaddress
│ │ │ └── CurrentAddressActivity.kt
│ │ └── res
│ │ ├── layout
│ │ └── activity_my.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── core
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prt2121
│ │ └── currentaddress
│ │ └── CounterStore.kt
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ios
│ ├── Info.plist.xml
│ ├── build.gradle
│ ├── resources
│ │ ├── Base.lproj
│ │ │ └── Main.storyboard
│ │ └── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-60@2x.png
│ │ │ ├── Icon-60@3x.png
│ │ │ ├── Icon-76.png
│ │ │ ├── Icon-76@2x.png
│ │ │ ├── Icon-Small-40.png
│ │ │ ├── Icon-Small-40@2x.png
│ │ │ ├── Icon-Small-40@3x.png
│ │ │ ├── Icon-Small.png
│ │ │ ├── Icon-Small@2x.png
│ │ │ └── Icon-Small@3x.png
│ │ │ └── LaunchImage.launchimage
│ │ │ ├── Contents.json
│ │ │ ├── Default-568h@2x~iphone.png
│ │ │ ├── Default-667h@2x~iphone.png
│ │ │ ├── Default-736h@3x~iphone.png
│ │ │ ├── Default-Landscape-736h@3x~iphone.png
│ │ │ ├── Default-Landscape@2x~ipad.png
│ │ │ ├── Default-Landscape~ipad.png
│ │ │ ├── Default-Portrait@2x~ipad.png
│ │ │ ├── Default-Portrait~ipad.png
│ │ │ └── Default@2x~iphone.png
│ ├── robovm.properties
│ ├── robovm.xml
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prt2121
│ │ └── currentaddress
│ │ ├── CurrentAddress.kt
│ │ ├── MapViewController.kt
│ │ └── PlacemarkViewController.kt
└── settings.gradle
├── hello-ios
├── android
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── prt2121
│ │ │ └── kitty
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ └── com
│ │ │ └── prt2121
│ │ │ └── kitty
│ │ │ └── MainActivity.kt
│ │ └── res
│ │ ├── layout
│ │ └── activity_my.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── core
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prt2121
│ │ └── kitty
│ │ └── CounterStore.kt
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ios
│ ├── Info.plist.xml
│ ├── build.gradle
│ ├── resources
│ │ ├── Base.lproj
│ │ │ └── Main.storyboard
│ │ └── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-60@2x.png
│ │ │ ├── Icon-60@3x.png
│ │ │ ├── Icon-76.png
│ │ │ ├── Icon-76@2x.png
│ │ │ ├── Icon-Small-40.png
│ │ │ ├── Icon-Small-40@2x.png
│ │ │ ├── Icon-Small-40@3x.png
│ │ │ ├── Icon-Small.png
│ │ │ ├── Icon-Small@2x.png
│ │ │ └── Icon-Small@3x.png
│ │ │ └── LaunchImage.launchimage
│ │ │ ├── Contents.json
│ │ │ ├── Default-568h@2x~iphone.png
│ │ │ ├── Default-667h@2x~iphone.png
│ │ │ ├── Default-736h@3x~iphone.png
│ │ │ ├── Default-Landscape-736h@3x~iphone.png
│ │ │ ├── Default-Landscape@2x~ipad.png
│ │ │ ├── Default-Landscape~ipad.png
│ │ │ ├── Default-Portrait@2x~ipad.png
│ │ │ ├── Default-Portrait~ipad.png
│ │ │ └── Default@2x~iphone.png
│ ├── robovm.properties
│ ├── robovm.xml
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prt2121
│ │ └── kitty
│ │ ├── Main.kt
│ │ ├── MyViewController.kt
│ │ └── PhoneTranslator.kt
└── settings.gradle
├── hello-multiscreen
├── android
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── prt2121
│ │ │ └── kitty
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ └── com
│ │ │ └── prt2121
│ │ │ └── kitty
│ │ │ └── MainActivity.kt
│ │ └── res
│ │ ├── layout
│ │ └── activity_my.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── core
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prt2121
│ │ └── kitty
│ │ └── CounterStore.kt
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ios
│ ├── Info.plist.xml
│ ├── build.gradle
│ ├── resources
│ │ ├── Base.lproj
│ │ │ └── Main.storyboard
│ │ └── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-60@2x.png
│ │ │ ├── Icon-60@3x.png
│ │ │ ├── Icon-76.png
│ │ │ ├── Icon-76@2x.png
│ │ │ ├── Icon-Small-40.png
│ │ │ ├── Icon-Small-40@2x.png
│ │ │ ├── Icon-Small-40@3x.png
│ │ │ ├── Icon-Small.png
│ │ │ ├── Icon-Small@2x.png
│ │ │ └── Icon-Small@3x.png
│ │ │ └── LaunchImage.launchimage
│ │ │ ├── Contents.json
│ │ │ ├── Default-568h@2x~iphone.png
│ │ │ ├── Default-667h@2x~iphone.png
│ │ │ ├── Default-736h@3x~iphone.png
│ │ │ ├── Default-Landscape-736h@3x~iphone.png
│ │ │ ├── Default-Landscape@2x~ipad.png
│ │ │ ├── Default-Landscape~ipad.png
│ │ │ ├── Default-Portrait@2x~ipad.png
│ │ │ ├── Default-Portrait~ipad.png
│ │ │ └── Default@2x~iphone.png
│ ├── robovm.properties
│ ├── robovm.xml
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prt2121
│ │ └── kitty
│ │ ├── CallHistoryController.kt
│ │ ├── Main.kt
│ │ ├── MyViewController.kt
│ │ └── PhoneTranslator.kt
└── settings.gradle
├── message
├── android
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── prat
│ │ │ └── message
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ └── com
│ │ │ └── prat
│ │ │ └── message
│ │ │ └── MessageActivity.kt
│ │ └── res
│ │ ├── layout
│ │ └── activity_my.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── core
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prat
│ │ └── message
│ │ └── CounterStore.kt
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ios
│ ├── Info.plist.xml
│ ├── build.gradle
│ ├── resources
│ │ ├── Base.lproj
│ │ │ └── Main.storyboard
│ │ ├── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── Icon-60@2x.png
│ │ │ │ ├── Icon-60@3x.png
│ │ │ │ ├── Icon-76.png
│ │ │ │ ├── Icon-76@2x.png
│ │ │ │ ├── Icon-Small-40.png
│ │ │ │ ├── Icon-Small-40@2x.png
│ │ │ │ ├── Icon-Small-40@3x.png
│ │ │ │ ├── Icon-Small.png
│ │ │ │ ├── Icon-Small@2x.png
│ │ │ │ └── Icon-Small@3x.png
│ │ │ └── LaunchImage.launchimage
│ │ │ │ ├── Contents.json
│ │ │ │ ├── Default-568h@2x~iphone.png
│ │ │ │ ├── Default-667h@2x~iphone.png
│ │ │ │ ├── Default-736h@3x~iphone.png
│ │ │ │ ├── Default-Landscape-736h@3x~iphone.png
│ │ │ │ ├── Default-Landscape@2x~ipad.png
│ │ │ │ ├── Default-Landscape~ipad.png
│ │ │ │ ├── Default-Portrait@2x~ipad.png
│ │ │ │ ├── Default-Portrait~ipad.png
│ │ │ │ └── Default@2x~iphone.png
│ │ └── rainy.jpg
│ ├── robovm.properties
│ ├── robovm.xml
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prat
│ │ └── message
│ │ ├── Message.kt
│ │ └── MessageComposerViewController.kt
└── settings.gradle
├── rest-client
├── android
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── prat
│ │ │ └── restclient
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ └── com
│ │ │ └── prat
│ │ │ └── restclient
│ │ │ └── MainActivity.kt
│ │ └── res
│ │ ├── layout
│ │ └── activity_my.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── core
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prat
│ │ └── restclient
│ │ ├── CounterStore.kt
│ │ ├── GitHubService.kt
│ │ ├── Repo.kt
│ │ └── WebService.kt
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ios
│ ├── Info.plist.xml
│ ├── build.gradle
│ ├── resources
│ │ ├── Base.lproj
│ │ │ └── Main.storyboard
│ │ └── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-60@2x.png
│ │ │ ├── Icon-60@3x.png
│ │ │ ├── Icon-76.png
│ │ │ ├── Icon-76@2x.png
│ │ │ ├── Icon-Small-40.png
│ │ │ ├── Icon-Small-40@2x.png
│ │ │ ├── Icon-Small-40@3x.png
│ │ │ ├── Icon-Small.png
│ │ │ ├── Icon-Small@2x.png
│ │ │ └── Icon-Small@3x.png
│ │ │ └── LaunchImage.launchimage
│ │ │ ├── Contents.json
│ │ │ ├── Default-568h@2x~iphone.png
│ │ │ ├── Default-667h@2x~iphone.png
│ │ │ ├── Default-736h@3x~iphone.png
│ │ │ ├── Default-Landscape-736h@3x~iphone.png
│ │ │ ├── Default-Landscape@2x~ipad.png
│ │ │ ├── Default-Landscape~ipad.png
│ │ │ ├── Default-Portrait@2x~ipad.png
│ │ │ ├── Default-Portrait~ipad.png
│ │ │ └── Default@2x~iphone.png
│ ├── robovm.properties
│ ├── robovm.xml
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prat
│ │ └── restclient
│ │ ├── Main.kt
│ │ └── MyViewController.kt
└── settings.gradle
├── tableSearch
├── android
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── prat
│ │ │ └── tablesearch
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ └── com
│ │ │ └── prat
│ │ │ └── tablesearch
│ │ │ └── TableSearchActivity.kt
│ │ └── res
│ │ ├── layout
│ │ └── activity_my.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── core
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prat
│ │ └── tablesearch
│ │ └── CounterStore.kt
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ios
│ ├── Info.plist.xml
│ ├── build.gradle
│ ├── resources
│ │ ├── Base.lproj
│ │ │ ├── Main.storyboard
│ │ │ └── TableCell.xib
│ │ └── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-60@2x.png
│ │ │ ├── Icon-60@3x.png
│ │ │ ├── Icon-76.png
│ │ │ ├── Icon-76@2x.png
│ │ │ ├── Icon-Small-40.png
│ │ │ ├── Icon-Small-40@2x.png
│ │ │ ├── Icon-Small-40@3x.png
│ │ │ ├── Icon-Small.png
│ │ │ ├── Icon-Small@2x.png
│ │ │ └── Icon-Small@3x.png
│ │ │ └── LaunchImage.launchimage
│ │ │ ├── Contents.json
│ │ │ ├── Default-568h@2x~iphone.png
│ │ │ ├── Default-667h@2x~iphone.png
│ │ │ ├── Default-736h@3x~iphone.png
│ │ │ ├── Default-Landscape-736h@3x~iphone.png
│ │ │ ├── Default-Landscape@2x~ipad.png
│ │ │ ├── Default-Landscape~ipad.png
│ │ │ ├── Default-Portrait@2x~ipad.png
│ │ │ ├── Default-Portrait~ipad.png
│ │ │ └── Default@2x~iphone.png
│ ├── robovm.properties
│ ├── robovm.xml
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── prat
│ │ └── tablesearch
│ │ ├── APLBaseTableViewController.kt
│ │ ├── APLDetailViewController.kt
│ │ ├── APLMainTableViewController.kt
│ │ ├── APLProduct.kt
│ │ ├── APLResultsTableViewController.kt
│ │ └── TableSearch.kt
└── settings.gradle
└── webview
├── android
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── prat
│ │ └── webview
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── kotlin
│ └── com
│ │ └── prat
│ │ └── webview
│ │ └── WebviewActivity.kt
│ └── res
│ ├── layout
│ └── activity_my.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ └── values
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── core
├── build.gradle
└── src
│ └── main
│ └── kotlin
│ └── com
│ └── prat
│ └── webview
│ └── CounterStore.kt
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ios
├── Info.plist.xml
├── build.gradle
├── resources
│ ├── Base.lproj
│ │ └── Main.storyboard
│ └── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-60@2x.png
│ │ ├── Icon-60@3x.png
│ │ ├── Icon-76.png
│ │ ├── Icon-76@2x.png
│ │ ├── Icon-Small-40.png
│ │ ├── Icon-Small-40@2x.png
│ │ ├── Icon-Small-40@3x.png
│ │ ├── Icon-Small.png
│ │ ├── Icon-Small@2x.png
│ │ └── Icon-Small@3x.png
│ │ └── LaunchImage.launchimage
│ │ ├── Contents.json
│ │ ├── Default-568h@2x~iphone.png
│ │ ├── Default-667h@2x~iphone.png
│ │ ├── Default-736h@3x~iphone.png
│ │ ├── Default-Landscape-736h@3x~iphone.png
│ │ ├── Default-Landscape@2x~ipad.png
│ │ ├── Default-Landscape~ipad.png
│ │ ├── Default-Portrait@2x~ipad.png
│ │ ├── Default-Portrait~ipad.png
│ │ └── Default@2x~iphone.png
├── robovm.properties
├── robovm.xml
└── src
│ └── main
│ └── kotlin
│ └── com
│ └── prat
│ └── webview
│ ├── MyViewController.kt
│ └── Web.kt
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | .*
2 | target/
3 | build/
4 | pom.xml.tag
5 | pom.xml.releaseBackup
6 | pom.xml.next
7 | release.properties
8 | robovm-logs/
9 | robovm-build/
10 | *.iml
11 | .idea/
12 | bin/
13 | .classpath
14 | .project
15 | .settings/
16 | local.properties
17 | xcshareddata/
18 | xcuserdata/
19 |
20 | .DS_Store
21 | .idea/shelf
22 | /android.tests.dependencies
23 | /confluence/target
24 | /dependencies
25 | /dist
26 | /gh-pages
27 | /ideaSDK
28 | /android-studio/sdk
29 | out
30 | tmp
31 | workspace.xml
32 | *.versionsBackup
33 | /idea/testData/debugger/tinyApp/classes*
34 | /jps-plugin/testData/kannotator
35 |
36 | *~
37 | *.o
38 | *.iml
39 | a.out
40 | *.class
41 | .*
42 | /target/
43 | /llvm/target.llvm/
44 | /vm/binaries/
45 | /vm/target/
46 | /compiler/target/
47 | /llvm/target/
48 | /libimobiledevice/target/
49 | /rt/target/
50 | /cacerts/target/
51 | /cacerts/full/target/
52 | /objc/target/
53 | /cocoatouch/target/
54 | /eclipse/target/
55 | /eclipse/ui/target/
56 | /eclipse/feature/target/
57 | /eclipse/update-site/target/
58 | /dist/target/
59 | /dist/compiler/target/
60 | /dist/package/target/
61 | /tests/dalvik/robovm*.env
62 | /tests/libcore/target/
63 | /tests/robovm/target/
64 | /tests/drlvm/robovm-vts.env
65 | /tests/drlvm-vts-bundle/
66 | /tests/libcore/sqliteTest*.db
67 | /eclipse/ui/lib/
68 | /tmp/
69 | !/tests/robovm/src/test/resources/META-INF/**/*.o
70 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # kotlin-ios
2 | Playground: iOS app written in Kotlin
3 |
--------------------------------------------------------------------------------
/address/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | mavenCentral()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.3.0'
8 | classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
9 | }
10 | }
11 |
12 | plugins {
13 | id "me.tatarka.retrolambda" version "3.2.2"
14 | }
15 | apply plugin: 'com.android.application'
16 | apply plugin: 'kotlin-android'
17 |
18 | repositories {
19 | jcenter()
20 | mavenCentral()
21 | }
22 |
23 | android {
24 | compileSdkVersion 23
25 | buildToolsVersion "23.0.1"
26 |
27 | sourceSets {
28 | main.java.srcDirs += 'src/main/kotlin'
29 | }
30 |
31 | defaultConfig {
32 | applicationId "com.mycompany.fortune.android"
33 | minSdkVersion 9
34 | targetSdkVersion 23
35 | versionCode 1
36 | versionName "1.0"
37 | }
38 |
39 | compileOptions {
40 | sourceCompatibility JavaVersion.VERSION_1_8
41 | targetCompatibility JavaVersion.VERSION_1_8
42 | }
43 | buildTypes {
44 | release {
45 | minifyEnabled false
46 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
47 | }
48 | }
49 | }
50 |
51 | dependencies {
52 | compile fileTree(dir: 'libs', include: ['*.jar'])
53 | compile 'com.android.support:appcompat-v7:23+'
54 | compile 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version'
55 | compile project(':core')
56 | }
57 |
--------------------------------------------------------------------------------
/address/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.1.2/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/address/android/src/androidTest/java/com/prt2121/address/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.prt2121.address;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/address/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/address/android/src/main/kotlin/com/prt2121/address/AddressBookActivity.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.address
2 |
3 | import android.app.Activity
4 | import android.os.Bundle
5 | import android.widget.Button
6 | import android.widget.TextView
7 |
8 | class AddressBookActivity : Activity() {
9 | private val counterStore = CounterStore()
10 |
11 | override fun onCreate(savedInstanceState: Bundle?) {
12 | super.onCreate(savedInstanceState)
13 | setContentView(R.layout.activity_my)
14 |
15 | val counterTextView = findViewById(R.id.counterTextView) as TextView
16 | val counterButton = findViewById(R.id.counterButton) as Button
17 |
18 | counterButton.setOnClickListener { view ->
19 | counterStore.add(1)
20 | counterTextView.text = "Click Nr. " + counterStore.get()
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/address/android/src/main/res/layout/activity_my.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/address/android/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/android/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/address/android/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/android/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/address/android/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/android/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/address/android/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/android/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/address/android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AddressBook
3 |
4 |
--------------------------------------------------------------------------------
/address/android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/address/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | buildscript {
3 | ext.kotlin_version = '1.0.0-beta-2423'
4 | repositories {
5 | jcenter()
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 | }
13 |
14 | task wrapper(type: Wrapper) {
15 | gradleVersion = '2.8'
16 | }
--------------------------------------------------------------------------------
/address/core/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | }
5 | }
6 |
7 | plugins {
8 | id "me.tatarka.retrolambda" version "3.2.2"
9 | }
10 | apply plugin: 'java'
11 | apply plugin: 'kotlin'
12 |
13 | version 'unspecified'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | }
20 |
21 | sourceSets {
22 | main.java.srcDirs += 'src/main/kotlin'
23 | }
24 |
25 | dependencies {
26 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
27 | testCompile group: 'junit', name: 'junit', version: '4.11'
28 | }
29 |
--------------------------------------------------------------------------------
/address/core/src/main/kotlin/com/prt2121/address/CounterStore.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.address
2 |
3 | class CounterStore {
4 | private var count: Int = 0
5 |
6 | fun add(num: Int) {
7 | count += num
8 | }
9 |
10 | fun get(): Int {
11 | return count
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/address/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.jvmargs=-Xms128m -Xmx2000m
3 | org.gradle.configureondemand=true
--------------------------------------------------------------------------------
/address/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/address/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Nov 26 21:31:51 EST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip
7 |
--------------------------------------------------------------------------------
/address/ios/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
5 | }
6 | dependencies {
7 | classpath 'org.robovm:robovm-gradle-plugin:1.11.0'
8 | }
9 | }
10 |
11 | apply plugin: 'java'
12 | apply plugin: 'robovm'
13 | apply plugin: 'kotlin'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
20 | }
21 |
22 | sourceSets {
23 | main.java.srcDirs += 'src/main/kotlin'
24 | }
25 |
26 | ext {
27 | roboVMVersion = "1.11.0"
28 | }
29 |
30 | robovm {
31 | }
32 |
33 | dependencies {
34 | compile "org.robovm:robovm-rt:${roboVMVersion}"
35 | compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"
36 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
37 | testCompile "junit:junit:4.12"
38 | compile project(':core')
39 | }
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "filename" : "Default@2x~iphone.png",
9 | "scale" : "2x"
10 | },
11 | {
12 | "extent" : "full-screen",
13 | "idiom" : "iphone",
14 | "subtype" : "retina4",
15 | "filename" : "Default-568h@2x~iphone.png",
16 | "minimum-system-version" : "7.0",
17 | "orientation" : "portrait",
18 | "scale" : "2x"
19 | },
20 | {
21 | "orientation" : "portrait",
22 | "idiom" : "ipad",
23 | "extent" : "full-screen",
24 | "minimum-system-version" : "7.0",
25 | "filename" : "Default-Portrait~ipad.png",
26 | "scale" : "1x"
27 | },
28 | {
29 | "orientation" : "landscape",
30 | "idiom" : "ipad",
31 | "extent" : "full-screen",
32 | "minimum-system-version" : "7.0",
33 | "filename" : "Default-Landscape~ipad.png",
34 | "scale" : "1x"
35 | },
36 | {
37 | "orientation" : "portrait",
38 | "idiom" : "ipad",
39 | "extent" : "full-screen",
40 | "minimum-system-version" : "7.0",
41 | "filename" : "Default-Portrait@2x~ipad.png",
42 | "scale" : "2x"
43 | },
44 | {
45 | "orientation" : "landscape",
46 | "idiom" : "ipad",
47 | "extent" : "full-screen",
48 | "minimum-system-version" : "7.0",
49 | "filename" : "Default-Landscape@2x~ipad.png",
50 | "scale" : "2x"
51 | }
52 | ],
53 | "info" : {
54 | "version" : 1,
55 | "author" : "xcode"
56 | }
57 | }
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png
--------------------------------------------------------------------------------
/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png
--------------------------------------------------------------------------------
/address/ios/robovm.properties:
--------------------------------------------------------------------------------
1 | app.version=1.0
2 | app.id=com.prt2121.address
3 | app.mainclass=com.prt2121.address.AddressBook
4 | app.executable=AddressBook
5 | app.build=1
6 | app.name=AddressBook
--------------------------------------------------------------------------------
/address/ios/robovm.xml:
--------------------------------------------------------------------------------
1 |
2 | ${app.executable}
3 | ${app.mainclass}
4 | ios
5 | ios
6 | Info.plist.xml
7 |
8 |
9 | resources
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/address/ios/src/main/kotlin/com/prt2121/address/AddressBook.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.address
2 |
3 | import org.robovm.apple.foundation.NSAutoreleasePool
4 | import org.robovm.apple.uikit.UIApplication
5 | import org.robovm.apple.uikit.UIApplicationDelegateAdapter
6 | import org.robovm.apple.uikit.UIApplicationLaunchOptions
7 |
8 | class AddressBook : UIApplicationDelegateAdapter() {
9 |
10 | override fun didFinishLaunching(application: UIApplication?, launchOptions: UIApplicationLaunchOptions?): Boolean {
11 | return true
12 | }
13 |
14 | companion object {
15 | @JvmStatic fun main(args: Array) {
16 | val pool = NSAutoreleasePool()
17 | UIApplication.main(args, null, AddressBook::class.java)
18 | pool.release()
19 | }
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/address/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':core', ':android', ':ios'
2 |
3 |
--------------------------------------------------------------------------------
/contacts/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | mavenCentral()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.3.0'
8 | classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
9 | }
10 | }
11 |
12 | plugins {
13 | id "me.tatarka.retrolambda" version "3.2.2"
14 | }
15 | apply plugin: 'com.android.application'
16 | apply plugin: 'kotlin-android'
17 |
18 | repositories {
19 | jcenter()
20 | mavenCentral()
21 | }
22 |
23 | android {
24 | compileSdkVersion 23
25 | buildToolsVersion "23.0.1"
26 |
27 | sourceSets {
28 | main.java.srcDirs += 'src/main/kotlin'
29 | }
30 |
31 | defaultConfig {
32 | applicationId "com.mycompany.fortune.android"
33 | minSdkVersion 9
34 | targetSdkVersion 23
35 | versionCode 1
36 | versionName "1.0"
37 | }
38 |
39 | compileOptions {
40 | sourceCompatibility JavaVersion.VERSION_1_8
41 | targetCompatibility JavaVersion.VERSION_1_8
42 | }
43 | buildTypes {
44 | release {
45 | minifyEnabled false
46 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
47 | }
48 | }
49 | }
50 |
51 | dependencies {
52 | compile fileTree(dir: 'libs', include: ['*.jar'])
53 | compile 'com.android.support:appcompat-v7:23+'
54 | compile 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version'
55 | compile project(':core')
56 | }
57 |
--------------------------------------------------------------------------------
/contacts/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.1.2/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/contacts/android/src/androidTest/java/com/prat/tablesearch/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.prat.tablesearch;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/contacts/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/contacts/android/src/main/kotlin/com/prat/tablesearch/TableSearchActivity.kt:
--------------------------------------------------------------------------------
1 | package com.prat.tablesearch
2 |
3 | import android.app.Activity
4 | import android.os.Bundle
5 | import android.widget.Button
6 | import android.widget.TextView
7 |
8 | class TableSearchActivity : Activity() {
9 | private val counterStore = CounterStore()
10 |
11 | override fun onCreate(savedInstanceState: Bundle?) {
12 | super.onCreate(savedInstanceState)
13 | setContentView(R.layout.activity_my)
14 |
15 | val counterTextView = findViewById(R.id.counterTextView) as TextView
16 | val counterButton = findViewById(R.id.counterButton) as Button
17 |
18 | counterButton.setOnClickListener { view ->
19 | counterStore.add(1)
20 | counterTextView.text = "Click Nr. " + counterStore.get()
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/contacts/android/src/main/res/layout/activity_my.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/contacts/android/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/android/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/contacts/android/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/android/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/contacts/android/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/android/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/contacts/android/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/android/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/contacts/android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Table Search
3 |
4 |
--------------------------------------------------------------------------------
/contacts/android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/contacts/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | buildscript {
3 | ext.kotlin_version = '1.0.0-beta-2423'
4 | repositories {
5 | jcenter()
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 | }
13 |
14 | task wrapper(type: Wrapper) {
15 | gradleVersion = '2.8'
16 | }
--------------------------------------------------------------------------------
/contacts/core/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | }
5 | }
6 |
7 | plugins {
8 | id "me.tatarka.retrolambda" version "3.2.2"
9 | }
10 | apply plugin: 'java'
11 | apply plugin: 'kotlin'
12 |
13 | version 'unspecified'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | }
20 |
21 | sourceSets {
22 | main.java.srcDirs += 'src/main/kotlin'
23 | }
24 |
25 | dependencies {
26 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
27 | testCompile group: 'junit', name: 'junit', version: '4.11'
28 | }
29 |
--------------------------------------------------------------------------------
/contacts/core/src/main/kotlin/com/prat/tablesearch/CounterStore.kt:
--------------------------------------------------------------------------------
1 | package com.prat.tablesearch
2 |
3 | class CounterStore {
4 | private var count: Int = 0
5 |
6 | fun add(num: Int) {
7 | count += num
8 | }
9 |
10 | fun get(): Int {
11 | return count
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/contacts/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.jvmargs=-Xms128m -Xmx2000m
3 | org.gradle.configureondemand=true
--------------------------------------------------------------------------------
/contacts/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/contacts/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Nov 27 14:15:48 EST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip
7 |
--------------------------------------------------------------------------------
/contacts/ios/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
5 | }
6 | dependencies {
7 | classpath 'org.robovm:robovm-gradle-plugin:1.11.0'
8 | }
9 | }
10 |
11 | apply plugin: 'java'
12 | apply plugin: 'robovm'
13 | apply plugin: 'kotlin'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
20 | }
21 |
22 | sourceSets {
23 | main.java.srcDirs += 'src/main/kotlin'
24 | }
25 |
26 | ext {
27 | roboVMVersion = "1.11.0"
28 | }
29 |
30 | robovm {
31 | }
32 |
33 | dependencies {
34 | compile "org.robovm:robovm-rt:${roboVMVersion}"
35 | compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"
36 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
37 | testCompile "junit:junit:4.12"
38 | compile project(':core')
39 | }
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "filename" : "Default@2x~iphone.png",
9 | "scale" : "2x"
10 | },
11 | {
12 | "extent" : "full-screen",
13 | "idiom" : "iphone",
14 | "subtype" : "retina4",
15 | "filename" : "Default-568h@2x~iphone.png",
16 | "minimum-system-version" : "7.0",
17 | "orientation" : "portrait",
18 | "scale" : "2x"
19 | },
20 | {
21 | "orientation" : "portrait",
22 | "idiom" : "ipad",
23 | "extent" : "full-screen",
24 | "minimum-system-version" : "7.0",
25 | "filename" : "Default-Portrait~ipad.png",
26 | "scale" : "1x"
27 | },
28 | {
29 | "orientation" : "landscape",
30 | "idiom" : "ipad",
31 | "extent" : "full-screen",
32 | "minimum-system-version" : "7.0",
33 | "filename" : "Default-Landscape~ipad.png",
34 | "scale" : "1x"
35 | },
36 | {
37 | "orientation" : "portrait",
38 | "idiom" : "ipad",
39 | "extent" : "full-screen",
40 | "minimum-system-version" : "7.0",
41 | "filename" : "Default-Portrait@2x~ipad.png",
42 | "scale" : "2x"
43 | },
44 | {
45 | "orientation" : "landscape",
46 | "idiom" : "ipad",
47 | "extent" : "full-screen",
48 | "minimum-system-version" : "7.0",
49 | "filename" : "Default-Landscape@2x~ipad.png",
50 | "scale" : "2x"
51 | }
52 | ],
53 | "info" : {
54 | "version" : 1,
55 | "author" : "xcode"
56 | }
57 | }
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png
--------------------------------------------------------------------------------
/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/contacts/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png
--------------------------------------------------------------------------------
/contacts/ios/robovm.properties:
--------------------------------------------------------------------------------
1 | app.version=1.0
2 | app.id=com.prat.tablesearch
3 | app.mainclass=com.prat.tablesearch.TableSearch
4 | app.executable=TableSearch
5 | app.build=1
6 | app.name=Table Search
--------------------------------------------------------------------------------
/contacts/ios/robovm.xml:
--------------------------------------------------------------------------------
1 |
2 | ${app.executable}
3 | ${app.mainclass}
4 | ios
5 | ios
6 | Info.plist.xml
7 |
8 |
9 | resources
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/contacts/ios/src/main/kotlin/com/prat/tablesearch/BaseTableViewController.kt:
--------------------------------------------------------------------------------
1 | package com.prat.tablesearch
2 |
3 | import org.robovm.apple.contacts.CNContact
4 | import org.robovm.apple.uikit.UINib
5 | import org.robovm.apple.uikit.UITableViewCell
6 | import org.robovm.apple.uikit.UITableViewController
7 | import org.robovm.objc.annotation.CustomClass
8 |
9 | @CustomClass("BaseTableViewController")
10 | open class BaseTableViewController : UITableViewController() {
11 | internal val CELL_IDENTIFIER = "cellID"
12 | private val TABLE_CELL_NIB_NAME = "TableCell"
13 |
14 | override fun viewDidLoad() {
15 | super.viewDidLoad()
16 |
17 | // we use a nib which contains the cell's view and this class as the files owner
18 | tableView.registerReusableCellNib(UINib(TABLE_CELL_NIB_NAME, null), CELL_IDENTIFIER)
19 | }
20 |
21 | fun configureCell(cell: UITableViewCell, contact: CNContact) {
22 | cell.textLabel.text = "${contact.givenName} ${contact.familyName}"
23 | cell.detailTextLabel.text = if (contact.phoneNumbers.size > 0) contact.phoneNumbers[0].value.stringValue else ""
24 | }
25 | }
--------------------------------------------------------------------------------
/contacts/ios/src/main/kotlin/com/prat/tablesearch/ResultsTableViewController.kt:
--------------------------------------------------------------------------------
1 | package com.prat.tablesearch
2 |
3 | /**
4 | * Created by pt2121 on 11/27/15.
5 | */
6 |
7 |
8 | import org.robovm.apple.contacts.CNContact
9 | import org.robovm.apple.foundation.NSIndexPath
10 | import org.robovm.apple.uikit.UITableView
11 | import org.robovm.apple.uikit.UITableViewCell
12 | import org.robovm.objc.annotation.CustomClass
13 |
14 | @CustomClass("ResultsTableViewController")
15 | class ResultsTableViewController : BaseTableViewController() {
16 | var filteredContacts: List? = null
17 |
18 | override fun getNumberOfRowsInSection(tableView: UITableView, section: Long): Long {
19 | return filteredContacts!!.size.toLong()
20 | }
21 |
22 | override fun getCellForRow(tableView: UITableView, indexPath: NSIndexPath): UITableViewCell {
23 | val contact = filteredContacts!![indexPath.row.toInt()]
24 |
25 | val cell = getTableView().dequeueReusableCell(CELL_IDENTIFIER)
26 | configureCell(cell, contact)
27 | return cell
28 | }
29 | }
--------------------------------------------------------------------------------
/contacts/ios/src/main/kotlin/com/prat/tablesearch/TableSearch.kt:
--------------------------------------------------------------------------------
1 | package com.prat.tablesearch
2 |
3 | import org.robovm.apple.foundation.NSAutoreleasePool
4 | import org.robovm.apple.foundation.NSCoder
5 | import org.robovm.apple.uikit.UIApplication
6 | import org.robovm.apple.uikit.UIApplicationDelegateAdapter
7 | import org.robovm.apple.uikit.UIApplicationLaunchOptions
8 | import org.robovm.apple.uikit.UINavigationController
9 |
10 | class TableSearch : UIApplicationDelegateAdapter() {
11 |
12 | companion object {
13 | @JvmStatic fun main(args: Array) {
14 | val pool = NSAutoreleasePool()
15 | UIApplication.main(args, null, TableSearch::class.java)
16 | pool.release()
17 | }
18 | }
19 |
20 | override fun didFinishLaunching(application: UIApplication?, launchOptions: UIApplicationLaunchOptions?): Boolean {
21 | return true
22 | }
23 |
24 | override fun shouldSaveApplicationState(application: UIApplication?, coder: NSCoder?): Boolean {
25 | return true
26 | }
27 |
28 | override fun shouldRestoreApplicationState(application: UIApplication?, coder: NSCoder?): Boolean {
29 | return true
30 | }
31 |
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/contacts/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':core', ':android', ':ios'
2 |
3 |
--------------------------------------------------------------------------------
/current-address/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | mavenCentral()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.3.0'
8 | classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
9 | }
10 | }
11 |
12 | plugins {
13 | id "me.tatarka.retrolambda" version "3.2.2"
14 | }
15 | apply plugin: 'com.android.application'
16 | apply plugin: 'kotlin-android'
17 |
18 | repositories {
19 | jcenter()
20 | mavenCentral()
21 | }
22 |
23 | android {
24 | compileSdkVersion 23
25 | buildToolsVersion "23.0.1"
26 |
27 | sourceSets {
28 | main.java.srcDirs += 'src/main/kotlin'
29 | }
30 |
31 | defaultConfig {
32 | applicationId "com.mycompany.fortune.android"
33 | minSdkVersion 9
34 | targetSdkVersion 23
35 | versionCode 1
36 | versionName "1.0"
37 | }
38 |
39 | compileOptions {
40 | sourceCompatibility JavaVersion.VERSION_1_8
41 | targetCompatibility JavaVersion.VERSION_1_8
42 | }
43 | buildTypes {
44 | release {
45 | minifyEnabled false
46 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
47 | }
48 | }
49 | }
50 |
51 | dependencies {
52 | compile fileTree(dir: 'libs', include: ['*.jar'])
53 | compile 'com.android.support:appcompat-v7:23+'
54 | compile 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version'
55 | compile project(':core')
56 | }
57 |
--------------------------------------------------------------------------------
/current-address/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.1.2/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/current-address/android/src/androidTest/java/com/prt2121/currentaddress/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.prt2121.currentaddress;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/current-address/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/current-address/android/src/main/kotlin/com/prt2121/currentaddress/CurrentAddressActivity.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.currentaddress
2 |
3 | import android.app.Activity
4 | import android.os.Bundle
5 | import android.widget.Button
6 | import android.widget.TextView
7 |
8 | class CurrentAddressActivity : Activity() {
9 | private val counterStore = CounterStore()
10 |
11 | override fun onCreate(savedInstanceState: Bundle?) {
12 | super.onCreate(savedInstanceState)
13 | setContentView(R.layout.activity_my)
14 |
15 | val counterTextView = findViewById(R.id.counterTextView) as TextView
16 | val counterButton = findViewById(R.id.counterButton) as Button
17 |
18 | counterButton.setOnClickListener { view ->
19 | counterStore.add(1)
20 | counterTextView.text = "Click Nr. " + counterStore.get()
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/current-address/android/src/main/res/layout/activity_my.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/current-address/android/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/android/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/current-address/android/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/android/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/current-address/android/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/android/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/current-address/android/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/android/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/current-address/android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Current Address
3 |
4 |
--------------------------------------------------------------------------------
/current-address/android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/current-address/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | buildscript {
3 | ext.kotlin_version = '1.0.0-beta-2423'
4 | repositories {
5 | jcenter()
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 | }
13 |
14 | task wrapper(type: Wrapper) {
15 | gradleVersion = '2.8'
16 | }
--------------------------------------------------------------------------------
/current-address/core/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | }
5 | }
6 |
7 | plugins {
8 | id "me.tatarka.retrolambda" version "3.2.2"
9 | }
10 | apply plugin: 'java'
11 | apply plugin: 'kotlin'
12 |
13 | version 'unspecified'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | }
20 |
21 | sourceSets {
22 | main.java.srcDirs += 'src/main/kotlin'
23 | }
24 |
25 | dependencies {
26 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
27 | testCompile group: 'junit', name: 'junit', version: '4.11'
28 | }
29 |
--------------------------------------------------------------------------------
/current-address/core/src/main/kotlin/com/prt2121/currentaddress/CounterStore.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.currentaddress
2 |
3 | class CounterStore {
4 | private var count: Int = 0
5 |
6 | fun add(num: Int) {
7 | count += num
8 | }
9 |
10 | fun get(): Int {
11 | return count
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/current-address/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.jvmargs=-Xms128m -Xmx2000m
3 | org.gradle.configureondemand=true
--------------------------------------------------------------------------------
/current-address/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/current-address/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Nov 28 12:26:17 EST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip
7 |
--------------------------------------------------------------------------------
/current-address/ios/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
5 | }
6 | dependencies {
7 | classpath 'org.robovm:robovm-gradle-plugin:1.11.0'
8 | }
9 | }
10 |
11 | apply plugin: 'java'
12 | apply plugin: 'robovm'
13 | apply plugin: 'kotlin'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
20 | }
21 |
22 | sourceSets {
23 | main.java.srcDirs += 'src/main/kotlin'
24 | }
25 |
26 | ext {
27 | roboVMVersion = "1.11.0"
28 | }
29 |
30 | robovm {
31 | }
32 |
33 | dependencies {
34 | compile "org.robovm:robovm-rt:${roboVMVersion}"
35 | compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"
36 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
37 | testCompile "junit:junit:4.12"
38 | compile project(':core')
39 | }
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "filename" : "Default@2x~iphone.png",
9 | "scale" : "2x"
10 | },
11 | {
12 | "extent" : "full-screen",
13 | "idiom" : "iphone",
14 | "subtype" : "retina4",
15 | "filename" : "Default-568h@2x~iphone.png",
16 | "minimum-system-version" : "7.0",
17 | "orientation" : "portrait",
18 | "scale" : "2x"
19 | },
20 | {
21 | "orientation" : "portrait",
22 | "idiom" : "ipad",
23 | "extent" : "full-screen",
24 | "minimum-system-version" : "7.0",
25 | "filename" : "Default-Portrait~ipad.png",
26 | "scale" : "1x"
27 | },
28 | {
29 | "orientation" : "landscape",
30 | "idiom" : "ipad",
31 | "extent" : "full-screen",
32 | "minimum-system-version" : "7.0",
33 | "filename" : "Default-Landscape~ipad.png",
34 | "scale" : "1x"
35 | },
36 | {
37 | "orientation" : "portrait",
38 | "idiom" : "ipad",
39 | "extent" : "full-screen",
40 | "minimum-system-version" : "7.0",
41 | "filename" : "Default-Portrait@2x~ipad.png",
42 | "scale" : "2x"
43 | },
44 | {
45 | "orientation" : "landscape",
46 | "idiom" : "ipad",
47 | "extent" : "full-screen",
48 | "minimum-system-version" : "7.0",
49 | "filename" : "Default-Landscape@2x~ipad.png",
50 | "scale" : "2x"
51 | }
52 | ],
53 | "info" : {
54 | "version" : 1,
55 | "author" : "xcode"
56 | }
57 | }
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png
--------------------------------------------------------------------------------
/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/current-address/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png
--------------------------------------------------------------------------------
/current-address/ios/robovm.properties:
--------------------------------------------------------------------------------
1 | app.version=1.0
2 | app.id=com.prt2121.currentaddress
3 | app.mainclass=com.prt2121.currentaddress.CurrentAddress
4 | app.executable=CurrentAddress
5 | app.build=1
6 | app.name=Current Address
--------------------------------------------------------------------------------
/current-address/ios/robovm.xml:
--------------------------------------------------------------------------------
1 |
2 | ${app.executable}
3 | ${app.mainclass}
4 | ios
5 | ios
6 | Info.plist.xml
7 |
8 |
9 | resources
10 |
11 |
12 |
13 | MapKit
14 |
15 |
16 |
--------------------------------------------------------------------------------
/current-address/ios/src/main/kotlin/com/prt2121/currentaddress/CurrentAddress.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.currentaddress
2 |
3 | import org.robovm.apple.foundation.NSAutoreleasePool
4 | import org.robovm.apple.uikit.UIApplication
5 | import org.robovm.apple.uikit.UIApplicationDelegateAdapter
6 | import org.robovm.apple.uikit.UIApplicationLaunchOptions
7 |
8 | class CurrentAddress : UIApplicationDelegateAdapter() {
9 |
10 | override fun didFinishLaunching(application: UIApplication?, launchOptions: UIApplicationLaunchOptions?): Boolean {
11 | return true
12 | }
13 |
14 | companion object {
15 | @JvmStatic fun main(args: Array) {
16 | val pool = NSAutoreleasePool()
17 | UIApplication.main(args, null, CurrentAddress::class.java)
18 | pool.release()
19 | }
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/current-address/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':core', ':android', ':ios'
2 |
3 |
--------------------------------------------------------------------------------
/hello-ios/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | mavenCentral()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.3.0'
8 | classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
9 | }
10 | }
11 |
12 | plugins {
13 | id "me.tatarka.retrolambda" version "3.2.2"
14 | }
15 | apply plugin: 'com.android.application'
16 | apply plugin: 'kotlin-android'
17 |
18 | repositories {
19 | jcenter()
20 | mavenCentral()
21 | }
22 |
23 | android {
24 | compileSdkVersion 23
25 | buildToolsVersion "23.0.1"
26 |
27 | sourceSets {
28 | main.java.srcDirs += 'src/main/kotlin'
29 | }
30 |
31 | defaultConfig {
32 | applicationId "com.mycompany.fortune.android"
33 | minSdkVersion 9
34 | targetSdkVersion 23
35 | versionCode 1
36 | versionName "1.0"
37 | }
38 |
39 | compileOptions {
40 | sourceCompatibility JavaVersion.VERSION_1_8
41 | targetCompatibility JavaVersion.VERSION_1_8
42 | }
43 | buildTypes {
44 | release {
45 | minifyEnabled false
46 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
47 | }
48 | }
49 | }
50 |
51 | dependencies {
52 | compile fileTree(dir: 'libs', include: ['*.jar'])
53 | compile 'com.android.support:appcompat-v7:23+'
54 | compile 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version'
55 | compile project(':core')
56 | }
57 |
--------------------------------------------------------------------------------
/hello-ios/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.1.2/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/hello-ios/android/src/androidTest/java/com/prt2121/kitty/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.prt2121.kitty;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/hello-ios/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/hello-ios/android/src/main/kotlin/com/prt2121/kitty/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.kitty
2 |
3 | import android.app.Activity
4 | import android.os.Bundle
5 | import android.widget.Button
6 | import android.widget.TextView
7 |
8 | class MainActivity : Activity() {
9 | private val counterStore = CounterStore()
10 |
11 | override fun onCreate(savedInstanceState: Bundle?) {
12 | super.onCreate(savedInstanceState)
13 | setContentView(R.layout.activity_my)
14 |
15 | val counterTextView = findViewById(R.id.counterTextView) as TextView
16 | val counterButton = findViewById(R.id.counterButton) as Button
17 |
18 | counterButton.setOnClickListener { view ->
19 | counterStore.add(1)
20 | counterTextView.text = "Click Nr. " + counterStore.get()
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/hello-ios/android/src/main/res/layout/activity_my.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/hello-ios/android/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/android/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hello-ios/android/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/android/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hello-ios/android/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/android/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hello-ios/android/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/android/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hello-ios/android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Kitty
3 |
4 |
--------------------------------------------------------------------------------
/hello-ios/android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/hello-ios/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | buildscript {
3 | ext.kotlin_version = '1.0.0-beta-2423'
4 | repositories {
5 | jcenter()
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 | }
13 |
14 | task wrapper(type: Wrapper) {
15 | gradleVersion = '2.8'
16 | }
--------------------------------------------------------------------------------
/hello-ios/core/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | }
5 | }
6 |
7 | plugins {
8 | id "me.tatarka.retrolambda" version "3.2.2"
9 | }
10 | apply plugin: 'java'
11 | apply plugin: 'kotlin'
12 |
13 | version 'unspecified'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | }
20 |
21 | sourceSets {
22 | main.java.srcDirs += 'src/main/kotlin'
23 | }
24 |
25 | dependencies {
26 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
27 | testCompile group: 'junit', name: 'junit', version: '4.11'
28 | }
29 |
--------------------------------------------------------------------------------
/hello-ios/core/src/main/kotlin/com/prt2121/kitty/CounterStore.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.kitty
2 |
3 | class CounterStore {
4 | private var count: Int = 0
5 |
6 | fun add(num: Int) {
7 | count += num
8 | }
9 |
10 | fun get(): Int {
11 | return count
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/hello-ios/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.jvmargs=-Xms128m -Xmx2000m
3 | org.gradle.configureondemand=true
--------------------------------------------------------------------------------
/hello-ios/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/hello-ios/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Nov 25 21:38:06 EST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip
7 |
--------------------------------------------------------------------------------
/hello-ios/ios/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
5 | }
6 | dependencies {
7 | classpath 'org.robovm:robovm-gradle-plugin:1.11.0'
8 | }
9 | }
10 |
11 | apply plugin: 'java'
12 | apply plugin: 'robovm'
13 | apply plugin: 'kotlin'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
20 | }
21 |
22 | sourceSets {
23 | main.java.srcDirs += 'src/main/kotlin'
24 | }
25 |
26 | ext {
27 | roboVMVersion = "1.11.0"
28 | }
29 |
30 | robovm {
31 | }
32 |
33 | dependencies {
34 | compile "org.robovm:robovm-rt:${roboVMVersion}"
35 | compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"
36 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
37 | testCompile "junit:junit:4.12"
38 | compile project(':core')
39 | }
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "filename" : "Default@2x~iphone.png",
9 | "scale" : "2x"
10 | },
11 | {
12 | "extent" : "full-screen",
13 | "idiom" : "iphone",
14 | "subtype" : "retina4",
15 | "filename" : "Default-568h@2x~iphone.png",
16 | "minimum-system-version" : "7.0",
17 | "orientation" : "portrait",
18 | "scale" : "2x"
19 | },
20 | {
21 | "orientation" : "portrait",
22 | "idiom" : "ipad",
23 | "extent" : "full-screen",
24 | "minimum-system-version" : "7.0",
25 | "filename" : "Default-Portrait~ipad.png",
26 | "scale" : "1x"
27 | },
28 | {
29 | "orientation" : "landscape",
30 | "idiom" : "ipad",
31 | "extent" : "full-screen",
32 | "minimum-system-version" : "7.0",
33 | "filename" : "Default-Landscape~ipad.png",
34 | "scale" : "1x"
35 | },
36 | {
37 | "orientation" : "portrait",
38 | "idiom" : "ipad",
39 | "extent" : "full-screen",
40 | "minimum-system-version" : "7.0",
41 | "filename" : "Default-Portrait@2x~ipad.png",
42 | "scale" : "2x"
43 | },
44 | {
45 | "orientation" : "landscape",
46 | "idiom" : "ipad",
47 | "extent" : "full-screen",
48 | "minimum-system-version" : "7.0",
49 | "filename" : "Default-Landscape@2x~ipad.png",
50 | "scale" : "2x"
51 | }
52 | ],
53 | "info" : {
54 | "version" : 1,
55 | "author" : "xcode"
56 | }
57 | }
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png
--------------------------------------------------------------------------------
/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-ios/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png
--------------------------------------------------------------------------------
/hello-ios/ios/robovm.properties:
--------------------------------------------------------------------------------
1 | app.version=1.0
2 | app.id=com.prt2121.kitty
3 | app.mainclass=com.prt2121.kitty.Main
4 | app.executable=Main
5 | app.build=1
6 | app.name=Kitty
--------------------------------------------------------------------------------
/hello-ios/ios/robovm.xml:
--------------------------------------------------------------------------------
1 |
2 | ${app.executable}
3 | ${app.mainclass}
4 | ios
5 | ios
6 | Info.plist.xml
7 |
8 |
9 | resources
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/hello-ios/ios/src/main/kotlin/com/prt2121/kitty/Main.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.kitty
2 |
3 | import org.robovm.apple.foundation.NSAutoreleasePool
4 | import org.robovm.apple.uikit.UIApplication
5 | import org.robovm.apple.uikit.UIApplicationDelegateAdapter
6 | import org.robovm.apple.uikit.UIApplicationLaunchOptions
7 |
8 | class Main : UIApplicationDelegateAdapter() {
9 |
10 | override fun didFinishLaunching(application: UIApplication?, launchOptions: UIApplicationLaunchOptions?): Boolean {
11 | return true
12 | }
13 |
14 | companion object {
15 | @JvmStatic fun main(args: Array) {
16 | val pool = NSAutoreleasePool()
17 | UIApplication.main(args, null, Main::class.java)
18 | pool.release()
19 | }
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/hello-ios/ios/src/main/kotlin/com/prt2121/kitty/MyViewController.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.kitty
2 |
3 | import org.robovm.apple.foundation.NSURL
4 | import org.robovm.apple.uikit.*
5 | import org.robovm.objc.annotation.CustomClass
6 | import org.robovm.objc.annotation.IBAction
7 | import org.robovm.objc.annotation.IBOutlet
8 |
9 | @CustomClass("MyViewController")
10 | class MyViewController : UIViewController() {
11 | @IBOutlet
12 | private val textField: UITextField? = null
13 |
14 | @IBOutlet
15 | private val callButton: UIButton? = null
16 |
17 | var translatedNumber: String? = null
18 |
19 | @IBAction
20 | private fun clickedTranslate() {
21 | translatedNumber = PhoneTranslator.toNumber(textField?.text)
22 | textField!!.resignFirstResponder()
23 | if(translatedNumber.isNullOrBlank()) {
24 | println("isNullOrBlank")
25 | callButton!!.setTitle("Call ", UIControlState.Normal)
26 | callButton.isEnabled = false
27 | } else {
28 | println(translatedNumber)
29 | callButton!!.setTitle("Call " + translatedNumber, UIControlState.Normal)
30 | callButton.isEnabled = true
31 | }
32 | }
33 |
34 | @IBAction
35 | private fun clickedCall() {
36 | val url = NSURL("tel:" + translatedNumber)
37 | if(!UIApplication.getSharedApplication().openURL(url)) {
38 | val alert = UIAlertController("Not supported", "Scheme 'tel:' is not supported on this device",
39 | UIAlertControllerStyle.Alert)
40 | presentViewController(alert, true, null)
41 | }
42 | }
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/hello-ios/ios/src/main/kotlin/com/prt2121/kitty/PhoneTranslator.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.kitty
2 |
3 | /**
4 | * Created by pt2121 on 11/25/15.
5 | */
6 | object PhoneTranslator {
7 | fun toNumber(raw: String?): String {
8 | if (raw.isNullOrBlank()) {
9 | return ""
10 | } else {
11 | return raw!!.toUpperCase().fold("", {
12 | acc, c ->
13 | if (" -0123456789".contains(c)) {
14 | acc.plus(c)
15 | } else {
16 | acc.concat(toNumber(c))
17 | }
18 | })
19 | }
20 | }
21 |
22 | fun toNumber(c : Char): String {
23 | when {
24 | "ABC".contains(c) -> return "2"
25 | "DEF".contains(c) -> return "3"
26 | "GHI".contains(c) -> return "4"
27 | "JKL".contains(c) -> return "5"
28 | "MNO".contains(c) -> return "6"
29 | "PQRS".contains(c) -> return "7"
30 | "TUV".contains(c) -> return "8"
31 | "WXYZ".contains(c) -> return "9"
32 | else -> return ""
33 | }
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/hello-ios/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':core', ':android', ':ios'
2 |
3 |
--------------------------------------------------------------------------------
/hello-multiscreen/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | mavenCentral()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.3.0'
8 | classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
9 | }
10 | }
11 |
12 | plugins {
13 | id "me.tatarka.retrolambda" version "3.2.2"
14 | }
15 | apply plugin: 'com.android.application'
16 | apply plugin: 'kotlin-android'
17 |
18 | repositories {
19 | jcenter()
20 | mavenCentral()
21 | }
22 |
23 | android {
24 | compileSdkVersion 23
25 | buildToolsVersion "23.0.1"
26 |
27 | sourceSets {
28 | main.java.srcDirs += 'src/main/kotlin'
29 | }
30 |
31 | defaultConfig {
32 | applicationId "com.mycompany.fortune.android"
33 | minSdkVersion 9
34 | targetSdkVersion 23
35 | versionCode 1
36 | versionName "1.0"
37 | }
38 |
39 | compileOptions {
40 | sourceCompatibility JavaVersion.VERSION_1_8
41 | targetCompatibility JavaVersion.VERSION_1_8
42 | }
43 | buildTypes {
44 | release {
45 | minifyEnabled false
46 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
47 | }
48 | }
49 | }
50 |
51 | dependencies {
52 | compile fileTree(dir: 'libs', include: ['*.jar'])
53 | compile 'com.android.support:appcompat-v7:23+'
54 | compile 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version'
55 | compile project(':core')
56 | }
57 |
--------------------------------------------------------------------------------
/hello-multiscreen/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.1.2/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/hello-multiscreen/android/src/androidTest/java/com/prt2121/kitty/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.prt2121.kitty;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/hello-multiscreen/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/hello-multiscreen/android/src/main/kotlin/com/prt2121/kitty/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.kitty
2 |
3 | import android.app.Activity
4 | import android.os.Bundle
5 | import android.widget.Button
6 | import android.widget.TextView
7 |
8 | class MainActivity : Activity() {
9 | private val counterStore = CounterStore()
10 |
11 | override fun onCreate(savedInstanceState: Bundle?) {
12 | super.onCreate(savedInstanceState)
13 | setContentView(R.layout.activity_my)
14 |
15 | val counterTextView = findViewById(R.id.counterTextView) as TextView
16 | val counterButton = findViewById(R.id.counterButton) as Button
17 |
18 | counterButton.setOnClickListener { view ->
19 | counterStore.add(1)
20 | counterTextView.text = "Click Nr. " + counterStore.get()
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/hello-multiscreen/android/src/main/res/layout/activity_my.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/hello-multiscreen/android/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/android/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hello-multiscreen/android/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/android/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hello-multiscreen/android/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/android/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hello-multiscreen/android/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/android/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hello-multiscreen/android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Kitty
3 |
4 |
--------------------------------------------------------------------------------
/hello-multiscreen/android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/hello-multiscreen/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | buildscript {
3 | ext.kotlin_version = '1.0.0-beta-2423'
4 | repositories {
5 | jcenter()
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 | }
13 |
14 | task wrapper(type: Wrapper) {
15 | gradleVersion = '2.8'
16 | }
--------------------------------------------------------------------------------
/hello-multiscreen/core/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | }
5 | }
6 |
7 | plugins {
8 | id "me.tatarka.retrolambda" version "3.2.2"
9 | }
10 | apply plugin: 'java'
11 | apply plugin: 'kotlin'
12 |
13 | version 'unspecified'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | }
20 |
21 | sourceSets {
22 | main.java.srcDirs += 'src/main/kotlin'
23 | }
24 |
25 | dependencies {
26 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
27 | testCompile group: 'junit', name: 'junit', version: '4.11'
28 | }
29 |
--------------------------------------------------------------------------------
/hello-multiscreen/core/src/main/kotlin/com/prt2121/kitty/CounterStore.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.kitty
2 |
3 | class CounterStore {
4 | private var count: Int = 0
5 |
6 | fun add(num: Int) {
7 | count += num
8 | }
9 |
10 | fun get(): Int {
11 | return count
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/hello-multiscreen/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.jvmargs=-Xms128m -Xmx2000m
3 | org.gradle.configureondemand=true
--------------------------------------------------------------------------------
/hello-multiscreen/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/hello-multiscreen/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Nov 25 21:38:06 EST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip
7 |
--------------------------------------------------------------------------------
/hello-multiscreen/ios/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
5 | }
6 | dependencies {
7 | classpath 'org.robovm:robovm-gradle-plugin:1.11.0'
8 | }
9 | }
10 |
11 | apply plugin: 'java'
12 | apply plugin: 'robovm'
13 | apply plugin: 'kotlin'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
20 | }
21 |
22 | sourceSets {
23 | main.java.srcDirs += 'src/main/kotlin'
24 | }
25 |
26 | ext {
27 | roboVMVersion = "1.11.0"
28 | }
29 |
30 | robovm {
31 | }
32 |
33 | dependencies {
34 | compile "org.robovm:robovm-rt:${roboVMVersion}"
35 | compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"
36 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
37 | testCompile "junit:junit:4.12"
38 | compile project(':core')
39 | }
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "filename" : "Default@2x~iphone.png",
9 | "scale" : "2x"
10 | },
11 | {
12 | "extent" : "full-screen",
13 | "idiom" : "iphone",
14 | "subtype" : "retina4",
15 | "filename" : "Default-568h@2x~iphone.png",
16 | "minimum-system-version" : "7.0",
17 | "orientation" : "portrait",
18 | "scale" : "2x"
19 | },
20 | {
21 | "orientation" : "portrait",
22 | "idiom" : "ipad",
23 | "extent" : "full-screen",
24 | "minimum-system-version" : "7.0",
25 | "filename" : "Default-Portrait~ipad.png",
26 | "scale" : "1x"
27 | },
28 | {
29 | "orientation" : "landscape",
30 | "idiom" : "ipad",
31 | "extent" : "full-screen",
32 | "minimum-system-version" : "7.0",
33 | "filename" : "Default-Landscape~ipad.png",
34 | "scale" : "1x"
35 | },
36 | {
37 | "orientation" : "portrait",
38 | "idiom" : "ipad",
39 | "extent" : "full-screen",
40 | "minimum-system-version" : "7.0",
41 | "filename" : "Default-Portrait@2x~ipad.png",
42 | "scale" : "2x"
43 | },
44 | {
45 | "orientation" : "landscape",
46 | "idiom" : "ipad",
47 | "extent" : "full-screen",
48 | "minimum-system-version" : "7.0",
49 | "filename" : "Default-Landscape@2x~ipad.png",
50 | "scale" : "2x"
51 | }
52 | ],
53 | "info" : {
54 | "version" : 1,
55 | "author" : "xcode"
56 | }
57 | }
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/hello-multiscreen/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png
--------------------------------------------------------------------------------
/hello-multiscreen/ios/robovm.properties:
--------------------------------------------------------------------------------
1 | app.version=1.0
2 | app.id=com.prt2121.kitty
3 | app.mainclass=com.prt2121.kitty.Main
4 | app.executable=Main
5 | app.build=1
6 | app.name=Kitty
--------------------------------------------------------------------------------
/hello-multiscreen/ios/robovm.xml:
--------------------------------------------------------------------------------
1 |
2 | ${app.executable}
3 | ${app.mainclass}
4 | ios
5 | ios
6 | Info.plist.xml
7 |
8 |
9 | resources
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/hello-multiscreen/ios/src/main/kotlin/com/prt2121/kitty/CallHistoryController.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.kitty
2 |
3 | import org.robovm.apple.foundation.NSIndexPath
4 | import org.robovm.apple.uikit.UITableView
5 | import org.robovm.apple.uikit.UITableViewCell
6 | import org.robovm.apple.uikit.UITableViewCellStyle
7 | import org.robovm.apple.uikit.UITableViewController
8 | import org.robovm.objc.annotation.CustomClass
9 |
10 | /**
11 | * Created by pt2121 on 11/26/15.
12 | */
13 | @CustomClass("CallHistoryController")
14 | class CallHistoryController : UITableViewController() {
15 | val callHistoryCellId = "CallHistoryCell"
16 | var phoneNumbers = emptyList()
17 |
18 | override fun viewDidLoad() {
19 | super.viewDidLoad()
20 | }
21 |
22 | override fun getNumberOfSections(tableView: UITableView?): Long {
23 | return 1
24 | }
25 |
26 | override fun getNumberOfRowsInSection(tableView: UITableView?, section: Long): Long {
27 | return phoneNumbers.size.toLong()
28 | }
29 |
30 | override fun getCellForRow(tableView: UITableView?, indexPath: NSIndexPath?): UITableViewCell? {
31 | val row = indexPath!!.row
32 | var cell = tableView!!.dequeueReusableCell(callHistoryCellId)
33 | if (cell == null) {
34 | cell = UITableViewCell(UITableViewCellStyle.Default, callHistoryCellId)
35 | }
36 | cell.textLabel.text = phoneNumbers[row]
37 | return cell
38 | }
39 | }
--------------------------------------------------------------------------------
/hello-multiscreen/ios/src/main/kotlin/com/prt2121/kitty/Main.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.kitty
2 |
3 | import org.robovm.apple.foundation.NSAutoreleasePool
4 | import org.robovm.apple.uikit.UIApplication
5 | import org.robovm.apple.uikit.UIApplicationDelegateAdapter
6 | import org.robovm.apple.uikit.UIApplicationLaunchOptions
7 |
8 | class Main : UIApplicationDelegateAdapter() {
9 |
10 | override fun didFinishLaunching(application: UIApplication?, launchOptions: UIApplicationLaunchOptions?): Boolean {
11 | return true
12 | }
13 |
14 | companion object {
15 | @JvmStatic fun main(args: Array) {
16 | val pool = NSAutoreleasePool()
17 | UIApplication.main(args, null, Main::class.java)
18 | pool.release()
19 | }
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/hello-multiscreen/ios/src/main/kotlin/com/prt2121/kitty/PhoneTranslator.kt:
--------------------------------------------------------------------------------
1 | package com.prt2121.kitty
2 |
3 | /**
4 | * Created by pt2121 on 11/25/15.
5 | */
6 | object PhoneTranslator {
7 | fun toNumber(raw: String?): String {
8 | if (raw.isNullOrBlank()) {
9 | return ""
10 | } else {
11 | return raw!!.toUpperCase().fold("", {
12 | acc, c ->
13 | if (" -0123456789".contains(c)) {
14 | acc.plus(c)
15 | } else {
16 | acc.concat(toNumber(c))
17 | }
18 | })
19 | }
20 | }
21 |
22 | fun toNumber(c: Char): String {
23 | when {
24 | "ABC".contains(c) -> return "2"
25 | "DEF".contains(c) -> return "3"
26 | "GHI".contains(c) -> return "4"
27 | "JKL".contains(c) -> return "5"
28 | "MNO".contains(c) -> return "6"
29 | "PQRS".contains(c) -> return "7"
30 | "TUV".contains(c) -> return "8"
31 | "WXYZ".contains(c) -> return "9"
32 | else -> return ""
33 | }
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/hello-multiscreen/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':core', ':android', ':ios'
2 |
3 |
--------------------------------------------------------------------------------
/message/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | mavenCentral()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.3.0'
8 | classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
9 | }
10 | }
11 |
12 | plugins {
13 | id "me.tatarka.retrolambda" version "3.2.2"
14 | }
15 | apply plugin: 'com.android.application'
16 | apply plugin: 'kotlin-android'
17 |
18 | repositories {
19 | jcenter()
20 | mavenCentral()
21 | }
22 |
23 | android {
24 | compileSdkVersion 23
25 | buildToolsVersion "23.0.1"
26 |
27 | sourceSets {
28 | main.java.srcDirs += 'src/main/kotlin'
29 | }
30 |
31 | defaultConfig {
32 | applicationId "com.mycompany.fortune.android"
33 | minSdkVersion 9
34 | targetSdkVersion 23
35 | versionCode 1
36 | versionName "1.0"
37 | }
38 |
39 | compileOptions {
40 | sourceCompatibility JavaVersion.VERSION_1_8
41 | targetCompatibility JavaVersion.VERSION_1_8
42 | }
43 | buildTypes {
44 | release {
45 | minifyEnabled false
46 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
47 | }
48 | }
49 | }
50 |
51 | dependencies {
52 | compile fileTree(dir: 'libs', include: ['*.jar'])
53 | compile 'com.android.support:appcompat-v7:23+'
54 | compile 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version'
55 | compile project(':core')
56 | }
57 |
--------------------------------------------------------------------------------
/message/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.1.2/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/message/android/src/androidTest/java/com/prat/message/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.prat.message;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/message/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/message/android/src/main/kotlin/com/prat/message/MessageActivity.kt:
--------------------------------------------------------------------------------
1 | package com.prat.message
2 |
3 | import android.app.Activity
4 | import android.os.Bundle
5 | import android.widget.Button
6 | import android.widget.TextView
7 |
8 | class MessageActivity : Activity() {
9 | private val counterStore = CounterStore()
10 |
11 | override fun onCreate(savedInstanceState: Bundle?) {
12 | super.onCreate(savedInstanceState)
13 | setContentView(R.layout.activity_my)
14 |
15 | val counterTextView = findViewById(R.id.counterTextView) as TextView
16 | val counterButton = findViewById(R.id.counterButton) as Button
17 |
18 | counterButton.setOnClickListener { view ->
19 | counterStore.add(1)
20 | counterTextView.text = "Click Nr. " + counterStore.get()
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/message/android/src/main/res/layout/activity_my.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/message/android/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/android/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/message/android/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/android/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/message/android/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/android/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/message/android/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/android/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/message/android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Message
3 |
4 |
--------------------------------------------------------------------------------
/message/android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/message/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | buildscript {
3 | ext.kotlin_version = '1.0.0-beta-2423'
4 | repositories {
5 | jcenter()
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 | }
13 |
14 | task wrapper(type: Wrapper) {
15 | gradleVersion = '2.8'
16 | }
--------------------------------------------------------------------------------
/message/core/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | }
5 | }
6 |
7 | plugins {
8 | id "me.tatarka.retrolambda" version "3.2.2"
9 | }
10 | apply plugin: 'java'
11 | apply plugin: 'kotlin'
12 |
13 | version 'unspecified'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | }
20 |
21 | sourceSets {
22 | main.java.srcDirs += 'src/main/kotlin'
23 | }
24 |
25 | dependencies {
26 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
27 | testCompile group: 'junit', name: 'junit', version: '4.11'
28 | }
29 |
--------------------------------------------------------------------------------
/message/core/src/main/kotlin/com/prat/message/CounterStore.kt:
--------------------------------------------------------------------------------
1 | package com.prat.message
2 |
3 | class CounterStore {
4 | private var count: Int = 0
5 |
6 | fun add(num: Int) {
7 | count += num
8 | }
9 |
10 | fun get(): Int {
11 | return count
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/message/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.jvmargs=-Xms128m -Xmx2000m
3 | org.gradle.configureondemand=true
--------------------------------------------------------------------------------
/message/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/message/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Nov 30 19:41:44 EST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip
7 |
--------------------------------------------------------------------------------
/message/ios/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
5 | }
6 | dependencies {
7 | classpath 'org.robovm:robovm-gradle-plugin:1.11.0'
8 | }
9 | }
10 |
11 | apply plugin: 'java'
12 | apply plugin: 'robovm'
13 | apply plugin: 'kotlin'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
20 | }
21 |
22 | sourceSets {
23 | main.java.srcDirs += 'src/main/kotlin'
24 | }
25 |
26 | ext {
27 | roboVMVersion = "1.11.0"
28 | }
29 |
30 | robovm {
31 | }
32 |
33 | dependencies {
34 | compile "org.robovm:robovm-rt:${roboVMVersion}"
35 | compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"
36 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
37 | testCompile "junit:junit:4.12"
38 | compile project(':core')
39 | }
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "filename" : "Default@2x~iphone.png",
9 | "scale" : "2x"
10 | },
11 | {
12 | "extent" : "full-screen",
13 | "idiom" : "iphone",
14 | "subtype" : "retina4",
15 | "filename" : "Default-568h@2x~iphone.png",
16 | "minimum-system-version" : "7.0",
17 | "orientation" : "portrait",
18 | "scale" : "2x"
19 | },
20 | {
21 | "orientation" : "portrait",
22 | "idiom" : "ipad",
23 | "extent" : "full-screen",
24 | "minimum-system-version" : "7.0",
25 | "filename" : "Default-Portrait~ipad.png",
26 | "scale" : "1x"
27 | },
28 | {
29 | "orientation" : "landscape",
30 | "idiom" : "ipad",
31 | "extent" : "full-screen",
32 | "minimum-system-version" : "7.0",
33 | "filename" : "Default-Landscape~ipad.png",
34 | "scale" : "1x"
35 | },
36 | {
37 | "orientation" : "portrait",
38 | "idiom" : "ipad",
39 | "extent" : "full-screen",
40 | "minimum-system-version" : "7.0",
41 | "filename" : "Default-Portrait@2x~ipad.png",
42 | "scale" : "2x"
43 | },
44 | {
45 | "orientation" : "landscape",
46 | "idiom" : "ipad",
47 | "extent" : "full-screen",
48 | "minimum-system-version" : "7.0",
49 | "filename" : "Default-Landscape@2x~ipad.png",
50 | "scale" : "2x"
51 | }
52 | ],
53 | "info" : {
54 | "version" : 1,
55 | "author" : "xcode"
56 | }
57 | }
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png
--------------------------------------------------------------------------------
/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png
--------------------------------------------------------------------------------
/message/ios/resources/rainy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/message/ios/resources/rainy.jpg
--------------------------------------------------------------------------------
/message/ios/robovm.properties:
--------------------------------------------------------------------------------
1 | app.version=1.0
2 | app.id=com.prat.message
3 | app.mainclass=com.prat.message.Message
4 | app.executable=Message
5 | app.build=1
6 | app.name=Message
--------------------------------------------------------------------------------
/message/ios/robovm.xml:
--------------------------------------------------------------------------------
1 |
2 | ${app.executable}
3 | ${app.mainclass}
4 | ios
5 | ios
6 | Info.plist.xml
7 |
8 |
9 | resources
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/message/ios/src/main/kotlin/com/prat/message/Message.kt:
--------------------------------------------------------------------------------
1 | package com.prat.message
2 |
3 | import org.robovm.apple.foundation.NSAutoreleasePool
4 | import org.robovm.apple.uikit.UIApplication
5 | import org.robovm.apple.uikit.UIApplicationDelegateAdapter
6 | import org.robovm.apple.uikit.UIApplicationLaunchOptions
7 |
8 | class Message : UIApplicationDelegateAdapter() {
9 |
10 | override fun didFinishLaunching(application: UIApplication?, launchOptions: UIApplicationLaunchOptions?): Boolean {
11 | return true
12 | }
13 |
14 | companion object {
15 | @JvmStatic fun main(args: Array) {
16 | val pool = NSAutoreleasePool()
17 | UIApplication.main(args, null, Message::class.java)
18 | pool.release()
19 | }
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/message/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':core', ':android', ':ios'
2 |
3 |
--------------------------------------------------------------------------------
/rest-client/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | mavenCentral()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.3.0'
8 | classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
9 | }
10 | }
11 |
12 | plugins {
13 | id "me.tatarka.retrolambda" version "3.2.2"
14 | }
15 | apply plugin: 'com.android.application'
16 | apply plugin: 'kotlin-android'
17 |
18 | repositories {
19 | jcenter()
20 | mavenCentral()
21 | }
22 |
23 | android {
24 | compileSdkVersion 23
25 | buildToolsVersion "23.0.1"
26 |
27 | sourceSets {
28 | main.java.srcDirs += 'src/main/kotlin'
29 | }
30 |
31 | defaultConfig {
32 | applicationId "com.mycompany.fortune.android"
33 | minSdkVersion 9
34 | targetSdkVersion 23
35 | versionCode 1
36 | versionName "1.0"
37 | }
38 |
39 | compileOptions {
40 | sourceCompatibility JavaVersion.VERSION_1_8
41 | targetCompatibility JavaVersion.VERSION_1_8
42 | }
43 | buildTypes {
44 | release {
45 | minifyEnabled false
46 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
47 | }
48 | }
49 | }
50 |
51 | dependencies {
52 | compile fileTree(dir: 'libs', include: ['*.jar'])
53 | compile 'com.android.support:appcompat-v7:23+'
54 | compile 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version'
55 | compile project(':core')
56 | }
57 |
--------------------------------------------------------------------------------
/rest-client/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.1.2/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/rest-client/android/src/androidTest/java/com/prat/restclient/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.prat.restclient;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/rest-client/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/rest-client/android/src/main/kotlin/com/prat/restclient/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.prat.restclient
2 |
3 | import android.app.Activity
4 | import android.os.Bundle
5 | import android.widget.Button
6 | import android.widget.TextView
7 |
8 | class MainActivity : Activity() {
9 | private val counterStore = CounterStore()
10 |
11 | override fun onCreate(savedInstanceState: Bundle?) {
12 | super.onCreate(savedInstanceState)
13 | setContentView(R.layout.activity_my)
14 |
15 | val counterTextView = findViewById(R.id.counterTextView) as TextView
16 | val counterButton = findViewById(R.id.counterButton) as Button
17 |
18 | counterButton.setOnClickListener { view ->
19 | counterStore.add(1)
20 | counterTextView.text = "Click Nr. " + counterStore.get()
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/rest-client/android/src/main/res/layout/activity_my.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/rest-client/android/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/android/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/rest-client/android/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/android/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/rest-client/android/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/android/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/rest-client/android/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/android/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/rest-client/android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Rest Client
3 |
4 |
--------------------------------------------------------------------------------
/rest-client/android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/rest-client/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | buildscript {
3 | ext.kotlin_version = '1.0.0-beta-2423'
4 | repositories {
5 | jcenter()
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 | }
13 |
14 | task wrapper(type: Wrapper) {
15 | gradleVersion = '2.8'
16 | }
--------------------------------------------------------------------------------
/rest-client/core/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | }
5 | }
6 |
7 | plugins {
8 | id "me.tatarka.retrolambda" version "3.2.2"
9 | }
10 | apply plugin: 'java'
11 | apply plugin: 'kotlin'
12 |
13 | version 'unspecified'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | }
20 |
21 | sourceSets {
22 | main.java.srcDirs += 'src/main/kotlin'
23 | }
24 |
25 | dependencies {
26 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
27 | compile 'org.apache.commons:commons-lang3:3.3'
28 | compile 'commons-io:commons-io:2.4'
29 | compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
30 | compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
31 | compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta2'
32 | compile 'com.google.code.gson:gson:2.3.1'
33 | compile 'io.reactivex:rxjava:1.0.14'
34 |
35 |
36 | testCompile group: 'junit', name: 'junit', version: '4.11'
37 | }
38 |
--------------------------------------------------------------------------------
/rest-client/core/src/main/kotlin/com/prat/restclient/CounterStore.kt:
--------------------------------------------------------------------------------
1 | package com.prat.restclient
2 |
3 | class CounterStore {
4 | private var count: Int = 0
5 |
6 | fun add(num: Int) {
7 | count += num
8 | }
9 |
10 | fun get(): Int {
11 | return count
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/rest-client/core/src/main/kotlin/com/prat/restclient/GitHubService.kt:
--------------------------------------------------------------------------------
1 | package com.prat.restclient
2 |
3 | import retrofit.http.GET
4 | import retrofit.http.Path
5 | import rx.Observable
6 |
7 | /**
8 | * Created by pt2121 on 12/1/15.
9 | */
10 | public interface GitHubService {
11 |
12 | @GET("/repos/{owner}/{repo}")
13 | fun repo(@Path("owner") owner: String, @Path("repo") repo: String): Observable
14 |
15 | }
--------------------------------------------------------------------------------
/rest-client/core/src/main/kotlin/com/prat/restclient/Repo.kt:
--------------------------------------------------------------------------------
1 | package com.prat.restclient
2 |
3 | /**
4 | * Created by pt2121 on 12/1/15.
5 | */
6 | data class Repo(var id: String, val name: String, val description: String)
--------------------------------------------------------------------------------
/rest-client/core/src/main/kotlin/com/prat/restclient/WebService.kt:
--------------------------------------------------------------------------------
1 | package com.prat.restclient
2 |
3 | import retrofit.GsonConverterFactory
4 | import retrofit.Retrofit
5 | import retrofit.RxJavaCallAdapterFactory
6 | import rx.Observable
7 |
8 | /**
9 | * Created by pt2121 on 12/1/15.
10 | */
11 | class WebService {
12 |
13 | val API_URL: String = "https://api.github.com"
14 |
15 | public fun repo(): Observable {
16 | val retrofit = Retrofit.Builder()
17 | .baseUrl(API_URL)
18 | .addConverterFactory(GsonConverterFactory.create())
19 | .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
20 | .build()
21 | val api = retrofit.create(GitHubService::class.java)
22 | return api.repo("prt2121", "kotlin-ios")
23 | }
24 |
25 | companion object {
26 | fun newInstance(): WebService = WebService()
27 | }
28 | }
--------------------------------------------------------------------------------
/rest-client/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.jvmargs=-Xms128m -Xmx2000m
3 | org.gradle.configureondemand=true
--------------------------------------------------------------------------------
/rest-client/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/rest-client/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Dec 01 08:02:35 EST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip
7 |
--------------------------------------------------------------------------------
/rest-client/ios/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
5 | }
6 | dependencies {
7 | classpath 'org.robovm:robovm-gradle-plugin:1.11.0'
8 | }
9 | }
10 |
11 | apply plugin: 'java'
12 | apply plugin: 'robovm'
13 | apply plugin: 'kotlin'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
20 | }
21 |
22 | sourceSets {
23 | main.java.srcDirs += 'src/main/kotlin'
24 | }
25 |
26 | ext {
27 | roboVMVersion = "1.11.0"
28 | }
29 |
30 | robovm {
31 | }
32 |
33 | dependencies {
34 | compile "org.robovm:robovm-rt:${roboVMVersion}"
35 | compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"
36 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
37 | testCompile "junit:junit:4.12"
38 | compile project(':core')
39 | }
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "filename" : "Default@2x~iphone.png",
9 | "scale" : "2x"
10 | },
11 | {
12 | "extent" : "full-screen",
13 | "idiom" : "iphone",
14 | "subtype" : "retina4",
15 | "filename" : "Default-568h@2x~iphone.png",
16 | "minimum-system-version" : "7.0",
17 | "orientation" : "portrait",
18 | "scale" : "2x"
19 | },
20 | {
21 | "orientation" : "portrait",
22 | "idiom" : "ipad",
23 | "extent" : "full-screen",
24 | "minimum-system-version" : "7.0",
25 | "filename" : "Default-Portrait~ipad.png",
26 | "scale" : "1x"
27 | },
28 | {
29 | "orientation" : "landscape",
30 | "idiom" : "ipad",
31 | "extent" : "full-screen",
32 | "minimum-system-version" : "7.0",
33 | "filename" : "Default-Landscape~ipad.png",
34 | "scale" : "1x"
35 | },
36 | {
37 | "orientation" : "portrait",
38 | "idiom" : "ipad",
39 | "extent" : "full-screen",
40 | "minimum-system-version" : "7.0",
41 | "filename" : "Default-Portrait@2x~ipad.png",
42 | "scale" : "2x"
43 | },
44 | {
45 | "orientation" : "landscape",
46 | "idiom" : "ipad",
47 | "extent" : "full-screen",
48 | "minimum-system-version" : "7.0",
49 | "filename" : "Default-Landscape@2x~ipad.png",
50 | "scale" : "2x"
51 | }
52 | ],
53 | "info" : {
54 | "version" : 1,
55 | "author" : "xcode"
56 | }
57 | }
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png
--------------------------------------------------------------------------------
/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/rest-client/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png
--------------------------------------------------------------------------------
/rest-client/ios/robovm.properties:
--------------------------------------------------------------------------------
1 | app.version=1.0
2 | app.id=com.prat.restclient
3 | app.mainclass=com.prat.restclient.Main
4 | app.executable=Main
5 | app.build=1
6 | app.name=Rest Client
--------------------------------------------------------------------------------
/rest-client/ios/robovm.xml:
--------------------------------------------------------------------------------
1 |
2 | ${app.executable}
3 | ${app.mainclass}
4 | ios
5 | ios
6 | Info.plist.xml
7 |
8 |
9 | resources
10 |
11 |
12 |
13 | com.prat.restclient.**
14 | com.android.org.conscrypt.**
15 | com.android.org.bouncycastle.jce.provider.BouncyCastleProvider
16 | com.android.org.bouncycastle.jcajce.provider.keystore.BC$Mappings
17 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi
18 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi$Std
19 | com.android.org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi
20 | com.android.org.bouncycastle.jce.provider.RFC3280CertPathUtilities
21 | com.android.org.bouncycastle.crypto.digests.AndroidDigestFactoryOpenSSL
22 | org.apache.harmony.security.provider.**
23 |
24 |
25 |
--------------------------------------------------------------------------------
/rest-client/ios/src/main/kotlin/com/prat/restclient/Main.kt:
--------------------------------------------------------------------------------
1 | package com.prat.restclient
2 |
3 | import org.robovm.apple.foundation.NSAutoreleasePool
4 | import org.robovm.apple.uikit.UIApplication
5 | import org.robovm.apple.uikit.UIApplicationDelegateAdapter
6 | import org.robovm.apple.uikit.UIApplicationLaunchOptions
7 |
8 | class Main : UIApplicationDelegateAdapter() {
9 |
10 | override fun didFinishLaunching(application: UIApplication?, launchOptions: UIApplicationLaunchOptions?): Boolean {
11 | return true
12 | }
13 |
14 | companion object {
15 | @JvmStatic fun main(args: Array) {
16 | val pool = NSAutoreleasePool()
17 | UIApplication.main(args, null, Main::class.java)
18 | pool.release()
19 | }
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/rest-client/ios/src/main/kotlin/com/prat/restclient/MyViewController.kt:
--------------------------------------------------------------------------------
1 | package com.prat.restclient
2 |
3 | import org.robovm.apple.uikit.UILabel
4 | import org.robovm.apple.uikit.UIViewController
5 | import org.robovm.objc.annotation.CustomClass
6 | import org.robovm.objc.annotation.IBAction
7 | import org.robovm.objc.annotation.IBOutlet
8 |
9 | @CustomClass("MyViewController")
10 | class MyViewController : UIViewController() {
11 | private val counterStore = CounterStore()
12 |
13 | @IBOutlet
14 | private val label: UILabel? = null
15 |
16 | @IBAction
17 | private fun clicked() {
18 | counterStore.add(1)
19 | label!!.text = "Click Nr. " + counterStore.get()
20 | WebService.newInstance().repo().subscribe({
21 | println("${it.name} : ${it.description}")
22 | }, {
23 | println(it.message)
24 | })
25 | }
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/rest-client/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':core', ':android', ':ios'
2 |
3 |
--------------------------------------------------------------------------------
/tableSearch/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | mavenCentral()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.3.0'
8 | classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
9 | }
10 | }
11 |
12 | plugins {
13 | id "me.tatarka.retrolambda" version "3.2.2"
14 | }
15 | apply plugin: 'com.android.application'
16 | apply plugin: 'kotlin-android'
17 |
18 | repositories {
19 | jcenter()
20 | mavenCentral()
21 | }
22 |
23 | android {
24 | compileSdkVersion 23
25 | buildToolsVersion "23.0.1"
26 |
27 | sourceSets {
28 | main.java.srcDirs += 'src/main/kotlin'
29 | }
30 |
31 | defaultConfig {
32 | applicationId "com.mycompany.fortune.android"
33 | minSdkVersion 9
34 | targetSdkVersion 23
35 | versionCode 1
36 | versionName "1.0"
37 | }
38 |
39 | compileOptions {
40 | sourceCompatibility JavaVersion.VERSION_1_8
41 | targetCompatibility JavaVersion.VERSION_1_8
42 | }
43 | buildTypes {
44 | release {
45 | minifyEnabled false
46 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
47 | }
48 | }
49 | }
50 |
51 | dependencies {
52 | compile fileTree(dir: 'libs', include: ['*.jar'])
53 | compile 'com.android.support:appcompat-v7:23+'
54 | compile 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version'
55 | compile project(':core')
56 | }
57 |
--------------------------------------------------------------------------------
/tableSearch/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.1.2/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/tableSearch/android/src/androidTest/java/com/prat/tablesearch/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.prat.tablesearch;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/tableSearch/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/tableSearch/android/src/main/kotlin/com/prat/tablesearch/TableSearchActivity.kt:
--------------------------------------------------------------------------------
1 | package com.prat.tablesearch
2 |
3 | import android.app.Activity
4 | import android.os.Bundle
5 | import android.widget.Button
6 | import android.widget.TextView
7 |
8 | class TableSearchActivity : Activity() {
9 | private val counterStore = CounterStore()
10 |
11 | override fun onCreate(savedInstanceState: Bundle?) {
12 | super.onCreate(savedInstanceState)
13 | setContentView(R.layout.activity_my)
14 |
15 | val counterTextView = findViewById(R.id.counterTextView) as TextView
16 | val counterButton = findViewById(R.id.counterButton) as Button
17 |
18 | counterButton.setOnClickListener { view ->
19 | counterStore.add(1)
20 | counterTextView.text = "Click Nr. " + counterStore.get()
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tableSearch/android/src/main/res/layout/activity_my.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/tableSearch/android/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/android/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/tableSearch/android/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/android/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/tableSearch/android/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/android/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/tableSearch/android/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/android/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/tableSearch/android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Table Search
3 |
4 |
--------------------------------------------------------------------------------
/tableSearch/android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/tableSearch/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | buildscript {
3 | ext.kotlin_version = '1.0.0-beta-2423'
4 | repositories {
5 | jcenter()
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 | }
13 |
14 | task wrapper(type: Wrapper) {
15 | gradleVersion = '2.8'
16 | }
--------------------------------------------------------------------------------
/tableSearch/core/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | }
5 | }
6 |
7 | plugins {
8 | id "me.tatarka.retrolambda" version "3.2.2"
9 | }
10 | apply plugin: 'java'
11 | apply plugin: 'kotlin'
12 |
13 | version 'unspecified'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | }
20 |
21 | sourceSets {
22 | main.java.srcDirs += 'src/main/kotlin'
23 | }
24 |
25 | dependencies {
26 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
27 | testCompile group: 'junit', name: 'junit', version: '4.11'
28 | }
29 |
--------------------------------------------------------------------------------
/tableSearch/core/src/main/kotlin/com/prat/tablesearch/CounterStore.kt:
--------------------------------------------------------------------------------
1 | package com.prat.tablesearch
2 |
3 | class CounterStore {
4 | private var count: Int = 0
5 |
6 | fun add(num: Int) {
7 | count += num
8 | }
9 |
10 | fun get(): Int {
11 | return count
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/tableSearch/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.jvmargs=-Xms128m -Xmx2000m
3 | org.gradle.configureondemand=true
--------------------------------------------------------------------------------
/tableSearch/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/tableSearch/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Nov 27 14:15:48 EST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip
7 |
--------------------------------------------------------------------------------
/tableSearch/ios/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
5 | }
6 | dependencies {
7 | classpath 'org.robovm:robovm-gradle-plugin:1.11.0'
8 | }
9 | }
10 |
11 | apply plugin: 'java'
12 | apply plugin: 'robovm'
13 | apply plugin: 'kotlin'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
20 | }
21 |
22 | sourceSets {
23 | main.java.srcDirs += 'src/main/kotlin'
24 | }
25 |
26 | ext {
27 | roboVMVersion = "1.11.0"
28 | }
29 |
30 | robovm {
31 | }
32 |
33 | dependencies {
34 | compile "org.robovm:robovm-rt:${roboVMVersion}"
35 | compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"
36 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
37 | testCompile "junit:junit:4.12"
38 | compile project(':core')
39 | }
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "filename" : "Default@2x~iphone.png",
9 | "scale" : "2x"
10 | },
11 | {
12 | "extent" : "full-screen",
13 | "idiom" : "iphone",
14 | "subtype" : "retina4",
15 | "filename" : "Default-568h@2x~iphone.png",
16 | "minimum-system-version" : "7.0",
17 | "orientation" : "portrait",
18 | "scale" : "2x"
19 | },
20 | {
21 | "orientation" : "portrait",
22 | "idiom" : "ipad",
23 | "extent" : "full-screen",
24 | "minimum-system-version" : "7.0",
25 | "filename" : "Default-Portrait~ipad.png",
26 | "scale" : "1x"
27 | },
28 | {
29 | "orientation" : "landscape",
30 | "idiom" : "ipad",
31 | "extent" : "full-screen",
32 | "minimum-system-version" : "7.0",
33 | "filename" : "Default-Landscape~ipad.png",
34 | "scale" : "1x"
35 | },
36 | {
37 | "orientation" : "portrait",
38 | "idiom" : "ipad",
39 | "extent" : "full-screen",
40 | "minimum-system-version" : "7.0",
41 | "filename" : "Default-Portrait@2x~ipad.png",
42 | "scale" : "2x"
43 | },
44 | {
45 | "orientation" : "landscape",
46 | "idiom" : "ipad",
47 | "extent" : "full-screen",
48 | "minimum-system-version" : "7.0",
49 | "filename" : "Default-Landscape@2x~ipad.png",
50 | "scale" : "2x"
51 | }
52 | ],
53 | "info" : {
54 | "version" : 1,
55 | "author" : "xcode"
56 | }
57 | }
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png
--------------------------------------------------------------------------------
/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/tableSearch/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png
--------------------------------------------------------------------------------
/tableSearch/ios/robovm.properties:
--------------------------------------------------------------------------------
1 | app.version=1.0
2 | app.id=com.prat.tablesearch
3 | app.mainclass=com.prat.tablesearch.TableSearch
4 | app.executable=TableSearch
5 | app.build=1
6 | app.name=Table Search
--------------------------------------------------------------------------------
/tableSearch/ios/robovm.xml:
--------------------------------------------------------------------------------
1 |
2 | ${app.executable}
3 | ${app.mainclass}
4 | ios
5 | ios
6 | Info.plist.xml
7 |
8 |
9 | resources
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/tableSearch/ios/src/main/kotlin/com/prat/tablesearch/APLBaseTableViewController.kt:
--------------------------------------------------------------------------------
1 | package com.prat.tablesearch
2 |
3 | import org.robovm.apple.foundation.NSNumber
4 | import org.robovm.apple.foundation.NSNumberFormatter
5 | import org.robovm.apple.foundation.NSNumberFormatterStyle
6 | import org.robovm.apple.uikit.UINib
7 | import org.robovm.apple.uikit.UITableViewCell
8 | import org.robovm.apple.uikit.UITableViewController
9 | import org.robovm.objc.annotation.CustomClass
10 |
11 | @CustomClass("APLBaseTableViewController")
12 | open class APLBaseTableViewController : UITableViewController() {
13 | internal val CELL_IDENTIFIER = "cellID"
14 | private val TABLE_CELL_NIB_NAME = "TableCell"
15 |
16 | override fun viewDidLoad() {
17 | super.viewDidLoad()
18 |
19 | // we use a nib which contains the cell's view and this class as the
20 | // files owner
21 | tableView.registerReusableCellNib(UINib(TABLE_CELL_NIB_NAME, null), CELL_IDENTIFIER)
22 | }
23 |
24 | fun configureCell(cell: UITableViewCell, product: APLProduct) {
25 | cell.textLabel.text = product.title
26 |
27 | // build the price and year string
28 | // use NSNumberFormatter to get the currency format out of this NSNumber
29 | // (product.introPrice)
30 | val numFormatter = NSNumberFormatter()
31 | numFormatter.numberStyle = NSNumberFormatterStyle.Currency
32 | val priceString = numFormatter.format(NSNumber.valueOf(product.introPrice))
33 |
34 | val detailedStr = "$priceString | ${product.yearIntroduced}"
35 | cell.detailTextLabel.text = detailedStr
36 | }
37 | }
--------------------------------------------------------------------------------
/tableSearch/ios/src/main/kotlin/com/prat/tablesearch/APLResultsTableViewController.kt:
--------------------------------------------------------------------------------
1 | package com.prat.tablesearch
2 |
3 | /**
4 | * Created by pt2121 on 11/27/15.
5 | */
6 |
7 |
8 | import org.robovm.apple.foundation.NSIndexPath
9 | import org.robovm.apple.uikit.UITableView
10 | import org.robovm.apple.uikit.UITableViewCell
11 | import org.robovm.objc.annotation.CustomClass
12 |
13 | @CustomClass("APLResultsTableViewController")
14 | class APLResultsTableViewController : APLBaseTableViewController() {
15 | var filteredProducts: List? = null
16 |
17 | override fun getNumberOfRowsInSection(tableView: UITableView, section: Long): Long {
18 | return filteredProducts!!.size.toLong()
19 | }
20 |
21 | override fun getCellForRow(tableView: UITableView, indexPath: NSIndexPath): UITableViewCell {
22 | val product = filteredProducts!![indexPath.row.toInt()]
23 |
24 | val cell = getTableView().dequeueReusableCell(CELL_IDENTIFIER)
25 | configureCell(cell, product)
26 | return cell
27 | }
28 | }
--------------------------------------------------------------------------------
/tableSearch/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':core', ':android', ':ios'
2 |
3 |
--------------------------------------------------------------------------------
/webview/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | mavenCentral()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.3.0'
8 | classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
9 | }
10 | }
11 |
12 | plugins {
13 | id "me.tatarka.retrolambda" version "3.2.2"
14 | }
15 | apply plugin: 'com.android.application'
16 | apply plugin: 'kotlin-android'
17 |
18 | repositories {
19 | jcenter()
20 | mavenCentral()
21 | }
22 |
23 | android {
24 | compileSdkVersion 23
25 | buildToolsVersion "23.0.1"
26 |
27 | sourceSets {
28 | main.java.srcDirs += 'src/main/kotlin'
29 | }
30 |
31 | defaultConfig {
32 | applicationId "com.mycompany.fortune.android"
33 | minSdkVersion 9
34 | targetSdkVersion 23
35 | versionCode 1
36 | versionName "1.0"
37 | }
38 |
39 | compileOptions {
40 | sourceCompatibility JavaVersion.VERSION_1_8
41 | targetCompatibility JavaVersion.VERSION_1_8
42 | }
43 | buildTypes {
44 | release {
45 | minifyEnabled false
46 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
47 | }
48 | }
49 | }
50 |
51 | dependencies {
52 | compile fileTree(dir: 'libs', include: ['*.jar'])
53 | compile 'com.android.support:appcompat-v7:23+'
54 | compile 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version'
55 | compile project(':core')
56 | }
57 |
--------------------------------------------------------------------------------
/webview/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.1.2/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/webview/android/src/androidTest/java/com/prat/webview/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.prat.webview;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/webview/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/webview/android/src/main/kotlin/com/prat/webview/WebviewActivity.kt:
--------------------------------------------------------------------------------
1 | package com.prat.webview
2 |
3 | import android.app.Activity
4 | import android.os.Bundle
5 | import android.widget.Button
6 | import android.widget.TextView
7 |
8 | class WebviewActivity : Activity() {
9 | private val counterStore = CounterStore()
10 |
11 | override fun onCreate(savedInstanceState: Bundle?) {
12 | super.onCreate(savedInstanceState)
13 | setContentView(R.layout.activity_my)
14 |
15 | val counterTextView = findViewById(R.id.counterTextView) as TextView
16 | val counterButton = findViewById(R.id.counterButton) as Button
17 |
18 | counterButton.setOnClickListener { view ->
19 | counterStore.add(1)
20 | counterTextView.text = "Click Nr. " + counterStore.get()
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/webview/android/src/main/res/layout/activity_my.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/webview/android/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/android/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webview/android/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/android/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webview/android/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/android/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webview/android/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/android/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webview/android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Webview
3 |
4 |
--------------------------------------------------------------------------------
/webview/android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/webview/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | buildscript {
3 | ext.kotlin_version = '1.0.0-beta-2423'
4 | repositories {
5 | jcenter()
6 | mavenCentral()
7 | }
8 | dependencies {
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 | }
13 |
14 | task wrapper(type: Wrapper) {
15 | gradleVersion = '2.8'
16 | }
--------------------------------------------------------------------------------
/webview/core/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | }
5 | }
6 |
7 | plugins {
8 | id "me.tatarka.retrolambda" version "3.2.2"
9 | }
10 | apply plugin: 'java'
11 | apply plugin: 'kotlin'
12 |
13 | version 'unspecified'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | }
20 |
21 | sourceSets {
22 | main.java.srcDirs += 'src/main/kotlin'
23 | }
24 |
25 | dependencies {
26 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
27 | testCompile group: 'junit', name: 'junit', version: '4.11'
28 | }
29 |
--------------------------------------------------------------------------------
/webview/core/src/main/kotlin/com/prat/webview/CounterStore.kt:
--------------------------------------------------------------------------------
1 | package com.prat.webview
2 |
3 | class CounterStore {
4 | private var count: Int = 0
5 |
6 | fun add(num: Int) {
7 | count += num
8 | }
9 |
10 | fun get(): Int {
11 | return count
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/webview/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.jvmargs=-Xms128m -Xmx2000m
3 | org.gradle.configureondemand=true
--------------------------------------------------------------------------------
/webview/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/webview/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Nov 30 21:13:38 EST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip
7 |
--------------------------------------------------------------------------------
/webview/ios/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
5 | }
6 | dependencies {
7 | classpath 'org.robovm:robovm-gradle-plugin:1.11.0'
8 | }
9 | }
10 |
11 | apply plugin: 'java'
12 | apply plugin: 'robovm'
13 | apply plugin: 'kotlin'
14 | sourceCompatibility = 1.8
15 | targetCompatibility = 1.8
16 |
17 | repositories {
18 | mavenCentral()
19 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
20 | }
21 |
22 | sourceSets {
23 | main.java.srcDirs += 'src/main/kotlin'
24 | }
25 |
26 | ext {
27 | roboVMVersion = "1.11.0"
28 | }
29 |
30 | robovm {
31 | }
32 |
33 | dependencies {
34 | compile "org.robovm:robovm-rt:${roboVMVersion}"
35 | compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"
36 | compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
37 | testCompile "junit:junit:4.12"
38 | compile project(':core')
39 | }
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "filename" : "Default@2x~iphone.png",
9 | "scale" : "2x"
10 | },
11 | {
12 | "extent" : "full-screen",
13 | "idiom" : "iphone",
14 | "subtype" : "retina4",
15 | "filename" : "Default-568h@2x~iphone.png",
16 | "minimum-system-version" : "7.0",
17 | "orientation" : "portrait",
18 | "scale" : "2x"
19 | },
20 | {
21 | "orientation" : "portrait",
22 | "idiom" : "ipad",
23 | "extent" : "full-screen",
24 | "minimum-system-version" : "7.0",
25 | "filename" : "Default-Portrait~ipad.png",
26 | "scale" : "1x"
27 | },
28 | {
29 | "orientation" : "landscape",
30 | "idiom" : "ipad",
31 | "extent" : "full-screen",
32 | "minimum-system-version" : "7.0",
33 | "filename" : "Default-Landscape~ipad.png",
34 | "scale" : "1x"
35 | },
36 | {
37 | "orientation" : "portrait",
38 | "idiom" : "ipad",
39 | "extent" : "full-screen",
40 | "minimum-system-version" : "7.0",
41 | "filename" : "Default-Portrait@2x~ipad.png",
42 | "scale" : "2x"
43 | },
44 | {
45 | "orientation" : "landscape",
46 | "idiom" : "ipad",
47 | "extent" : "full-screen",
48 | "minimum-system-version" : "7.0",
49 | "filename" : "Default-Landscape@2x~ipad.png",
50 | "scale" : "2x"
51 | }
52 | ],
53 | "info" : {
54 | "version" : 1,
55 | "author" : "xcode"
56 | }
57 | }
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-667h@2x~iphone.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-736h@3x~iphone.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x~iphone.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png
--------------------------------------------------------------------------------
/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pt2121/kotlin-ios/2c9fa27ab96a158d1fff9b8c629263e408404f20/webview/ios/resources/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png
--------------------------------------------------------------------------------
/webview/ios/robovm.properties:
--------------------------------------------------------------------------------
1 | app.version=1.0
2 | app.id=com.prat.webview
3 | app.mainclass=com.prat.webview.Web
4 | app.executable=Webview
5 | app.build=1
6 | app.name=Webview
--------------------------------------------------------------------------------
/webview/ios/robovm.xml:
--------------------------------------------------------------------------------
1 |
2 | ${app.executable}
3 | ${app.mainclass}
4 | ios
5 | ios
6 | Info.plist.xml
7 |
8 |
9 | resources
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/webview/ios/src/main/kotlin/com/prat/webview/Web.kt:
--------------------------------------------------------------------------------
1 | package com.prat.webview
2 |
3 | import org.robovm.apple.foundation.NSAutoreleasePool
4 | import org.robovm.apple.uikit.UIApplication
5 | import org.robovm.apple.uikit.UIApplicationDelegateAdapter
6 | import org.robovm.apple.uikit.UIApplicationLaunchOptions
7 |
8 | class Web : UIApplicationDelegateAdapter() {
9 |
10 | override fun didFinishLaunching(application: UIApplication?, launchOptions: UIApplicationLaunchOptions?): Boolean {
11 | return true
12 | }
13 |
14 | companion object {
15 | @JvmStatic fun main(args: Array) {
16 | val pool = NSAutoreleasePool()
17 | UIApplication.main(args, null, Web::class.java)
18 | pool.release()
19 | }
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/webview/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':core', ':android', ':ios'
2 |
3 |
--------------------------------------------------------------------------------