├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── build.gradle ├── docs ├── Authenticating.md ├── Balance-info.md ├── Configuring-the-SDK.md ├── Gemfile ├── Linking-a-broker-with-OAuth.md ├── Orders-status.md ├── Portfolio-positions.md ├── README.md ├── Relinking.md ├── Special-Cases.md ├── Testing.md ├── Trading.md ├── Unlinking.md ├── _config.yml ├── _includes │ └── _Sidebar.html ├── _layouts │ └── default.html ├── css │ ├── documentation.css │ ├── documentation.css.map │ ├── main.css │ ├── main.css.map │ └── normalize.min.css ├── fonts │ ├── HelveticaNeue-Bold.eot │ ├── HelveticaNeue-Bold.ttf │ ├── HelveticaNeue-Bold.woff │ ├── HelveticaNeue-BoldItalic.eot │ ├── HelveticaNeue-BoldItalic.ttf │ ├── HelveticaNeue-BoldItalic.woff │ ├── HelveticaNeue-Italic.eot │ ├── HelveticaNeue-Italic.ttf │ ├── HelveticaNeue-Italic.woff │ ├── HelveticaNeue-Light.eot │ ├── HelveticaNeue-Light.ttf │ ├── HelveticaNeue-Light.woff │ ├── HelveticaNeue-LightItalic.eot │ ├── HelveticaNeue-LightItalic.ttf │ ├── HelveticaNeue-LightItalic.woff │ ├── HelveticaNeue-Medium.eot │ ├── HelveticaNeue-Medium.ttf │ ├── HelveticaNeue-Medium.woff │ ├── HelveticaNeue-UltraLight.eot │ ├── HelveticaNeue-UltraLight.ttf │ ├── HelveticaNeue-UltraLight.woff │ ├── HelveticaNeue-UltraLightItalic.eot │ ├── HelveticaNeue-UltraLightItalic.ttf │ ├── HelveticaNeue-UltraLightItalic.woff │ ├── HelveticaNeue.eot │ ├── HelveticaNeue.ttf │ ├── HelveticaNeue.woff │ ├── Monaco.eot │ ├── Monaco.ttf │ └── Monaco.woff ├── img │ ├── logo.svg │ └── navbar-icon.svg └── index.md ├── exampleApp ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── it │ │ └── trade │ │ └── android │ │ └── exampleapp │ │ └── MainActivityTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── it │ │ └── trade │ │ └── android │ │ └── exampleapp │ │ ├── BrokersListActivity.java │ │ ├── GetCryptoQuoteActivity.java │ │ ├── LinkedBrokerAccountsActivity.java │ │ ├── LinkedBrokersActivity.java │ │ ├── MainActivity.java │ │ ├── OauthLinkBrokerActivity.java │ │ ├── OrdersStatusActivity.java │ │ ├── ParceledAccountActivity.java │ │ ├── PositionsActivity.java │ │ ├── PreviewCryptoOrderActivity.java │ │ ├── PreviewOrderActivity.java │ │ ├── RequestInterceptorParcelableImpl.java │ │ ├── adapters │ │ └── BrokerAdapter.java │ │ └── customtabs │ │ ├── CustomTabActivityHelper.java │ │ ├── CustomTabsHelper.java │ │ ├── KeepAliveService.java │ │ ├── ServiceConnection.java │ │ └── ServiceConnectionCallback.java │ └── res │ ├── drawable │ └── row_border.xml │ ├── layout │ ├── activity_brokers_list.xml │ ├── activity_get_crypto_quote.xml │ ├── activity_linked_broker_accounts.xml │ ├── activity_linked_brokers.xml │ ├── activity_main.xml │ ├── activity_oauth_link_broker.xml │ ├── activity_orders_status.xml │ ├── activity_parceled_account.xml │ ├── activity_positions.xml │ └── activity_preview_order.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── exampleAppKotlin ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── kotlin │ │ └── it │ │ └── trade │ │ └── android │ │ └── exampleapp │ │ └── MainActivityTest.kt │ └── main │ ├── AndroidManifest.xml │ ├── kotlin │ └── it │ │ └── trade │ │ └── android │ │ └── exampleapp │ │ ├── BrokersListActivity.kt │ │ ├── GetCryptoQuoteActivity.kt │ │ ├── LinkedBrokerAccountsActivity.kt │ │ ├── LinkedBrokersActivity.kt │ │ ├── MainActivity.kt │ │ ├── OauthLinkBrokerActivity.kt │ │ ├── OrdersStatusActivity.kt │ │ ├── ParceledAccountActivity.kt │ │ ├── PositionsActivity.kt │ │ ├── PreviewCryptoOrderActivity.kt │ │ ├── PreviewOrderActivity.kt │ │ ├── RequestInterceptorParcelableImpl.kt │ │ ├── adapters │ │ └── BrokerAdapter.kt │ │ └── customtabs │ │ ├── CustomTabActivityHelper.kt │ │ ├── CustomTabsHelper.kt │ │ ├── KeepAliveService.kt │ │ ├── ServiceConnection.kt │ │ └── ServiceConnectionCallback.kt │ └── res │ ├── drawable │ └── row_border.xml │ ├── layout │ ├── activity_brokers_list.xml │ ├── activity_get_crypto_quote.xml │ ├── activity_linked_broker_accounts.xml │ ├── activity_linked_brokers.xml │ ├── activity_main.xml │ ├── activity_oauth_link_broker.xml │ ├── activity_orders_status.xml │ ├── activity_parceled_account.xml │ ├── activity_positions.xml │ └── activity_preview_order.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── tradeit-android-sdk ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src ├── androidTest └── kotlin │ └── it │ └── trade │ └── android │ └── sdk │ ├── UnitTestSuite.kt │ ├── manager │ └── TradeItLinkedBrokerManagerTest.kt │ └── model │ ├── TradeItCryptoOrderParcelableTest.kt │ ├── TradeItCryptoQuoteResponseParcelableTest.kt │ ├── TradeItErrorResultParcelableTest.kt │ ├── TradeItLinkedBrokerAccountParcelableTest.kt │ ├── TradeItLinkedBrokerParcelableTest.kt │ ├── TradeItOrderCapabilityParcelableTest.kt │ ├── TradeItOrderParcelableTest.kt │ ├── TradeItOrderStatusParcelableTest.kt │ ├── TradeItPlaceCryptoOrderResponseParcelableTest.kt │ ├── TradeItPlaceStockOrEtfOrderResponseParcelableTest.kt │ ├── TradeItPreviewCryptoOrderResponseParcelableTest.kt │ ├── TradeItPreviewStockOrEtfOrderResponseParcelableTest.kt │ └── TradeItSecurityQuestionParcelableTest.kt ├── main ├── AndroidManifest.xml ├── kotlin │ └── it │ │ └── trade │ │ └── android │ │ └── sdk │ │ ├── TradeItConfigurationBuilder.kt │ │ ├── TradeItSDK.kt │ │ ├── TradeItSdkInstance.kt │ │ ├── enums │ │ ├── TradeItOrderAction.kt │ │ ├── TradeItOrderExpirationType.kt │ │ ├── TradeItOrderPriceType.kt │ │ └── TradeItOrderQuantityType.kt │ │ ├── exceptions │ │ ├── TradeItDeleteLinkedLoginException.kt │ │ ├── TradeItKeystoreServiceCreateKeyException.kt │ │ ├── TradeItKeystoreServiceDecryptException.kt │ │ ├── TradeItKeystoreServiceDeleteKeyException.kt │ │ ├── TradeItKeystoreServiceEncryptException.kt │ │ ├── TradeItRetrieveLinkedLoginException.kt │ │ ├── TradeItSDKConfigurationException.kt │ │ ├── TradeItSaveLinkedLoginException.kt │ │ └── TradeItUpdateLinkedLoginException.kt │ │ ├── internal │ │ ├── LinkedBrokersParcelableList.kt │ │ └── TradeItKeystoreService.kt │ │ ├── manager │ │ └── TradeItLinkedBrokerManager.kt │ │ └── model │ │ ├── RequestInterceptorParcelable.kt │ │ ├── SymbolPairParcelable.kt │ │ ├── TradeItApiClientParcelable.kt │ │ ├── TradeItBalanceParcelable.kt │ │ ├── TradeItCallBackCompletion.kt │ │ ├── TradeItCallbackWithSecurityQuestionAndCompletion.kt │ │ ├── TradeItCryptoOrderParcelable.kt │ │ ├── TradeItCryptoPreviewOrderDetailsParcelable.kt │ │ ├── TradeItCryptoQuoteResponseParcelable.kt │ │ ├── TradeItCryptoTradeOrderDetailsParcelable.kt │ │ ├── TradeItErrorResultParcelable.kt │ │ ├── TradeItFxBalanceParcelable.kt │ │ ├── TradeItLinkedBrokerAccountData.kt │ │ ├── TradeItLinkedBrokerAccountParcelable.kt │ │ ├── TradeItLinkedBrokerCache.kt │ │ ├── TradeItLinkedBrokerData.kt │ │ ├── TradeItLinkedBrokerParcelable.kt │ │ ├── TradeItLinkedLoginParcelable.kt │ │ ├── TradeItOrderActionParcelable.kt │ │ ├── TradeItOrderCapabilityParcelable.kt │ │ ├── TradeItOrderDetailsParcelable.kt │ │ ├── TradeItOrderExpirationTypeParcelable.kt │ │ ├── TradeItOrderInfoParcelable.kt │ │ ├── TradeItOrderParcelable.kt │ │ ├── TradeItOrderPriceTypeParcelable.kt │ │ ├── TradeItPlaceCryptoOrderResponseParcelable.kt │ │ ├── TradeItPlaceStockOrEtfOrderResponseParcelable.kt │ │ ├── TradeItPositionParcelable.kt │ │ ├── TradeItPreviewCryptoOrderResponseParcelable.kt │ │ ├── TradeItPreviewStockOrEtfOrderResponseParcelable.kt │ │ ├── TradeItPriceParcelable.kt │ │ ├── TradeItSecurityQuestionParcelable.kt │ │ ├── TradeItWarningLinkParcelable.kt │ │ ├── TradeItWarningParcelable.kt │ │ └── orderstatus │ │ ├── TradeItFillParcelable.kt │ │ ├── TradeItOrderLegParcelable.kt │ │ ├── TradeItOrderStatusParcelable.kt │ │ └── TradeItPriceInfoParcelable.kt └── res │ └── values │ └── strings.xml └── test ├── kotlin └── it │ └── trade │ └── android │ └── sdk │ ├── manager │ └── TradeItLinkedBrokerManagerSpec.kt │ └── model │ ├── TradeItCryptoOrderParcelableSpec.kt │ ├── TradeItLinkedBrokerAccountParcelableSpec.kt │ ├── TradeItLinkedBrokerCacheSpec.kt │ ├── TradeItLinkedBrokerParcelableSpec.kt │ └── TradeItOrderParcelableSpec.kt └── resources └── mockito-extensions └── org.mockito.plugins.MockMaker /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .idea/ 10 | *.lock 11 | _site/ 12 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "docs/AndroidSDK.wiki"] 2 | path = docs/AndroidSDK.wiki 3 | url = https://github.com/tradingticket/AndroidSDK.wiki.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TradeIt Android SDK 2 | 3 | [Read the Wiki to get started!](https://github.com/tradingticket/AndroidSDK/wiki) 4 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.2.61' 5 | ext.anko_version = '0.10.5' 6 | repositories { 7 | jcenter() 8 | google() 9 | mavenCentral() 10 | } 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:3.2.0' 13 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' 14 | classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' 15 | classpath 'org.codehaus.groovy:groovy-android-gradle-plugin:1.1.0' 16 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 17 | classpath "de.mannodermaus.gradle.plugins:android-junit5:1.2.0.0" 18 | 19 | // NOTE: Do not place your application dependencies here; they belong 20 | // in the individual module build.gradle files 21 | } 22 | } 23 | 24 | allprojects { 25 | repositories { 26 | jcenter() 27 | mavenLocal() // to be able to use local snapshot 28 | google() 29 | } 30 | } 31 | 32 | task clean(type: Delete) { 33 | delete rootProject.buildDir 34 | } 35 | -------------------------------------------------------------------------------- /docs/Authenticating.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Authenticating 3 | layout: default 4 | --- 5 | 6 | {% include_relative AndroidSDK.wiki/Authenticating.md %} -------------------------------------------------------------------------------- /docs/Balance-info.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Balance info 3 | layout: default 4 | --- 5 | 6 | {% include_relative AndroidSDK.wiki/Balance-info.md %} -------------------------------------------------------------------------------- /docs/Configuring-the-SDK.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Configuring the SDK 3 | layout: default 4 | --- 5 | 6 | {% include_relative AndroidSDK.wiki/Configuring-the-SDK.md %} -------------------------------------------------------------------------------- /docs/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | # Hello! This is where you manage which Jekyll version is used to run. 4 | # When you want to use a different version, change it below, save the 5 | # file and run `bundle install`. Run Jekyll with `bundle exec`, like so: 6 | # 7 | # bundle exec jekyll serve 8 | # 9 | # This will help ensure the proper Jekyll version is running. 10 | # Happy Jekylling! 11 | gem "jekyll", "3.5.2" 12 | 13 | # This is the default theme for new Jekyll sites. You may change this to anything you like. 14 | gem "minima", "~> 2.0" 15 | 16 | # If you want to use GitHub Pages, remove the "gem "jekyll"" above and 17 | # uncomment the line below. To upgrade, run `bundle update github-pages`. 18 | # gem "github-pages", group: :jekyll_plugins 19 | 20 | # If you have any plugins, put them here! 21 | group :jekyll_plugins do 22 | gem "jekyll-feed", "~> 0.6" 23 | end 24 | 25 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 26 | gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 27 | 28 | -------------------------------------------------------------------------------- /docs/Linking-a-broker-with-OAuth.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Linking a broker with OAuth 3 | layout: default 4 | --- 5 | 6 | {% include_relative AndroidSDK.wiki/Linking-a-broker-with-OAuth.md %} -------------------------------------------------------------------------------- /docs/Orders-status.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Orders status 3 | layout: default 4 | --- 5 | 6 | {% include_relative AndroidSDK.wiki/Orders-status.md %} -------------------------------------------------------------------------------- /docs/Portfolio-positions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Portfolio positions 3 | layout: default 4 | --- 5 | 6 | {% include_relative AndroidSDK.wiki/Portfolio-positions.md %} -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | Use jekyll to generate the Android SDK documentation 2 | 3 | # Installation 4 | 5 | ``` 6 | gem install jekyll bundler 7 | ``` 8 | 9 | # Generate the documentation and test on local (should be executed on the docs directory) 10 | ``` 11 | bundle exec jekyll serve 12 | ``` 13 | 14 | Navigate to http://127.0.0.1:4000/home 15 | 16 | # Notice 17 | 18 | Files are generated into _site folder -------------------------------------------------------------------------------- /docs/Relinking.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Relinking 3 | layout: default 4 | --- 5 | 6 | {% include_relative AndroidSDK.wiki/Relinking.md %} -------------------------------------------------------------------------------- /docs/Special-Cases.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Special Cases 3 | layout: default 4 | --- 5 | 6 | {% include_relative AndroidSDK.wiki/Special-Cases.md %} -------------------------------------------------------------------------------- /docs/Testing.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Testing 3 | layout: default 4 | --- 5 | 6 | {% include_relative AndroidSDK.wiki/Testing.md %} 7 | -------------------------------------------------------------------------------- /docs/Trading.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Trading 3 | layout: default 4 | --- 5 | 6 | {% include_relative AndroidSDK.wiki/Trading.md %} -------------------------------------------------------------------------------- /docs/Unlinking.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Unlinking 3 | layout: default 4 | --- 5 | 6 | {% include_relative AndroidSDK.wiki/Unlinking.md %} -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | # Welcome to Jekyll! 2 | # 3 | # This config file is meant for settings that affect your whole blog, values 4 | # which you are expected to set up once and rarely edit after that. If you find 5 | # yourself editing this file very often, consider using Jekyll's data files 6 | # feature for the data you need to update frequently. 7 | # 8 | # For technical reasons, this file is *NOT* reloaded automatically when you use 9 | # 'bundle exec jekyll serve'. If you change this file, please restart the server process. 10 | 11 | # Site settings 12 | # These are used to personalize your new site. If you look in the HTML files, 13 | # you will see them accessed via {{ site.title }}, {{ site.email }}, and so on. 14 | # You can create any custom variable you would like, and they will be accessible 15 | # in the templates via {{ site.myvariable }}. 16 | title: Your awesome title 17 | email: your-email@example.com 18 | description: > # this means to ignore newlines until "baseurl:" 19 | Write an awesome description for your new site here. You can edit this 20 | line in _config.yml. It will appear in your document head meta (for 21 | Google search results) and in your feed.xml site description. 22 | baseurl: "" # the subpath of your site, e.g. /blog 23 | url: "" # the base hostname & protocol for your site, e.g. http://example.com 24 | twitter_username: jekyllrb 25 | github_username: jekyll 26 | 27 | # Build settings 28 | markdown: kramdown 29 | 30 | # Exclude from processing. 31 | # The following items will not be processed, by default. Create a custom list 32 | # to override the default setting. 33 | exclude: 34 | - Gemfile 35 | - Gemfile.lock 36 | - README.md 37 | - AndroidSDK.wiki 38 | - feed.xml # doesn't work, need investigation 39 | 40 | defaults: 41 | - 42 | scope: 43 | path: "" # an empty string here means all files in the project 44 | values: 45 | layout: "default" -------------------------------------------------------------------------------- /docs/_includes/_Sidebar.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | 8 | 11 | 14 | 17 | 20 | 23 | 26 | 29 | 32 | 35 | 38 |
39 | -------------------------------------------------------------------------------- /docs/css/normalize.min.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0} -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-Bold.eot -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-Bold.ttf -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-Bold.woff -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-BoldItalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-BoldItalic.eot -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-BoldItalic.ttf -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-BoldItalic.woff -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-Italic.eot -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-Italic.ttf -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-Italic.woff -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-Light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-Light.eot -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-Light.ttf -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-Light.woff -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-LightItalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-LightItalic.eot -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-LightItalic.ttf -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-LightItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-LightItalic.woff -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-Medium.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-Medium.eot -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-Medium.ttf -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-Medium.woff -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-UltraLight.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-UltraLight.eot -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-UltraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-UltraLight.ttf -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-UltraLight.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-UltraLight.woff -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-UltraLightItalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-UltraLightItalic.eot -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-UltraLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-UltraLightItalic.ttf -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue-UltraLightItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue-UltraLightItalic.woff -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue.eot -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue.ttf -------------------------------------------------------------------------------- /docs/fonts/HelveticaNeue.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/HelveticaNeue.woff -------------------------------------------------------------------------------- /docs/fonts/Monaco.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/Monaco.eot -------------------------------------------------------------------------------- /docs/fonts/Monaco.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/Monaco.ttf -------------------------------------------------------------------------------- /docs/fonts/Monaco.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tradingticket/AndroidSDK/1d784e9eba023479652ccc5963ea7a77624bde01/docs/fonts/Monaco.woff -------------------------------------------------------------------------------- /docs/img/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/img/navbar-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | navbar-icon 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction 3 | layout: default 4 | --- 5 | 6 | {% include_relative AndroidSDK.wiki/Introduction.md %} -------------------------------------------------------------------------------- /exampleApp/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /exampleApp/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | 5 | android { 6 | compileSdkVersion 27 7 | 8 | lintOptions { 9 | disable 'InvalidPackage' 10 | } 11 | 12 | defaultConfig { 13 | applicationId "it.trade.android.exampleapp" 14 | minSdkVersion 19 15 | targetSdkVersion 27 16 | versionCode 1 17 | versionName "1.0" 18 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 19 | multiDexEnabled true 20 | } 21 | buildTypes { 22 | release { 23 | minifyEnabled true 24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 25 | } 26 | } 27 | } 28 | 29 | dependencies { 30 | implementation fileTree(dir: 'libs', include: ['*.jar']) 31 | implementation 'com.android.support:multidex:1.0.3' 32 | implementation 'com.android.support:customtabs:27.1.1' 33 | implementation 'com.android.support:appcompat-v7:27.1.1' 34 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 35 | implementation project(':tradeit-android-sdk') 36 | androidTestImplementation 'com.android.support:support-annotations:27.1.1' 37 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 38 | androidTestImplementation 'com.android.support.test.espresso:espresso-web:3.0.2' 39 | androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3' 40 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 41 | androidTestImplementation 'com.android.support.test:rules:1.0.2' 42 | } 43 | repositories { 44 | mavenCentral() 45 | } 46 | -------------------------------------------------------------------------------- /exampleApp/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 /Users/guillaumedebavelaere/Library/Android/sdk/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 | -------------------------------------------------------------------------------- /exampleApp/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 40 | 43 | 46 | 49 | 52 | 55 | 58 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /exampleApp/src/main/java/it/trade/android/exampleapp/GetCryptoQuoteActivity.java: -------------------------------------------------------------------------------- 1 | package it.trade.android.exampleapp; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.text.method.ScrollingMovementMethod; 7 | import android.widget.TextView; 8 | 9 | import it.trade.android.sdk.model.TradeItCryptoQuoteResponseParcelable; 10 | 11 | import static it.trade.android.exampleapp.MainActivity.GET_CRYPTO_QUOTE_PARAMETER; 12 | 13 | public class GetCryptoQuoteActivity extends AppCompatActivity { 14 | 15 | private TextView textView; 16 | 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_get_crypto_quote); 21 | 22 | textView = (TextView) this.findViewById(R.id.get_crypto_quote_textview); 23 | textView.setMovementMethod(new ScrollingMovementMethod()); 24 | Intent intent = getIntent(); 25 | TradeItCryptoQuoteResponseParcelable cryptoQuoteResponseParcelable = intent 26 | .getParcelableExtra(GET_CRYPTO_QUOTE_PARAMETER); 27 | textView.setText(cryptoQuoteResponseParcelable.toString()); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /exampleApp/src/main/java/it/trade/android/exampleapp/LinkedBrokerAccountsActivity.java: -------------------------------------------------------------------------------- 1 | package it.trade.android.exampleapp; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.util.Log; 7 | import android.widget.TextView; 8 | 9 | import java.util.List; 10 | 11 | import it.trade.android.sdk.model.TradeItLinkedBrokerAccountParcelable; 12 | import it.trade.model.TradeItErrorResult; 13 | import it.trade.model.callback.TradeItCallback; 14 | 15 | import static it.trade.android.exampleapp.MainActivity.LINKED_BROKER_ACCOUNTS_PARAMETER; 16 | 17 | public class LinkedBrokerAccountsActivity extends AppCompatActivity { 18 | TextView textView; 19 | List linkedBrokerAccounts; 20 | 21 | @Override 22 | protected void onCreate(Bundle savedInstanceState) { 23 | super.onCreate(savedInstanceState); 24 | setContentView(R.layout.activity_linked_broker_accounts); 25 | this.textView = (TextView) this.findViewById(R.id.linked_broker_accounts_textview); 26 | 27 | Intent intent = getIntent(); 28 | this.linkedBrokerAccounts = intent.getParcelableArrayListExtra(LINKED_BROKER_ACCOUNTS_PARAMETER); 29 | 30 | if (linkedBrokerAccounts.isEmpty()) { 31 | this.textView.setText("No linked broker accounts!"); 32 | } else { 33 | // Refresh balance on the first account just to make sure that an unparcelled account works properly 34 | textView.setText("Refreshing first account balance again just to test..."); 35 | linkedBrokerAccounts.get(0).refreshBalance(new TradeItCallback() { 36 | @Override 37 | public void onSuccess(TradeItLinkedBrokerAccountParcelable linkedBrokerAccountParcelable) { 38 | textView.setText("Refreshed first account balance again just to test.\n# of linkedBroker accounts: " + linkedBrokerAccounts.size() + "\n\n" + linkedBrokerAccounts.toString()); 39 | } 40 | 41 | @Override 42 | public void onError(TradeItErrorResult error) { 43 | textView.setText("Refresh Balance ERROR:\n" + error); 44 | } 45 | }); 46 | } 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /exampleApp/src/main/java/it/trade/android/exampleapp/LinkedBrokersActivity.java: -------------------------------------------------------------------------------- 1 | package it.trade.android.exampleapp; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.text.method.ScrollingMovementMethod; 7 | import android.util.Log; 8 | import android.view.View; 9 | import android.widget.TextView; 10 | 11 | import com.google.gson.Gson; 12 | 13 | import java.util.List; 14 | 15 | import it.trade.android.sdk.model.TradeItLinkedBrokerAccountParcelable; 16 | import it.trade.android.sdk.model.TradeItLinkedBrokerParcelable; 17 | import it.trade.model.TradeItErrorResult; 18 | import it.trade.model.TradeItSecurityQuestion; 19 | import it.trade.model.callback.TradeItCallbackWithSecurityQuestionImpl; 20 | 21 | import static it.trade.android.exampleapp.MainActivity.LINKED_BROKERS_PARAMETER; 22 | 23 | public class LinkedBrokersActivity extends AppCompatActivity { 24 | List linkedBrokers; 25 | TextView textView; 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | setContentView(R.layout.activity_linked_brokers); 31 | this.textView = (TextView) this.findViewById(R.id.linked_brokers_textview); 32 | this.textView.setMovementMethod(new ScrollingMovementMethod()); 33 | 34 | Intent intent = getIntent(); 35 | this.linkedBrokers = intent.getParcelableArrayListExtra(LINKED_BROKERS_PARAMETER); 36 | 37 | logBrokers(); 38 | } 39 | 40 | public void authenticateFirstBroker(View view) { 41 | textView.setText("Authenticating..."); 42 | 43 | this.linkedBrokers.get(0).authenticate(new TradeItCallbackWithSecurityQuestionImpl>() { 44 | @Override 45 | public void onSecurityQuestion(TradeItSecurityQuestion securityQuestion) { 46 | textView.setText("Security Question:\n" + securityQuestion); 47 | } 48 | 49 | @Override 50 | public void onSuccess(List type) { 51 | textView.setText("Authenticate SUCCESS!"); 52 | } 53 | 54 | @Override 55 | public void onError(TradeItErrorResult error) { 56 | textView.setText("Authenticate ERROR:\n" + error); 57 | } 58 | }); 59 | } 60 | 61 | private void logBrokers() { 62 | if (this.linkedBrokers.isEmpty()) { 63 | this.textView.setText("No linked brokers!"); 64 | } else { 65 | String output = ""; 66 | 67 | output += "=== " + this.linkedBrokers.size() + " PARCELED LINKED BROKERS ===\n\n"; 68 | 69 | for (TradeItLinkedBrokerParcelable linkedBroker : this.linkedBrokers) { 70 | String json = "LINKED BROKER: " + linkedBroker; 71 | output += json + "\n\n===\n\n"; 72 | Log.d("TEST", json); 73 | } 74 | 75 | this.textView.setText(output); 76 | Log.d("TEST", "=========="); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /exampleApp/src/main/java/it/trade/android/exampleapp/OrdersStatusActivity.java: -------------------------------------------------------------------------------- 1 | package it.trade.android.exampleapp; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.text.method.ScrollingMovementMethod; 7 | import android.widget.TextView; 8 | 9 | import java.util.List; 10 | 11 | import it.trade.android.sdk.model.orderstatus.TradeItOrderStatusParcelable; 12 | 13 | import static it.trade.android.exampleapp.MainActivity.ORDERS_STATUS_PARAMETER; 14 | 15 | public class OrdersStatusActivity extends AppCompatActivity { 16 | 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_orders_status); 21 | TextView textView = (TextView) this.findViewById(R.id.orders_status_textview); 22 | textView.setMovementMethod(new ScrollingMovementMethod()); 23 | Intent intent = getIntent(); 24 | List ordersStatusDetailsList = intent.getParcelableArrayListExtra(ORDERS_STATUS_PARAMETER); 25 | textView.setText(ordersStatusDetailsList.toString()); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /exampleApp/src/main/java/it/trade/android/exampleapp/PositionsActivity.java: -------------------------------------------------------------------------------- 1 | package it.trade.android.exampleapp; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.text.method.ScrollingMovementMethod; 7 | import android.widget.TextView; 8 | 9 | import java.util.List; 10 | 11 | import it.trade.android.sdk.model.TradeItPositionParcelable; 12 | 13 | import static it.trade.android.exampleapp.MainActivity.POSITIONS_PARAMETER; 14 | 15 | 16 | public class PositionsActivity extends AppCompatActivity { 17 | 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_positions); 22 | TextView textView = (TextView) this.findViewById(R.id.positions_textview); 23 | textView.setMovementMethod(new ScrollingMovementMethod()); 24 | Intent intent = getIntent(); 25 | List positions = intent.getParcelableArrayListExtra(POSITIONS_PARAMETER); 26 | textView.setText(positions.toString()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /exampleApp/src/main/java/it/trade/android/exampleapp/RequestInterceptorParcelableImpl.java: -------------------------------------------------------------------------------- 1 | package it.trade.android.exampleapp; 2 | 3 | import android.os.Parcel; 4 | 5 | import java.io.IOException; 6 | 7 | import it.trade.android.sdk.model.RequestInterceptorParcelable; 8 | import okhttp3.Request; 9 | import okhttp3.Response; 10 | 11 | public class RequestInterceptorParcelableImpl extends RequestInterceptorParcelable { 12 | @Override 13 | public Response intercept(Chain chain) throws IOException { 14 | Request originalRequest = chain.request(); 15 | Request transformedRequest = originalRequest.newBuilder() 16 | .header("HeaderTestName", "HeaderTestValue") 17 | .header("HeaderTestName2", "HeaderTestValue2") 18 | .header("Cookie", "test1=value1; test2=value2") 19 | .method(originalRequest.method(), originalRequest.body()) 20 | .build(); 21 | return chain.proceed(transformedRequest); 22 | } 23 | 24 | 25 | @Override 26 | public int describeContents() { 27 | return 0; 28 | } 29 | 30 | @Override 31 | public void writeToParcel(Parcel dest, int flags) { 32 | } 33 | 34 | public RequestInterceptorParcelableImpl() { 35 | } 36 | 37 | protected RequestInterceptorParcelableImpl(Parcel in) { 38 | } 39 | 40 | public static final Creator CREATOR = new Creator() { 41 | @Override 42 | public RequestInterceptorParcelableImpl createFromParcel(Parcel source) { 43 | return new RequestInterceptorParcelableImpl(source); 44 | } 45 | 46 | @Override 47 | public RequestInterceptorParcelableImpl[] newArray(int size) { 48 | return new RequestInterceptorParcelableImpl[size]; 49 | } 50 | }; 51 | } 52 | -------------------------------------------------------------------------------- /exampleApp/src/main/java/it/trade/android/exampleapp/adapters/BrokerAdapter.java: -------------------------------------------------------------------------------- 1 | package it.trade.android.exampleapp.adapters; 2 | 3 | import android.content.Context; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.ArrayAdapter; 8 | import android.widget.TextView; 9 | 10 | import java.util.List; 11 | 12 | import it.trade.model.reponse.TradeItAvailableBrokersResponse.Broker; 13 | 14 | public class BrokerAdapter extends ArrayAdapter { 15 | 16 | public BrokerAdapter(Context context, List items) { 17 | super(context, android.R.layout.simple_spinner_item, items); 18 | } 19 | 20 | public View getView(int position, View convertView, ViewGroup parent) { 21 | // Get the data item for this position 22 | Broker broker = getItem(position); 23 | // Check if an existing view is being reused, otherwise inflate the view 24 | if (convertView == null) { 25 | convertView = LayoutInflater.from(getContext()).inflate(android.R.layout.simple_spinner_item, parent, false); 26 | } 27 | // Lookup view for data population 28 | TextView textView = (TextView) convertView; 29 | 30 | // Populate the data into the template view using the data object 31 | textView.setText(broker.longName); 32 | 33 | // Return the completed view to render on screen 34 | return convertView; 35 | } 36 | 37 | @Override 38 | public View getDropDownView(int position, View convertView, ViewGroup parent) { 39 | Broker broker = getItem(position); 40 | 41 | if(convertView == null){ 42 | convertView = LayoutInflater.from(getContext()).inflate(android.R.layout.simple_spinner_dropdown_item,parent, false); 43 | } 44 | 45 | TextView textView = (TextView) convertView; 46 | textView.setText(broker.longName); 47 | 48 | return convertView; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /exampleApp/src/main/java/it/trade/android/exampleapp/customtabs/KeepAliveService.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package it.trade.android.exampleapp.customtabs; 16 | 17 | import android.app.Service; 18 | import android.content.Intent; 19 | import android.os.Binder; 20 | import android.os.IBinder; 21 | 22 | /** 23 | * Empty service used by the custom tab to bind to, raising the application's importance. 24 | */ 25 | public class KeepAliveService extends Service { 26 | private static final Binder sBinder = new Binder(); 27 | 28 | @Override 29 | public IBinder onBind(Intent intent) { 30 | return sBinder; 31 | } 32 | } -------------------------------------------------------------------------------- /exampleApp/src/main/java/it/trade/android/exampleapp/customtabs/ServiceConnection.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package it.trade.android.exampleapp.customtabs; 16 | 17 | import android.content.ComponentName; 18 | import android.support.customtabs.CustomTabsClient; 19 | import android.support.customtabs.CustomTabsServiceConnection; 20 | 21 | import java.lang.ref.WeakReference; 22 | 23 | /** 24 | * Implementation for the CustomTabsServiceConnection that avoids leaking the 25 | * ServiceConnectionCallback 26 | */ 27 | public class ServiceConnection extends CustomTabsServiceConnection { 28 | // A weak reference to the ServiceConnectionCallback to avoid leaking it. 29 | private WeakReference mConnectionCallback; 30 | 31 | public ServiceConnection(ServiceConnectionCallback connectionCallback) { 32 | mConnectionCallback = new WeakReference<>(connectionCallback); 33 | } 34 | 35 | @Override 36 | public void onCustomTabsServiceConnected(ComponentName name, CustomTabsClient client) { 37 | ServiceConnectionCallback connectionCallback = mConnectionCallback.get(); 38 | if (connectionCallback != null) connectionCallback.onServiceConnected(client); 39 | } 40 | 41 | @Override 42 | public void onServiceDisconnected(ComponentName name) { 43 | ServiceConnectionCallback connectionCallback = mConnectionCallback.get(); 44 | if (connectionCallback != null) connectionCallback.onServiceDisconnected(); 45 | } 46 | } -------------------------------------------------------------------------------- /exampleApp/src/main/java/it/trade/android/exampleapp/customtabs/ServiceConnectionCallback.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package it.trade.android.exampleapp.customtabs; 16 | 17 | import android.support.customtabs.CustomTabsClient; 18 | 19 | /** 20 | * Callback for events when connecting and disconnecting from Custom Tabs Service. 21 | */ 22 | public interface ServiceConnectionCallback { 23 | /** 24 | * Called when the service is connected. 25 | * @param client a CustomTabsClient 26 | */ 27 | void onServiceConnected(CustomTabsClient client); 28 | 29 | /** 30 | * Called when the service is disconnected. 31 | */ 32 | void onServiceDisconnected(); 33 | } -------------------------------------------------------------------------------- /exampleApp/src/main/res/drawable/row_border.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /exampleApp/src/main/res/layout/activity_brokers_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 17 | 18 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /exampleApp/src/main/res/layout/activity_get_crypto_quote.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 24 | 25 | -------------------------------------------------------------------------------- /exampleApp/src/main/res/layout/activity_linked_broker_accounts.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 24 | 25 | -------------------------------------------------------------------------------- /exampleApp/src/main/res/layout/activity_linked_brokers.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 27 | 28 |