├── README.md ├── _config.yml ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── mock.json │ ├── java │ └── com │ │ └── q4tech │ │ └── essen │ │ └── ci │ │ ├── domain │ │ ├── model │ │ │ └── CIRecipeModel.kt │ │ └── usecase │ │ │ └── CIHomeUseCase.kt │ │ ├── mvp │ │ ├── module │ │ │ ├── CIApplicationModule.kt │ │ │ └── CIHomeModule.kt │ │ ├── presenter │ │ │ ├── activity │ │ │ │ └── CIHomePresenter.kt │ │ │ └── fragment │ │ │ │ ├── CIHomeBookmarksPresenter.kt │ │ │ │ ├── CIHomeProfilePresenter.kt │ │ │ │ ├── CIHomeRecipeListPresenter.kt │ │ │ │ └── CIHomeRecipeSearchPresenter.kt │ │ └── view │ │ │ ├── CIApplication.kt │ │ │ ├── activity │ │ │ └── CIHomeActivity.kt │ │ │ └── fragment │ │ │ ├── CIHomeBookmarksFragment.kt │ │ │ ├── CIHomeProfileFragment.kt │ │ │ ├── CIHomeRecipeListFragment.kt │ │ │ └── CIHomeRecipeSearchFragment.kt │ │ ├── repository │ │ ├── CIRecipeCloudDataSource.kt │ │ ├── CIRecipeDataSourceFactory.kt │ │ ├── CIRecipeMockDataSource.kt │ │ └── CIRecipeRepository.kt │ │ └── utils │ │ ├── AssetUtils.java │ │ └── helpers │ │ └── BottomNavigationViewHelper.java │ └── res │ ├── layout │ ├── activity_cihome.xml │ ├── fragment_cihome_bookmarks.xml │ ├── fragment_cihome_profile.xml │ ├── fragment_cihome_recipelist.xml │ └── fragment_cihome_recipesearch.xml │ ├── menu │ └── menu_cihome.xml │ ├── mipmap-hdpi │ ├── ic_home_black_24dp.png │ ├── ic_launcher.png │ ├── ic_notifications_black_24dp.png │ ├── ic_person_black_24dp.png │ ├── ic_person_outline_black_24dp.png │ ├── ic_search_black_24dp.png │ └── ic_star_border_black_24dp.png │ ├── mipmap-mdpi │ ├── ic_home_black_24dp.png │ ├── ic_launcher.png │ ├── ic_notifications_black_24dp.png │ ├── ic_person_black_24dp.png │ ├── ic_person_outline_black_24dp.png │ ├── ic_search_black_24dp.png │ └── ic_star_border_black_24dp.png │ ├── mipmap-xhdpi │ ├── ic_home_black_24dp.png │ ├── ic_launcher.png │ ├── ic_notifications_black_24dp.png │ ├── ic_person_black_24dp.png │ ├── ic_person_outline_black_24dp.png │ ├── ic_search_black_24dp.png │ └── ic_star_border_black_24dp.png │ ├── mipmap-xxhdpi │ ├── ic_home_black_24dp.png │ ├── ic_launcher.png │ ├── ic_notifications_black_24dp.png │ ├── ic_person_black_24dp.png │ ├── ic_person_outline_black_24dp.png │ ├── ic_search_black_24dp.png │ └── ic_star_border_black_24dp.png │ ├── mipmap-xxxhdpi │ ├── ic_home_black_24dp.png │ ├── ic_launcher.png │ ├── ic_notifications_black_24dp.png │ ├── ic_person_black_24dp.png │ ├── ic_person_outline_black_24dp.png │ ├── ic_search_black_24dp.png │ └── ic_star_border_black_24dp.png │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── local.properties └── settings.gradle /README.md: -------------------------------------------------------------------------------- 1 | ![Maven Central](https://avatars1.githubusercontent.com/u/14217797?v=3&u=f7438004056c53d618a481884aec5f21d4b622b3&s=50) 2 | > www.agustingandara.com 3 | 4 | Introduction 5 | ------------ 6 | This is a **SIMPLE MVP-CLEAN KOTLIN** sample of **Rosie** Implementation Architecture! 7 | 8 | This sample includes Application + Activity + Fragment + UseCase + Repository 9 | 10 | MVP Clean 11 | ------------ 12 | Rosie is an Android framework to create applications following the principles of [Clean Architecture][clean]. 13 | Rosie divides your application in three layers, **view**, **domain** and **repository**. 14 | 15 | * **View**: It contains all your presentation logic, implemented through the [Model-View-Presenter pattern][mvp]. Rosie provides classes to represent the main components of this layer like ``RosieActivity``, ``RosieFragment`` or ``RosiePresenter``. 16 | * **Domain**: Holding all your business logic, its main component is ``RosieUseCase`` that gives you an easy way to define your application use cases and execute them in a background thread using the [command pattern][com]. 17 | * **Repository**: This layer gives you an abstraction of how to retrieve and store data in your application following the [Repository pattern][rep]. ``RosieRepository`` and the multiple ``DataSource`` classes gives you the base to start building your own repositories. 18 | 19 | Dependencies 20 | ------------ 21 | * **Android**: Support + AppCompat + Design 22 | * **Connection**: Retrofit + OkHttp 23 | * **Gson**: Json Reflection + RetrofitConverter 24 | * **Image**: Glide + Loader + Downloader 25 | * **Dialogs**: Material Dialogs 26 | * **RxJava**: Reactive + AndroidExtras 27 | * **RxBluetooth**: ReactiveBLE 28 | * **Architecture**: Rosie 29 | * **Syntax**: KotlinLang 30 | * **Injetion**: DaggerDependencies + KotlinCompat 31 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | apply plugin: 'kotlin-kapt' 5 | apply plugin: 'realm-android' 6 | apply plugin: 'me.tatarka.retrolambda' 7 | 8 | android { 9 | compileSdkVersion 25 10 | buildToolsVersion "25.0.2" 11 | defaultConfig { 12 | applicationId "com.q4tech.essen.ci" 13 | minSdkVersion 18 14 | targetSdkVersion 25 15 | versionCode 1 16 | versionName "1.0" 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | compileOptions { 25 | targetCompatibility 1.8 26 | sourceCompatibility 1.8 27 | } 28 | packagingOptions { 29 | exclude 'META-INF/LICENSE.txt' 30 | exclude 'META-INF/NOTICE.txt' 31 | exclude 'META-INF/rxjava.properties' 32 | } 33 | } 34 | 35 | kapt { 36 | generateStubs = true 37 | } 38 | 39 | dependencies { 40 | //google support 41 | compile 'com.android.support:appcompat-v7:25.3.1' 42 | compile 'com.android.support:design:25.0.0' 43 | compile 'com.android.support:support-v4:25.3.1' 44 | //connection 45 | compile 'com.squareup.retrofit2:retrofit:2.0.2' 46 | compile 'com.squareup.okhttp3:okhttp:3.2.0' 47 | compile 'com.squareup.okio:okio:1.7.0' 48 | //image 49 | compile 'com.github.bumptech.glide:glide:3.7.0' 50 | //json 51 | compile 'com.google.code.gson:gson:2.6.2' 52 | compile 'com.squareup.retrofit2:converter-gson:2.0.1' 53 | //dialogs 54 | compile 'com.afollestad.material-dialogs:core:0.9.4.4' 55 | compile 'com.afollestad.material-dialogs:commons:0.9.4.4' 56 | //bluetooth 57 | compile 'com.polidea.rxandroidble:rxandroidble:1.2.2' 58 | //rxjava 59 | compile 'io.reactivex.rxjava2:rxandroid:2.0.1' 60 | compile 'io.reactivex.rxjava2:rxjava:2.0.9' 61 | //architecture 62 | compile 'com.karumi.rosie:rosie:3.0.0' 63 | //syntax 64 | compile 'org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-3' 65 | //injection 66 | provided 'com.squareup.dagger:dagger-compiler:1.2.2' 67 | kapt 'com.squareup.dagger:dagger-compiler:1.2.2' 68 | } 69 | 70 | configurations.all { 71 | resolutionStrategy.force 'com.android.support:support-annotations:23.4.0' 72 | } 73 | -------------------------------------------------------------------------------- /app/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/agustingandara/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 | -keepclassmembers class android.support.design.internal.BottomNavigationMenuView { 19 | boolean mShiftingMode; 20 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/assets/mock.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id":1, 4 | "title":"Tarta de berenjenas y tomates", 5 | "description":"Colocar aquí la descripción de la tarta de berenjenas y tomates.", 6 | "prepTime":"45 a 60'", 7 | "imageId":"receta1", 8 | "resources":[ 9 | "2024", 10 | "2224" 11 | ], 12 | "servings":{ 13 | "options":[ 14 | 6 15 | ], 16 | "default":6 17 | }, 18 | "categories":{ 19 | "tipoComida":"Almuerzo" 20 | }, 21 | "preparations":{ 22 | "p1":{ 23 | "name":"Masa", 24 | "steps":{ 25 | "p1s010":{ 26 | "type":"standard", 27 | "task":"En un bowl colocamos la harina, la sal, el huevo, el aceite y el agua. Mezclamos hasta formar una masa tierna. Dejamos descansar en la heladera mientras preparamos el relleno.", 28 | "imageId":"prepmasatarta", 29 | "dependencies":[ 30 | 31 | ], 32 | "servings":{ 33 | 34 | } 35 | }, 36 | "p1s020":{ 37 | "type":"checkElement", 38 | "task":"Colocamos la sarten sobre la Cocinita Essen.", 39 | "imageId":"item2024", 40 | "dependencies":[ 41 | "p1s010", 42 | "p2s060", 43 | "p3s010" 44 | ], 45 | "servings":{ 46 | "6":{ 47 | "timer":0, 48 | "resource":"2024", 49 | "device":[ 50 | { 51 | "timer":0, 52 | "weight":50, 53 | "temp":0, 54 | "power":0, 55 | "flags":[ 56 | 57 | ] 58 | } 59 | ] 60 | } 61 | } 62 | }, 63 | "p1s025":{ 64 | "type":"standard", 65 | "task":"Estiramos la masa y la colocamos en la sarten enharinada.", 66 | "imageId":"sartenmasatarta", 67 | "dependencies":[ 68 | "p1s020" 69 | ], 70 | "servings":{ 71 | 72 | } 73 | }, 74 | "p1s030":{ 75 | "type":"standard", 76 | "task":"Volcamos el relleno sobre la masa y por encima derramamos el ligue en forma pareja.", 77 | "imageId":"rellenomasatarta", 78 | "dependencies":[ 79 | "p1s025" 80 | ], 81 | "servings":{ 82 | 83 | } 84 | }, 85 | "p1s040":{ 86 | "type":"check", 87 | "task":"Tapamos la sarten.", 88 | "imageId":"tapamasatarta", 89 | "dependencies":[ 90 | "p1s030" 91 | ], 92 | "servings":{ 93 | "6":{ 94 | "timer":0, 95 | "resource":"2024", 96 | "device":[ 97 | { 98 | "timer":0, 99 | "weight":20, 100 | "temp":0, 101 | "power":0, 102 | "flags":[ 103 | 104 | ] 105 | } 106 | ] 107 | } 108 | } 109 | }, 110 | "p1s050":{ 111 | "type":"cook", 112 | "task":"Iniciamos la cocción.", 113 | "imageId":"startcooking", 114 | "dependencies":[ 115 | "p1s040" 116 | ], 117 | "servings":{ 118 | "6":{ 119 | "timer":35, 120 | "resource":"2024", 121 | "device":[ 122 | { 123 | "timer":35, 124 | "weight":0, 125 | "temp":0, 126 | "power":1000, 127 | "flags":[ 128 | "flash", 129 | "beep" 130 | ] 131 | } 132 | ] 133 | } 134 | } 135 | }, 136 | "p1s060":{ 137 | "type":"standard", 138 | "task":"Desmoldamos y servimos.", 139 | "imageId":"fintarta", 140 | "dependencies":[ 141 | "p1s050" 142 | ], 143 | "servings":{ 144 | 145 | } 146 | } 147 | }, 148 | "ingredients":[ 149 | { 150 | "item":"Harina leudante", 151 | "qty":{ 152 | "6":"250 gr." 153 | } 154 | }, 155 | { 156 | "item":"Huevo", 157 | "qty":{ 158 | "6":"1 un." 159 | } 160 | }, 161 | { 162 | "item":"Sal", 163 | "qty":{ 164 | "6":"1 pizca" 165 | } 166 | }, 167 | { 168 | "item":"Agua", 169 | "qty":{ 170 | "6":"4 cdas." 171 | } 172 | }, 173 | { 174 | "item":"Aceite de oliva", 175 | "qty":{ 176 | "6":"4 cdas." 177 | } 178 | } 179 | ] 180 | }, 181 | "p2":{ 182 | "name":"Relleno", 183 | "steps":{ 184 | "p2s010":{ 185 | "type":"checkElement", 186 | "task":"Colocamos la sartén sobre la Cocinita Essen.", 187 | "imageId":"item2224", 188 | "dependencies":[ 189 | "p1s010" 190 | ], 191 | "servings":{ 192 | "6":{ 193 | "timer":0, 194 | "resource":"2224", 195 | "device":[ 196 | { 197 | "timer":0, 198 | "weight":50, 199 | "temp":0, 200 | "power":0, 201 | "flags":[ 202 | 203 | ] 204 | } 205 | ] 206 | } 207 | } 208 | }, 209 | "p2s020":{ 210 | "type":"cook", 211 | "task":"Agregamos el aceite e iniciamos la cocción.", 212 | "imageId":"iniciorelleno", 213 | "dependencies":[ 214 | "p2s010" 215 | ], 216 | "servings":{ 217 | "6":{ 218 | "timer":2, 219 | "resource":"2224", 220 | "device":[ 221 | { 222 | "timer":2, 223 | "weight":0, 224 | "temp":0, 225 | "power":1500, 226 | "flags":[ 227 | "flash", 228 | "beep" 229 | ] 230 | } 231 | ] 232 | } 233 | } 234 | }, 235 | "p2s030":{ 236 | "type":"cook", 237 | "task":"Agregamos las berenjenas y continuamos la cocción.", 238 | "imageId":"berenjenasrelleno", 239 | "dependencies":[ 240 | "p2s020" 241 | ], 242 | "servings":{ 243 | "6":{ 244 | "timer":7, 245 | "resource":"2224", 246 | "device":[ 247 | { 248 | "timer":7, 249 | "weight":0, 250 | "temp":0, 251 | "power":1500, 252 | "flags":[ 253 | "flash", 254 | "beep" 255 | ] 256 | } 257 | ] 258 | } 259 | } 260 | }, 261 | "p2s040":{ 262 | "type":"cook", 263 | "task":"Agregamos los tomates cherry, la sal y el oregano y continuamos la cocción.", 264 | "imageId":"tomatesrelleno", 265 | "dependencies":[ 266 | "p2s030" 267 | ], 268 | "servings":{ 269 | "6":{ 270 | "timer":6, 271 | "resource":"2224", 272 | "device":[ 273 | { 274 | "timer":6, 275 | "weight":0, 276 | "temp":0, 277 | "power":1500, 278 | "flags":[ 279 | "flash", 280 | "beep" 281 | ] 282 | } 283 | ] 284 | } 285 | } 286 | }, 287 | "p2s050":{ 288 | "type":"check", 289 | "task":"Retiramos la sartén de la cocina.", 290 | "imageId":"retirarelleno", 291 | "dependencies":[ 292 | "p2s040" 293 | ], 294 | "servings":{ 295 | "0":{ 296 | "timer":0, 297 | "resource":"2224", 298 | "device":[ 299 | { 300 | "timer":0, 301 | "weight":-200, 302 | "temp":0, 303 | "power":0, 304 | "flags":[ 305 | 306 | ] 307 | } 308 | ] 309 | } 310 | } 311 | }, 312 | "p2s060":{ 313 | "type":"standard", 314 | "task":"Agregamos el queso mozzarella y reservamos.", 315 | "imageId":"finrelleno", 316 | "dependencies":[ 317 | "p2s050" 318 | ], 319 | "servings":{ 320 | 321 | } 322 | } 323 | }, 324 | "ingredients":[ 325 | { 326 | "item":"Berenjenas", 327 | "qty":{ 328 | "6":"500 gr." 329 | } 330 | }, 331 | { 332 | "item":"Tomates cherry", 333 | "qty":{ 334 | "6":"300 gr." 335 | } 336 | }, 337 | { 338 | "item":"Queso mozzarella", 339 | "qty":{ 340 | "6":"150 gr." 341 | } 342 | }, 343 | { 344 | "item":"Aceite de oliva extra virgen", 345 | "qty":{ 346 | "6":"2 cdas." 347 | } 348 | }, 349 | { 350 | "item":"Sal", 351 | "qty":{ 352 | "6":"1 pizca" 353 | } 354 | }, 355 | { 356 | "item":"Oregano", 357 | "qty":{ 358 | "6":"A gusto" 359 | } 360 | } 361 | ] 362 | }, 363 | "p3":{ 364 | "name":"Ligue", 365 | "steps":{ 366 | "p3s010":{ 367 | "type":"standard", 368 | "task":"En un bowl colocamos los huevos, el queso crema, la crema de leche, la leche, la sal y pimienta. Mezclamos.", 369 | "imageId":"liguetarta", 370 | "dependencies":[ 371 | 372 | ], 373 | "servings":{ 374 | 375 | } 376 | } 377 | }, 378 | "ingredients":[ 379 | { 380 | "item":"Huevo", 381 | "qty":{ 382 | "6":"3 un." 383 | } 384 | }, 385 | { 386 | "item":"Queso crema", 387 | "qty":{ 388 | "6":"3 cdas." 389 | } 390 | }, 391 | { 392 | "item":"Crema de leche", 393 | "qty":{ 394 | "6":"100 cc." 395 | } 396 | }, 397 | { 398 | "item":"Leche", 399 | "qty":{ 400 | "6":"50 cc." 401 | } 402 | }, 403 | { 404 | "item":"Sal", 405 | "qty":{ 406 | "6":"A gusto" 407 | } 408 | }, 409 | { 410 | "item":"Pimienta", 411 | "qty":{ 412 | "6":"A gusto" 413 | } 414 | } 415 | ] 416 | } 417 | } 418 | } 419 | ] -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/domain/model/CIRecipeModel.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.domain.model 2 | 3 | import com.karumi.rosie.repository.datasource.Identifiable 4 | 5 | /** 6 | * Created by agustingandara on 5/11/17. 7 | */ 8 | 9 | class CIRecipeModel : Identifiable { 10 | 11 | var id: String? = null 12 | var title: String? = null 13 | var description: String? = null 14 | var prepTime: String? = null 15 | var imageId: String? = null 16 | 17 | override fun getKey(): String? { 18 | return this.id 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/domain/usecase/CIHomeUseCase.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.domain.usecase 2 | 3 | import com.karumi.rosie.domain.usecase.RosieUseCase 4 | import com.karumi.rosie.domain.usecase.annotation.UseCase 5 | import com.q4tech.essen.ci.domain.model.CIRecipeModel 6 | import com.q4tech.essen.ci.repository.CIRecipeMockDataSource 7 | import com.q4tech.essen.ci.repository.CIRecipeRepository 8 | import javax.inject.Inject 9 | 10 | /** 11 | * Created by agustingandara on 5/10/17. 12 | */ 13 | 14 | class CIHomeUseCase @Inject constructor(private var recipeRepository: CIRecipeRepository) : RosieUseCase() { 15 | 16 | @UseCase(name = USE_CASE_SAMPLE) fun call(parameter: String){ 17 | var recipe: CIRecipeModel? = recipeRepository.getByKey("1") 18 | notifySuccess(recipe?.title) 19 | } 20 | 21 | companion object { 22 | const val USE_CASE_SAMPLE = "UseCaseSample" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/mvp/module/CIApplicationModule.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.mvp.module 2 | 3 | import com.q4tech.essen.ci.mvp.view.CIApplication 4 | import dagger.Module 5 | 6 | /** 7 | * Created by agustingandara on 5/10/17. 8 | */ 9 | 10 | @Module(library = true, complete = false, injects = arrayOf(CIApplication::class)) class CIApplicationModule 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/mvp/module/CIHomeModule.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.mvp.module 2 | 3 | import com.q4tech.essen.ci.mvp.view.activity.CIHomeActivity 4 | import com.q4tech.essen.ci.mvp.view.fragment.CIHomeBookmarksFragment 5 | import com.q4tech.essen.ci.mvp.view.fragment.CIHomeProfileFragment 6 | import com.q4tech.essen.ci.mvp.view.fragment.CIHomeRecipeListFragment 7 | import com.q4tech.essen.ci.mvp.view.fragment.CIHomeRecipeSearchFragment 8 | import dagger.* 9 | 10 | /** 11 | * Created by agustingandara on 5/10/17. 12 | */ 13 | 14 | @Module(library = true, complete = false, injects = arrayOf(CIHomeActivity::class, CIHomeRecipeListFragment::class, CIHomeRecipeSearchFragment::class, CIHomeBookmarksFragment::class, CIHomeProfileFragment::class)) class CIHomeModule 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/mvp/presenter/activity/CIHomePresenter.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.mvp.presenter.activity 2 | 3 | import com.karumi.rosie.domain.usecase.UseCaseHandler 4 | import com.karumi.rosie.domain.usecase.annotation.Success 5 | import com.karumi.rosie.domain.usecase.callback.OnSuccessCallback 6 | import com.karumi.rosie.view.RosiePresenter 7 | import com.q4tech.essen.ci.domain.usecase.CIHomeUseCase 8 | import javax.inject.Inject 9 | 10 | /** 11 | * Created by agustingandara on 5/10/17. 12 | */ 13 | 14 | class CIHomePresenter @Inject constructor(useCaseHandler: UseCaseHandler, private var homeUseCase: CIHomeUseCase) : RosiePresenter(useCaseHandler) { 15 | 16 | override fun initialize() { 17 | super.initialize() 18 | } 19 | 20 | override fun update() { 21 | super.update() 22 | } 23 | 24 | override fun pause() { 25 | super.pause() 26 | } 27 | 28 | override fun destroy() { 29 | super.destroy() 30 | } 31 | 32 | fun callUseCaseSample() { 33 | 34 | createUseCaseCall(homeUseCase) 35 | .useCaseName(CIHomeUseCase.USE_CASE_SAMPLE).args("SOMETHING") 36 | .onSuccess(object : OnSuccessCallback { @Success fun onSuccess(response: String) { 37 | 38 | }}).execute() 39 | } 40 | 41 | interface View : RosiePresenter.View 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/mvp/presenter/fragment/CIHomeBookmarksPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.mvp.presenter.activity 2 | 3 | import com.karumi.rosie.domain.usecase.UseCaseHandler 4 | import com.karumi.rosie.domain.usecase.annotation.Success 5 | import com.karumi.rosie.domain.usecase.callback.OnSuccessCallback 6 | import com.karumi.rosie.view.RosiePresenter 7 | import com.q4tech.essen.ci.domain.usecase.CIHomeUseCase 8 | import javax.inject.Inject 9 | 10 | /** 11 | * Created by agustingandara on 5/10/17. 12 | */ 13 | 14 | class CIHomeBookmarksPresenter @Inject constructor(useCaseHandler: UseCaseHandler, private var homeUseCase: CIHomeUseCase) : RosiePresenter(useCaseHandler) { 15 | 16 | override fun initialize() { 17 | super.initialize() 18 | } 19 | 20 | override fun update() { 21 | super.update() 22 | } 23 | 24 | override fun pause() { 25 | super.pause() 26 | } 27 | 28 | override fun destroy() { 29 | super.destroy() 30 | } 31 | 32 | interface View : RosiePresenter.View 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/mvp/presenter/fragment/CIHomeProfilePresenter.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.mvp.presenter.activity 2 | 3 | import com.karumi.rosie.domain.usecase.UseCaseHandler 4 | import com.karumi.rosie.domain.usecase.annotation.Success 5 | import com.karumi.rosie.domain.usecase.callback.OnSuccessCallback 6 | import com.karumi.rosie.view.RosiePresenter 7 | import com.q4tech.essen.ci.domain.usecase.CIHomeUseCase 8 | import javax.inject.Inject 9 | 10 | /** 11 | * Created by agustingandara on 5/10/17. 12 | */ 13 | 14 | class CIHomeProfilePresenter @Inject constructor(useCaseHandler: UseCaseHandler, private var homeUseCase: CIHomeUseCase) : RosiePresenter(useCaseHandler) { 15 | 16 | override fun initialize() { 17 | super.initialize() 18 | } 19 | 20 | override fun update() { 21 | super.update() 22 | } 23 | 24 | override fun pause() { 25 | super.pause() 26 | } 27 | 28 | override fun destroy() { 29 | super.destroy() 30 | } 31 | 32 | interface View : RosiePresenter.View 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/mvp/presenter/fragment/CIHomeRecipeListPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.mvp.presenter.activity 2 | 3 | import com.karumi.rosie.domain.usecase.UseCaseHandler 4 | import com.karumi.rosie.domain.usecase.annotation.Success 5 | import com.karumi.rosie.domain.usecase.callback.OnSuccessCallback 6 | import com.karumi.rosie.view.RosiePresenter 7 | import com.q4tech.essen.ci.domain.usecase.CIHomeUseCase 8 | import javax.inject.Inject 9 | 10 | /** 11 | * Created by agustingandara on 5/10/17. 12 | */ 13 | 14 | class CIHomeRecipeListPresenter @Inject constructor(useCaseHandler: UseCaseHandler, private var homeUseCase: CIHomeUseCase) : RosiePresenter(useCaseHandler) { 15 | 16 | override fun initialize() { 17 | super.initialize() 18 | } 19 | 20 | override fun update() { 21 | super.update() 22 | } 23 | 24 | override fun pause() { 25 | super.pause() 26 | } 27 | 28 | override fun destroy() { 29 | super.destroy() 30 | } 31 | 32 | interface View : RosiePresenter.View 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/mvp/presenter/fragment/CIHomeRecipeSearchPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.mvp.presenter.activity 2 | 3 | import com.karumi.rosie.domain.usecase.UseCaseHandler 4 | import com.karumi.rosie.domain.usecase.annotation.Success 5 | import com.karumi.rosie.domain.usecase.callback.OnSuccessCallback 6 | import com.karumi.rosie.view.RosiePresenter 7 | import com.q4tech.essen.ci.domain.usecase.CIHomeUseCase 8 | import javax.inject.Inject 9 | 10 | /** 11 | * Created by agustingandara on 5/10/17. 12 | */ 13 | 14 | class CIHomeRecipeSearchPresenter @Inject constructor(useCaseHandler: UseCaseHandler, private var homeUseCase: CIHomeUseCase) : RosiePresenter(useCaseHandler) { 15 | 16 | override fun initialize() { 17 | super.initialize() 18 | } 19 | 20 | override fun update() { 21 | super.update() 22 | } 23 | 24 | override fun pause() { 25 | super.pause() 26 | } 27 | 28 | override fun destroy() { 29 | super.destroy() 30 | } 31 | 32 | interface View : RosiePresenter.View 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/mvp/view/CIApplication.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.mvp.view 2 | 3 | import android.content.Context 4 | import com.karumi.rosie.application.RosieApplication 5 | import com.q4tech.essen.ci.mvp.module.CIApplicationModule 6 | import io.realm.Realm 7 | import java.util.* 8 | 9 | /** 10 | * Created by agustingandara on 5/10/17. 11 | */ 12 | 13 | class CIApplication : RosieApplication() { 14 | 15 | override fun onCreate() { 16 | super.onCreate() 17 | Realm.init(this) 18 | //CIApplication.CONTEXT = applicationContext 19 | } 20 | 21 | override fun getApplicationModules(): List { 22 | return Arrays.asList(CIApplicationModule() as Any) 23 | } 24 | 25 | 26 | /*companion object { 27 | var CONTEXT: Context? = null 28 | }*/ 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/mvp/view/activity/CIHomeActivity.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.mvp.view.activity 2 | 3 | import android.os.Bundle 4 | import android.view.MenuItem 5 | import com.karumi.rosie.view.RosieActivity 6 | import com.karumi.rosie.view.Presenter 7 | import com.q4tech.essen.ci.mvp.module.CIHomeModule 8 | import com.q4tech.essen.ci.mvp.presenter.activity.CIHomePresenter 9 | import com.q4tech.essen.ci.R 10 | import com.q4tech.essen.ci.mvp.view.fragment.CIHomeBookmarksFragment 11 | import com.q4tech.essen.ci.mvp.view.fragment.CIHomeProfileFragment 12 | import com.q4tech.essen.ci.mvp.view.fragment.CIHomeRecipeListFragment 13 | import com.q4tech.essen.ci.mvp.view.fragment.CIHomeRecipeSearchFragment 14 | import com.q4tech.essen.ci.utils.helpers.BottomNavigationViewHelper 15 | import kotlinx.android.synthetic.main.activity_cihome.* 16 | import javax.inject.Inject 17 | 18 | 19 | 20 | class CIHomeActivity : RosieActivity(), CIHomePresenter.View { 21 | 22 | @Inject @Presenter lateinit var presenter: CIHomePresenter 23 | 24 | private val homeRecipeListFragment: CIHomeRecipeListFragment = CIHomeRecipeListFragment() 25 | private val homeRecipeSearchFragment: CIHomeRecipeSearchFragment = CIHomeRecipeSearchFragment() 26 | private val homeBookmarksFragment: CIHomeBookmarksFragment = CIHomeBookmarksFragment() 27 | private val homeProfileFragment: CIHomeProfileFragment = CIHomeProfileFragment() 28 | 29 | override fun getLayoutId(): Int { return R.layout.activity_cihome } 30 | 31 | override fun onCreate(savedInstanceState: Bundle?) { 32 | super.onCreate(savedInstanceState) 33 | BottomNavigationViewHelper.removeShiftMode(bottomNavigationView) 34 | 35 | bottomNavigationView.setOnNavigationItemSelectedListener{ menuItem:MenuItem -> 36 | when(menuItem.itemId){ 37 | R.id.actionRecipeList -> fragmentManager.beginTransaction().replace(R.id.fragmentFrameLayout, homeRecipeListFragment).commit() 38 | R.id.actionRecipeSearch -> fragmentManager.beginTransaction().replace(R.id.fragmentFrameLayout, homeRecipeSearchFragment).commit() 39 | R.id.actionBookmarks -> fragmentManager.beginTransaction().replace(R.id.fragmentFrameLayout, homeBookmarksFragment).commit() 40 | R.id.actionProfile -> fragmentManager.beginTransaction().replace(R.id.fragmentFrameLayout, homeProfileFragment).commit() 41 | } 42 | return@setOnNavigationItemSelectedListener true 43 | } 44 | 45 | fragmentManager.beginTransaction().replace(R.id.fragmentFrameLayout, homeRecipeListFragment).commit() 46 | } 47 | 48 | override fun getActivityScopeModules(): MutableList { return mutableListOf(CIHomeModule()) } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/mvp/view/fragment/CIHomeBookmarksFragment.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.mvp.view.fragment 2 | 3 | import com.karumi.rosie.view.Presenter 4 | import com.karumi.rosie.view.RosieFragment 5 | import com.q4tech.essen.ci.R 6 | import com.q4tech.essen.ci.mvp.presenter.activity.CIHomeBookmarksPresenter 7 | import com.q4tech.essen.ci.mvp.presenter.activity.CIHomeRecipeSearchPresenter 8 | import javax.inject.Inject 9 | 10 | /** 11 | * Created by agustingandara on 5/10/17. 12 | */ 13 | 14 | class CIHomeBookmarksFragment : RosieFragment(), CIHomeBookmarksPresenter.View { 15 | 16 | @Inject @Presenter lateinit var presenter: CIHomeBookmarksPresenter 17 | 18 | override fun getLayoutId(): Int { return R.layout.fragment_cihome_bookmarks } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/mvp/view/fragment/CIHomeProfileFragment.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.mvp.view.fragment 2 | 3 | import com.karumi.rosie.view.Presenter 4 | import com.karumi.rosie.view.RosieFragment 5 | import com.q4tech.essen.ci.R 6 | import com.q4tech.essen.ci.mvp.presenter.activity.CIHomeProfilePresenter 7 | import javax.inject.Inject 8 | 9 | /** 10 | * Created by agustingandara on 5/10/17. 11 | */ 12 | 13 | class CIHomeProfileFragment : RosieFragment(), CIHomeProfilePresenter.View { 14 | 15 | @Inject @Presenter lateinit var presenter: CIHomeProfilePresenter 16 | 17 | override fun getLayoutId(): Int { return R.layout.fragment_cihome_profile } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/mvp/view/fragment/CIHomeRecipeListFragment.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.mvp.view.fragment 2 | 3 | import com.karumi.rosie.view.Presenter 4 | import com.karumi.rosie.view.RosieFragment 5 | import com.q4tech.essen.ci.R 6 | import com.q4tech.essen.ci.mvp.presenter.activity.CIHomeRecipeSearchPresenter 7 | import javax.inject.Inject 8 | 9 | /** 10 | * Created by agustingandara on 5/10/17. 11 | */ 12 | 13 | class CIHomeRecipeListFragment : RosieFragment(), CIHomeRecipeSearchPresenter.View { 14 | 15 | @Inject @Presenter lateinit var presenter: CIHomeRecipeSearchPresenter 16 | 17 | override fun getLayoutId(): Int { return R.layout.fragment_cihome_recipelist } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/mvp/view/fragment/CIHomeRecipeSearchFragment.kt: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.mvp.view.fragment 2 | 3 | import com.karumi.rosie.view.Presenter 4 | import com.karumi.rosie.view.RosieFragment 5 | import com.q4tech.essen.ci.R 6 | import com.q4tech.essen.ci.mvp.presenter.activity.CIHomeRecipeListPresenter 7 | import javax.inject.Inject 8 | 9 | /** 10 | * Created by agustingandara on 5/10/17. 11 | */ 12 | 13 | class CIHomeRecipeSearchFragment : RosieFragment(), CIHomeRecipeListPresenter.View { 14 | 15 | @Inject @Presenter lateinit var presenter: CIHomeRecipeListPresenter 16 | 17 | override fun getLayoutId(): Int { return R.layout.fragment_cihome_recipesearch } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/repository/CIRecipeCloudDataSource.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Karumi. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.q4tech.essen.ci.repository 18 | 19 | import com.karumi.rosie.repository.datasource.* 20 | import com.q4tech.essen.ci.domain.model.* 21 | import javax.inject.* 22 | 23 | class CIRecipeCloudDataSource @Inject constructor() : EmptyReadableDataSource() { 24 | 25 | override fun getByKey(key: String?): CIRecipeModel? { 26 | return null 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/repository/CIRecipeDataSourceFactory.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Karumi. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.q4tech.essen.ci.repository 18 | 19 | import com.karumi.rosie.repository.datasource.* 20 | import com.q4tech.essen.ci.domain.model.* 21 | import com.q4tech.essen.ci.mvp.view.CIApplication 22 | import javax.inject.* 23 | 24 | class CIRecipeDataSourceFactory @Inject constructor(private var recipeMockDataSource: CIRecipeMockDataSource, private var recipeCloudDataSource: CIRecipeCloudDataSource) { 25 | 26 | fun createDataSource(): ReadableDataSource { 27 | if (true) { 28 | return this.recipeMockDataSource 29 | } else { 30 | return this.recipeCloudDataSource 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/repository/CIRecipeMockDataSource.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Karumi. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.q4tech.essen.ci.repository 18 | 19 | import android.content.Context 20 | import com.google.gson.Gson 21 | import com.karumi.rosie.daggerutils.ForActivity 22 | import com.karumi.rosie.repository.datasource.* 23 | import com.q4tech.essen.ci.domain.model.* 24 | import com.q4tech.essen.ci.utils.AssetUtils 25 | import javax.inject.* 26 | 27 | class CIRecipeMockDataSource @Inject constructor(@ForActivity context: Context) : EmptyReadableDataSource() { 28 | 29 | private var recipes: Array 30 | 31 | init { recipes = Gson().fromJson(AssetUtils.readString(context, "mock.json"), Array::class.java) } 32 | 33 | @Throws(Exception::class) 34 | override fun getByKey(key: String?): CIRecipeModel? { 35 | for (r in recipes) { 36 | if(r.id == key) return r 37 | } 38 | return null 39 | } 40 | 41 | /*private val cheeseCake: CIRecipeModel get() { 42 | val cheesecake = CIRecipeModel() 43 | cheesecake.id = CHEESE_CAKE 44 | cheesecake.name = "CheeseCake" 45 | return cheesecake 46 | }*/ 47 | 48 | /*companion object { 49 | 50 | val CHEESE_CAKE = "1" 51 | }*/ 52 | 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/repository/CIRecipeRepository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Karumi. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.q4tech.essen.ci.repository 18 | 19 | import com.karumi.rosie.repository.* 20 | import com.karumi.rosie.repository.datasource.* 21 | import com.q4tech.essen.ci.domain.model.* 22 | import javax.inject.* 23 | 24 | class CIRecipeRepository @Inject constructor(recipeDataSourceFactory: CIRecipeDataSourceFactory) : RosieRepository() { 25 | 26 | init { addReadableDataSources(recipeDataSourceFactory.createDataSource()) } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/utils/AssetUtils.java: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.utils; 2 | 3 | import android.content.*; 4 | 5 | import java.io.*; 6 | 7 | /** 8 | * Created by agustingandara on 5/11/17. 9 | */ 10 | 11 | public class AssetUtils { 12 | 13 | public static String readString(Context context, String fileName){ 14 | StringBuilder returnString = new StringBuilder(); 15 | InputStream fIn = null; 16 | InputStreamReader isr = null; 17 | BufferedReader input = null; 18 | try { 19 | fIn = context.getResources().getAssets().open(fileName, Context.MODE_WORLD_READABLE); 20 | isr = new InputStreamReader(fIn); 21 | input = new BufferedReader(isr); 22 | String line = ""; 23 | while ((line = input.readLine()) != null) { 24 | returnString.append(line); 25 | } 26 | } catch (Exception e) { 27 | e.getMessage(); 28 | } finally { 29 | try { 30 | if (isr != null) 31 | isr.close(); 32 | if (fIn != null) 33 | fIn.close(); 34 | if (input != null) 35 | input.close(); 36 | } catch (Exception e2) { 37 | e2.getMessage(); 38 | } 39 | } 40 | return returnString.toString(); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/q4tech/essen/ci/utils/helpers/BottomNavigationViewHelper.java: -------------------------------------------------------------------------------- 1 | package com.q4tech.essen.ci.utils.helpers; 2 | 3 | import android.support.design.internal.*; 4 | import android.support.design.widget.*; 5 | import android.util.*; 6 | 7 | import java.lang.reflect.*; 8 | 9 | /** 10 | * Created by agustingandara on 5/10/17. 11 | */ 12 | 13 | public class BottomNavigationViewHelper { 14 | 15 | public static void removeShiftMode(BottomNavigationView view) { 16 | BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0); 17 | try { 18 | Field shiftingMode = menuView.getClass().getDeclaredField("mShiftingMode"); 19 | shiftingMode.setAccessible(true); 20 | shiftingMode.setBoolean(menuView, false); 21 | shiftingMode.setAccessible(false); 22 | for (int i = 0; i < menuView.getChildCount(); i++) { 23 | BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i); 24 | item.setShiftingMode(false); 25 | item.setChecked(item.getItemData().isChecked()); 26 | } 27 | } catch (NoSuchFieldException e) { 28 | Log.e("ERROR NO SUCH FIELD", "Unable to get shift mode field"); 29 | } catch (IllegalAccessException e) { 30 | Log.e("ERROR ILLEGAL ALG", "Unable to change value of shift mode"); 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_cihome.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 17 | 18 | 19 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_cihome_bookmarks.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_cihome_profile.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_cihome_recipelist.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_cihome_recipesearch.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_cihome.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 16 | 22 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_home_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-hdpi/ic_home_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-hdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_person_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-hdpi/ic_person_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_person_outline_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-hdpi/ic_person_outline_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_search_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-hdpi/ic_search_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_star_border_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-hdpi/ic_star_border_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_home_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-mdpi/ic_home_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-mdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_person_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-mdpi/ic_person_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_person_outline_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-mdpi/ic_person_outline_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_search_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-mdpi/ic_search_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_star_border_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-mdpi/ic_star_border_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_home_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xhdpi/ic_home_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xhdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_person_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xhdpi/ic_person_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_person_outline_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xhdpi/ic_person_outline_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_search_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xhdpi/ic_search_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_star_border_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xhdpi/ic_star_border_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_home_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxhdpi/ic_home_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxhdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_person_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxhdpi/ic_person_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_person_outline_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxhdpi/ic_person_outline_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_search_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxhdpi/ic_search_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_star_border_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxhdpi/ic_star_border_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_home_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxxhdpi/ic_home_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxxhdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_person_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxxhdpi/ic_person_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_person_outline_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxxhdpi/ic_person_outline_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_search_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxxhdpi/ic_search_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_star_border_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agustindev/rosie-kotlin/43eaf7f7c120d1d02b059536ca270d4f421cd908/app/src/main/res/mipmap-xxxhdpi/ic_star_border_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #273341 4 | #1d252c 5 | #FF4081 6 | 7 | #FFF 8 | #000 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Cocina Inteligente 3 | 4 | Home 5 | Search 6 | Bookmarks 7 | Profile 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | mavenCentral() 7 | maven { url "https://jitpack.io" } 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:2.2.3' 11 | classpath 'me.tatarka:gradle-retrolambda:3.6.1' 12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-3" 13 | classpath "io.realm:realm-gradle-plugin:3.1.4" 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | jcenter() 20 | mavenCentral() 21 | } 22 | } 23 | 24 | task clean(type: Delete) { 25 | delete rootProject.buildDir 26 | } 27 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /local.properties: -------------------------------------------------------------------------------- 1 | ## This file is automatically generated by Android Studio. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must *NOT* be checked into Version Control Systems, 5 | # as it contains information specific to your local configuration. 6 | # 7 | # Location of the SDK. This is only used by Gradle. 8 | # For customization when using a Version Control System, please read the 9 | # header note. 10 | #Wed May 10 10:59:21 ART 2017 11 | ndk.dir=/Users/agustingandara/Library/Android/sdk/ndk-bundle 12 | sdk.dir=/Users/agustingandara/Library/Android/sdk 13 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------