Skip to content
Permalink
Browse files
Migrate to Kotlin
  • Loading branch information
TonnyL committed May 25, 2018
1 parent d25b65a commit 45476a3ce62190e65cedceea4d4ae188f6b87e84
Showing with 9,042 additions and 10,713 deletions.
  1. +21 鈭8 .travis.yml
  2. +36 鈭30 app/build.gradle
  3. +1,171 鈭0 app/schemas/com.marktony.zhihudaily.database.AppDatabase/1.json
  4. +0 鈭29 app/src/androidTest/java/com/marktony/zhihudaily/ApplicationTest.java
  5. +19 鈭0 app/src/androidTest/java/com/marktony/zhihudaily/UtilInstrumentedTest.kt
  6. +3 鈭3 app/src/main/java/com/marktony/zhihudaily/{BasePresenter.java 鈫 BasePresenter.kt}
  7. +3 鈭7 app/src/main/java/com/marktony/zhihudaily/{BaseView.java 鈫 BaseView.kt}
  8. +10 鈭13 app/src/main/java/com/marktony/zhihudaily/{PaperPlaneApp.java 鈫 PaperPlaneApp.kt}
  9. +0 鈭58 app/src/main/java/com/marktony/zhihudaily/customtabs/CustomTabsHelper.java
  10. +59 鈭0 app/src/main/java/com/marktony/zhihudaily/customtabs/CustomTabsHelper.kt
  11. +2 鈭2 app/src/main/java/com/marktony/zhihudaily/data/{ContentType.java 鈫 ContentType.kt}
  12. +0 鈭302 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentContent.java
  13. +144 鈭0 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentContent.kt
  14. +0 鈭93 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNews.java
  15. +56 鈭0 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNews.kt
  16. +0 鈭177 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNewsAuthor.java
  17. +92 鈭0 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNewsAuthor.kt
  18. +0 鈭74 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNewsLarge.java
  19. +51 鈭0 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNewsLarge.kt
  20. +0 鈭74 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNewsMedium.java
  21. +51 鈭0 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNewsMedium.kt
  22. +0 鈭320 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNewsPosts.java
  23. +143 鈭0 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNewsPosts.kt
  24. +0 鈭74 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNewsSmall.java
  25. +51 鈭0 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNewsSmall.kt
  26. +0 鈭113 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNewsThumbs.java
  27. +67 鈭0 app/src/main/java/com/marktony/zhihudaily/data/DoubanMomentNewsThumbs.kt
  28. +0 鈭70 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickContent.java
  29. +51 鈭0 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickContent.kt
  30. +0 鈭96 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickContentChannel.java
  31. +61 鈭0 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickContentChannel.kt
  32. +0 鈭70 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickContentImageInfo.java
  33. +51 鈭0 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickContentImageInfo.kt
  34. +0 鈭109 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickContentMinisite.java
  35. +66 鈭0 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickContentMinisite.kt
  36. +0 鈭433 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickContentResult.java
  37. +191 鈭0 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickContentResult.kt
  38. +0 鈭105 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickNews.java
  39. +60 鈭0 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickNews.kt
  40. +0 鈭192 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickNewsAuthor.java
  41. +97 鈭0 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickNewsAuthor.kt
  42. +0 鈭72 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickNewsAvatar.java
  43. +51 鈭0 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickNewsAvatar.kt
  44. +0 鈭458 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickNewsResult.java
  45. +199 鈭0 app/src/main/java/com/marktony/zhihudaily/data/GuokrHandpickNewsResult.kt
  46. +0 鈭40 app/src/main/java/com/marktony/zhihudaily/data/PostType.java
  47. +31 鈭0 app/src/main/java/com/marktony/zhihudaily/data/PostType.kt
  48. +0 鈭186 app/src/main/java/com/marktony/zhihudaily/data/ZhihuDailyContent.java
  49. +91 鈭0 app/src/main/java/com/marktony/zhihudaily/data/ZhihuDailyContent.kt
  50. +0 鈭57 app/src/main/java/com/marktony/zhihudaily/data/ZhihuDailyNews.java
  51. +44 鈭0 app/src/main/java/com/marktony/zhihudaily/data/ZhihuDailyNews.kt
  52. +0 鈭129 app/src/main/java/com/marktony/zhihudaily/data/ZhihuDailyNewsQuestion.java
  53. +76 鈭0 app/src/main/java/com/marktony/zhihudaily/data/ZhihuDailyNewsQuestion.kt
  54. +8 鈭10 ...ly/data/source/datasource/{DoubanMomentContentDataSource.java 鈫 DoubanMomentContentDataSource.kt}
  55. +0 鈭59 app/src/main/java/com/marktony/zhihudaily/data/source/datasource/DoubanMomentNewsDataSource.java
  56. +55 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/datasource/DoubanMomentNewsDataSource.kt
  57. +8 鈭10 .../data/source/datasource/{GuokrHandpickContentDataSource.java 鈫 GuokrHandpickContentDataSource.kt}
  58. +0 鈭59 app/src/main/java/com/marktony/zhihudaily/data/source/datasource/GuokrHandpickDataSource.java
  59. +55 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/datasource/GuokrHandpickDataSource.kt
  60. +8 鈭10 ...udaily/data/source/datasource/{ZhihuDailyContentDataSource.java 鈫 ZhihuDailyContentDataSource.kt}
  61. +0 鈭59 app/src/main/java/com/marktony/zhihudaily/data/source/datasource/ZhihuDailyNewsDataSource.java
  62. +55 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/datasource/ZhihuDailyNewsDataSource.kt
  63. +0 鈭98 app/src/main/java/com/marktony/zhihudaily/data/source/local/DoubanMomentContentLocalDataSource.java
  64. +80 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/local/DoubanMomentContentLocalDataSource.kt
  65. +0 鈭175 app/src/main/java/com/marktony/zhihudaily/data/source/local/DoubanMomentNewsLocalDataSource.java
  66. +126 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/local/DoubanMomentNewsLocalDataSource.kt
  67. +0 鈭102 app/src/main/java/com/marktony/zhihudaily/data/source/local/GuokrHandpickContentLocalDataSource.java
  68. +84 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/local/GuokrHandpickContentLocalDataSource.kt
  69. +0 鈭177 app/src/main/java/com/marktony/zhihudaily/data/source/local/GuokrHandpickNewsLocalDataSource.java
  70. +123 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/local/GuokrHandpickNewsLocalDataSource.kt
  71. +0 鈭104 app/src/main/java/com/marktony/zhihudaily/data/source/local/ZhihuDailyContentLocalDataSource.java
  72. +78 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/local/ZhihuDailyContentLocalDataSource.kt
  73. +0 鈭179 app/src/main/java/com/marktony/zhihudaily/data/source/local/ZhihuDailyNewsLocalDataSource.java
  74. +128 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/local/ZhihuDailyNewsLocalDataSource.kt
  75. +0 鈭82 ...src/main/java/com/marktony/zhihudaily/data/source/remote/DoubanMomentContentRemoteDataSource.java
  76. +75 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/remote/DoubanMomentContentRemoteDataSource.kt
  77. +0 鈭104 app/src/main/java/com/marktony/zhihudaily/data/source/remote/DoubanMomentNewsRemoteDataSource.java
  78. +91 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/remote/DoubanMomentNewsRemoteDataSource.kt
  79. +0 鈭87 ...rc/main/java/com/marktony/zhihudaily/data/source/remote/GuokrHandpickContentRemoteDataSource.java
  80. +81 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/remote/GuokrHandpickContentRemoteDataSource.kt
  81. +0 鈭103 app/src/main/java/com/marktony/zhihudaily/data/source/remote/GuokrHandpickNewsRemoteDataSource.java
  82. +91 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/remote/GuokrHandpickNewsRemoteDataSource.kt
  83. +0 鈭81 app/src/main/java/com/marktony/zhihudaily/data/source/remote/ZhihuDailyContentRemoteDataSource.java
  84. +74 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/remote/ZhihuDailyContentRemoteDataSource.kt
  85. +0 鈭119 app/src/main/java/com/marktony/zhihudaily/data/source/remote/ZhihuDailyNewsRemoteDataSource.java
  86. +107 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/remote/ZhihuDailyNewsRemoteDataSource.kt
  87. +0 鈭111 app/src/main/java/com/marktony/zhihudaily/data/source/repository/DoubanMomentContentRepository.java
  88. +95 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/repository/DoubanMomentContentRepository.kt
  89. +0 鈭209 app/src/main/java/com/marktony/zhihudaily/data/source/repository/DoubanMomentNewsRepository.java
  90. +166 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/repository/DoubanMomentNewsRepository.kt
  91. +0 鈭110 app/src/main/java/com/marktony/zhihudaily/data/source/repository/GuokrHandpickContentRepository.java
  92. +93 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/repository/GuokrHandpickContentRepository.kt
  93. +0 鈭208 app/src/main/java/com/marktony/zhihudaily/data/source/repository/GuokrHandpickNewsRepository.java
  94. +165 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/repository/GuokrHandpickNewsRepository.kt
  95. +0 鈭110 app/src/main/java/com/marktony/zhihudaily/data/source/repository/ZhihuDailyContentRepository.java
  96. +94 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/repository/ZhihuDailyContentRepository.kt
  97. +0 鈭208 app/src/main/java/com/marktony/zhihudaily/data/source/repository/ZhihuDailyNewsRepository.java
  98. +167 鈭0 app/src/main/java/com/marktony/zhihudaily/data/source/repository/ZhihuDailyNewsRepository.kt
  99. +0 鈭66 app/src/main/java/com/marktony/zhihudaily/database/AppDatabase.java
  100. +74 鈭0 app/src/main/java/com/marktony/zhihudaily/database/AppDatabase.kt
  101. +0 鈭97 app/src/main/java/com/marktony/zhihudaily/database/DatabaseCreator.java
  102. +0 鈭49 app/src/main/java/com/marktony/zhihudaily/database/converter/DoubanTypeConverters.java
  103. +49 鈭0 app/src/main/java/com/marktony/zhihudaily/database/converter/DoubanTypeConverters.kt
  104. +0 鈭61 app/src/main/java/com/marktony/zhihudaily/database/converter/GuokrContentTypeConverters.java
  105. +61 鈭0 app/src/main/java/com/marktony/zhihudaily/database/converter/GuokrContentTypeConverters.kt
  106. +0 鈭73 app/src/main/java/com/marktony/zhihudaily/database/converter/GuokrResultTypeConverter.java
  107. +75 鈭0 app/src/main/java/com/marktony/zhihudaily/database/converter/GuokrResultTypeConverter.kt
  108. +0 鈭47 app/src/main/java/com/marktony/zhihudaily/database/converter/StringTypeConverter.java
  109. +47 鈭0 app/src/main/java/com/marktony/zhihudaily/database/converter/StringTypeConverter.kt
  110. +9 鈭15 ...va/com/marktony/zhihudaily/database/dao/{DoubanMomentContentDao.java 鈫 DoubanMomentContentDao.kt}
  111. +12 鈭20 ...ain/java/com/marktony/zhihudaily/database/dao/{DoubanMomentNewsDao.java 鈫 DoubanMomentNewsDao.kt}
  112. +9 鈭15 .../com/marktony/zhihudaily/database/dao/{GuokrHandpickContentDao.java 鈫 GuokrHandpickContentDao.kt}
  113. +12 鈭20 ...n/java/com/marktony/zhihudaily/database/dao/{GuokrHandpickNewsDao.java 鈫 GuokrHandpickNewsDao.kt}
  114. +9 鈭15 ...n/java/com/marktony/zhihudaily/database/dao/{ZhihuDailyContentDao.java 鈫 ZhihuDailyContentDao.kt}
  115. +12 鈭20 ...rc/main/java/com/marktony/zhihudaily/database/dao/{ZhihuDailyNewsDao.java 鈫 ZhihuDailyNewsDao.kt}
  116. +0 鈭114 app/src/main/java/com/marktony/zhihudaily/details/DetailsActivity.java
  117. +93 鈭0 app/src/main/java/com/marktony/zhihudaily/details/DetailsActivity.kt
  118. +0 鈭75 app/src/main/java/com/marktony/zhihudaily/details/DetailsContract.java
  119. +66 鈭0 app/src/main/java/com/marktony/zhihudaily/details/DetailsContract.kt
  120. +0 鈭408 app/src/main/java/com/marktony/zhihudaily/details/DetailsFragment.java
  121. +328 鈭0 app/src/main/java/com/marktony/zhihudaily/details/DetailsFragment.kt
  122. +0 鈭250 app/src/main/java/com/marktony/zhihudaily/details/DetailsPresenter.java
  123. +211 鈭0 app/src/main/java/com/marktony/zhihudaily/details/DetailsPresenter.kt
  124. +0 鈭431 app/src/main/java/com/marktony/zhihudaily/favorites/FavoritesAdapter.java
  125. +292 鈭0 app/src/main/java/com/marktony/zhihudaily/favorites/FavoritesAdapter.kt
  126. +0 鈭53 app/src/main/java/com/marktony/zhihudaily/favorites/FavoritesContract.java
  127. +51 鈭0 app/src/main/java/com/marktony/zhihudaily/favorites/FavoritesContract.kt
  128. +0 鈭161 app/src/main/java/com/marktony/zhihudaily/favorites/FavoritesFragment.java
  129. +142 鈭0 app/src/main/java/com/marktony/zhihudaily/favorites/FavoritesFragment.kt
  130. +0 鈭109 app/src/main/java/com/marktony/zhihudaily/favorites/FavoritesPresenter.java
  131. +83 鈭0 app/src/main/java/com/marktony/zhihudaily/favorites/FavoritesPresenter.kt
  132. +30 鈭0 app/src/main/java/com/marktony/zhihudaily/glide/ImageViewExtensions.kt
  133. +62 鈭0 app/src/main/java/com/marktony/zhihudaily/glide/PaperPlaneAppGlideModule.kt
  134. +5 鈭5 ...hudaily/interfaze/{OnRecyclerViewItemOnClickListener.java 鈫 OnRecyclerViewItemOnClickListener.kt}
  135. +0 鈭75 app/src/main/java/com/marktony/zhihudaily/retrofit/RetrofitService.java
  136. +73 鈭0 app/src/main/java/com/marktony/zhihudaily/retrofit/RetrofitService.kt
  137. +0 鈭329 app/src/main/java/com/marktony/zhihudaily/service/CacheService.java
  138. +259 鈭0 app/src/main/java/com/marktony/zhihudaily/service/CacheService.kt
  139. +11 鈭15 .../main/java/com/marktony/zhihudaily/timeline/{DoubanMomentContract.java 鈫 DoubanMomentContract.kt}
  140. +0 鈭223 app/src/main/java/com/marktony/zhihudaily/timeline/DoubanMomentFragment.java
  141. +194 鈭0 app/src/main/java/com/marktony/zhihudaily/timeline/DoubanMomentFragment.kt
  142. +0 鈭165 app/src/main/java/com/marktony/zhihudaily/timeline/DoubanMomentNewsAdapter.java
  143. +107 鈭0 app/src/main/java/com/marktony/zhihudaily/timeline/DoubanMomentNewsAdapter.kt
  144. +0 鈭75 app/src/main/java/com/marktony/zhihudaily/timeline/DoubanMomentPresenter.java
  145. +61 鈭0 app/src/main/java/com/marktony/zhihudaily/timeline/DoubanMomentPresenter.kt
  146. +11 鈭15 ...ain/java/com/marktony/zhihudaily/timeline/{GuokrHandpickContract.java 鈫 GuokrHandpickContract.kt}
  147. +0 鈭178 app/src/main/java/com/marktony/zhihudaily/timeline/GuokrHandpickFragment.java
  148. +146 鈭0 app/src/main/java/com/marktony/zhihudaily/timeline/GuokrHandpickFragment.kt
  149. +0 鈭121 app/src/main/java/com/marktony/zhihudaily/timeline/GuokrHandpickNewsAdapter.java
  150. +77 鈭0 app/src/main/java/com/marktony/zhihudaily/timeline/GuokrHandpickNewsAdapter.kt
  151. +0 鈭74 app/src/main/java/com/marktony/zhihudaily/timeline/GuokrHandpickPresenter.java
  152. +61 鈭0 app/src/main/java/com/marktony/zhihudaily/timeline/GuokrHandpickPresenter.kt
  153. +0 鈭161 app/src/main/java/com/marktony/zhihudaily/timeline/TimelineFragment.java
  154. +117 鈭0 app/src/main/java/com/marktony/zhihudaily/timeline/TimelineFragment.kt
  155. +0 鈭78 app/src/main/java/com/marktony/zhihudaily/timeline/TimelineFragmentPagerAdapter.java
  156. +57 鈭0 app/src/main/java/com/marktony/zhihudaily/timeline/TimelineFragmentPagerAdapter.kt
  157. +11 鈭15 app/src/main/java/com/marktony/zhihudaily/timeline/{ZhihuDailyContract.java 鈫 ZhihuDailyContract.kt}
  158. +0 鈭229 app/src/main/java/com/marktony/zhihudaily/timeline/ZhihuDailyFragment.java
  159. +198 鈭0 app/src/main/java/com/marktony/zhihudaily/timeline/ZhihuDailyFragment.kt
  160. +0 鈭122 app/src/main/java/com/marktony/zhihudaily/timeline/ZhihuDailyNewsAdapter.java
  161. +78 鈭0 app/src/main/java/com/marktony/zhihudaily/timeline/ZhihuDailyNewsAdapter.kt
  162. +0 鈭75 app/src/main/java/com/marktony/zhihudaily/timeline/ZhihuDailyPresenter.java
  163. +61 鈭0 app/src/main/java/com/marktony/zhihudaily/timeline/ZhihuDailyPresenter.kt
  164. +0 鈭55 app/src/main/java/com/marktony/zhihudaily/ui/InfoFragment.java
  165. +53 鈭0 app/src/main/java/com/marktony/zhihudaily/ui/InfoFragment.kt
  166. +0 鈭176 app/src/main/java/com/marktony/zhihudaily/ui/InfoPreferenceFragment.java
  167. +169 鈭0 app/src/main/java/com/marktony/zhihudaily/ui/InfoPreferenceFragment.kt
  168. +0 鈭58 app/src/main/java/com/marktony/zhihudaily/ui/LicenseActivity.java
  169. +51 鈭0 app/src/main/java/com/marktony/zhihudaily/ui/LicenseActivity.kt
  170. +0 鈭202 app/src/main/java/com/marktony/zhihudaily/ui/MainActivity.java
  171. +161 鈭0 app/src/main/java/com/marktony/zhihudaily/ui/MainActivity.kt
  172. +0 鈭83 app/src/main/java/com/marktony/zhihudaily/util/DateFormatUtil.java
  173. +79 鈭0 app/src/main/java/com/marktony/zhihudaily/util/DateFormatUtil.kt
  174. +0 鈭36 app/src/main/java/com/marktony/zhihudaily/util/InfoConstants.java
  175. +28 鈭0 app/src/main/java/com/marktony/zhihudaily/util/InfoConstants.kt
  176. +13 鈭15 app/src/main/res/layout/fragment_details.xml
  177. +22 鈭24 app/src/main/res/layout/fragment_timeline_page.xml
  178. +19 鈭17 app/src/main/res/layout/item_universal_layout.xml
  179. +9 鈭11 app/src/main/res/layout/item_universal_without_image.xml
  180. +9 鈭7 app/src/test/java/com/marktony/zhihudaily/{ExampleUnitTest.java 鈫 ExampleUnitTest.kt}
  181. +19 鈭6 build.gradle
  182. +1 鈭1 gradle/wrapper/gradle-wrapper.properties
@@ -4,33 +4,46 @@ sudo: false

env:
global:
- ANDROID_API_LEVEL=26
- ANDROID_BUILD_TOOLS_VERSION=26.0.0
- ANDROID_API_LEVEL=27
- ANDROID_BUILD_TOOLS_VERSION=27.0.3
- ANDROID_TAG=google_apis

android:
components:
- tools
- platform-tools # latest
- tools # to install the latest android sdk tools

- platform-tools
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- extra
- android-$ANDROID_API_LEVEL
- extra-google-m2repository
- extra-android-m2repository

licenses:
- android-sdk-license-.+
- '.+'

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
#Cache all dirs under .gradle folder
directories:
# Cache daemon logs
- $HOME/.gradle/daemon
# Cache library downloaded from the gradle dependency
- $HOME/.gradle/native
# Cache the gradle
- $HOME/.gradle/wrapper

before_install:
- chmod +x gradlew
- mkdir "$ANDROID_HOME/licenses" || true
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
# A solution to avoid failure when using android 27, build-tools-27.0.2
- yes | sdkmanager "platforms;android-27"

notifications:
email: false

script:
- ./gradlew assembleRelease
- ./gradlew assembleRelease
@@ -1,17 +1,20 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {

compileSdkVersion 26
buildToolsVersion '26.0.0'
compileSdkVersion 27

defaultConfig {
applicationId "com.marktony.zhihudaily"
minSdkVersion 21
targetSdkVersion 26
versionCode 19
targetSdkVersion 27
versionCode 20
versionName "V3.3.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
@@ -34,42 +37,45 @@ android {
lintOptions {
abortOnError false
}

kapt {
correctErrorTypes = true
}
}

ext {
supportLibVersion = '26.0.0-beta2'
gsonVersion = '2.8.0'
datetimePickerVersion = '3.1.3'
glideVersion = '3.7.0'
archRoomVersion = '1.0.0-alpha3'
retrofitVersion = '2.2.0'
androidExtensions {
experimental = true
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}"

// Support series
compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile "com.android.support:design:${supportLibVersion}"
compile "com.android.support:preference-v14:${supportLibVersion}"
compile "com.android.support:customtabs:${supportLibVersion}"
implementation "com.android.support:appcompat-v7:${versions.support_library}"
implementation "com.android.support:design:${versions.support_library}"
implementation "com.android.support:preference-v14:${versions.support_library}"
implementation "com.android.support:customtabs:${versions.support_library}"

// Room
compile "android.arch.persistence.room:runtime:${archRoomVersion}"
annotationProcessor "android.arch.persistence.room:compiler:${archRoomVersion}"
implementation "android.arch.persistence.room:runtime:${versions.arch_room}"
kapt "android.arch.persistence.room:compiler:${versions.arch_room}"

// Retrofit series
compile "com.squareup.retrofit2:retrofit:${retrofitVersion}"
compile "com.squareup.retrofit2:converter-gson:${retrofitVersion}"
implementation "com.squareup.retrofit2:retrofit:${versions.retrofit}"
implementation "com.squareup.retrofit2:converter-gson:${versions.retrofit}"
implementation "com.squareup.okhttp3:logging-interceptor:${versions.okhttp_logging_interceptor}"

// Glide
compile "com.github.bumptech.glide:glide:${glideVersion}"
implementation "com.github.bumptech.glide:glide:${versions.glide}"
kapt "com.github.bumptech.glide:compiler:${versions.glide}"
implementation "com.github.bumptech.glide:okhttp3-integration:${versions.glide}"

// Material date time picker
compile ("com.wdullaer:materialdatetimepicker:${datetimePickerVersion}") {
implementation("com.wdullaer:materialdatetimepicker:${versions.date_time_picker}") {
exclude group: 'com.android.support'
}

// Junit
testCompile 'junit:junit:4.12'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.coroutines}"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.coroutines}"

testImplementation "junit:junit:${versions.junit}"
androidTestImplementation "com.android.support.test:runner:${versions.test_runner}"
androidTestImplementation "com.android.support.test.espresso:espresso-core:${versions.espresso_core}"
}

0 comments on commit 45476a3

Please sign in to comment.