├── .gitignore ├── .travis.yml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ ├── euro.ttf │ │ └── euro_data.json │ ├── java │ │ └── io │ │ │ └── github │ │ │ └── erikjhordanrey │ │ │ └── cleanarchitecture │ │ │ ├── EuroApplication.java │ │ │ ├── core │ │ │ ├── mapper │ │ │ │ └── Mapper.java │ │ │ └── presenter │ │ │ │ └── Presenter.java │ │ │ ├── data │ │ │ ├── entity │ │ │ │ ├── ImageEntity.java │ │ │ │ └── TeamEntity.java │ │ │ ├── local │ │ │ │ ├── LocalTeamApi.java │ │ │ │ └── LocalTeamApiToTeamEntityMapper.java │ │ │ └── repository │ │ │ │ ├── TeamsRepository.java │ │ │ │ └── datasource │ │ │ │ ├── TeamEntityToTeamMapper.java │ │ │ │ └── TeamsLocalDataSource.java │ │ │ ├── di │ │ │ ├── components │ │ │ │ └── MainComponent.java │ │ │ └── modules │ │ │ │ └── MainModule.java │ │ │ ├── domain │ │ │ ├── model │ │ │ │ └── Team.java │ │ │ └── usecase │ │ │ │ ├── GetTeamUseCase.java │ │ │ │ └── GetTeamsUseCase.java │ │ │ └── view │ │ │ ├── activity │ │ │ ├── TeamDetailActivity.java │ │ │ └── TeamsActivity.java │ │ │ ├── adapter │ │ │ ├── TeamViewHolder.java │ │ │ └── TeamsAdapter.java │ │ │ ├── model │ │ │ ├── TeamUi.java │ │ │ └── mapper │ │ │ │ └── TeamToTeamUiMapper.java │ │ │ ├── presenter │ │ │ ├── TeamDetailPresenter.java │ │ │ └── TeamsPresenter.java │ │ │ └── widget │ │ │ ├── CustomFontTextView.java │ │ │ └── HeaderView.java │ └── res │ │ ├── drawable │ │ ├── background_home.xml │ │ ├── background_row.xml │ │ └── euro.png │ │ ├── layout │ │ ├── activity_team_detail.xml │ │ ├── activity_teams.xml │ │ ├── content_teams.xml │ │ ├── header_detail.xml │ │ └── team_row.xml │ │ ├── menu │ │ └── menu_scrolling.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-v21 │ │ └── styles.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── io │ └── github │ └── erikjhordanrey │ └── cleanarchitecture │ ├── RXJavaRule.java │ ├── RxAndroidRule.java │ ├── data │ ├── LocalTeamApiToTeamEntityMapperTest.java │ ├── TeamEntityToTeamMapperTest.java │ └── repository │ │ └── TeamsRepositoryTest.java │ ├── domain │ ├── GetTeamUseCaseTest.java │ └── GetTeamsUseCaseTest.java │ ├── fake │ └── FakeTeamLocalAPI.java │ └── ui │ └── TeamsPresenterTest.java ├── art ├── Telecine_2016-04-11-09-46-01.gif └── euro.png ├── build.gradle ├── gradle-scripts └── dependencies.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | .DS_Store 4 | /build 5 | /captures 6 | **.iml 7 | /.idea 8 | sdcard 9 | sdcard.lock 10 | libs/ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | jdk: oraclejdk8 3 | 4 | env: 5 | global: 6 | - ADB_INSTALL_TIMEOUT=8 7 | 8 | android: 9 | components: 10 | - tools 11 | - platform-tools 12 | - build-tools-29.0.2 13 | - android-29 14 | - extra-android-support 15 | - extra-google-google_play_services 16 | - extra-google-m2repository 17 | - extra-android-m2repository 18 | 19 | licenses: 20 | - 'android-sdk-preview-license-.+' 21 | - 'android-sdk-license-.+' 22 | - 'google-gdk-license-.+' 23 | 24 | script: 25 | - ./gradlew assemble testDebug 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Clean Architecture on Android. (EUROCUP 2016) [![Build Status](https://travis-ci.org/erikjhordan-rey/Clean-Architecture-Android.svg?branch=master)](https://travis-ci.org/erikjhordan-rey/Clean-Architecture-Android) 2 | 3 | Example Android Clean Architecture used to explain how to use this architecture (rules) in our android applications. 4 | This example was created to support an article explaining that I have written about how to architect an android application using Uncle Bob's clean architecture. [Aplicando Clean Architecture en Android][1] (Spanish). 5 | 6 | ![](./art/euro.png) 7 | 8 | Libraries used on the sample project 9 | ------------------------------------ 10 | * [AppCompat, CardView, RecyclerView and DesignLibrary][2] 11 | * [RxJava & RxAndroid][3] 12 | * [Dagger 2][4] 13 | * [Junit][5] 14 | * [Mockito][6] 15 | 16 | 17 | # Demo 18 | ![](./art/Telecine_2016-04-11-09-46-01.gif) 19 | 20 | [1]: https://erikjhordan-rey.github.io/blog/2016/01/27/ANDROID-clean-architecture.html 21 | [2]: http://developer.android.com/intl/es/tools/support-library/index.html 22 | [3]: https://github.com/ReactiveX/RxAndroid 23 | [4]: https://github.com/google/dagger 24 | [5]: http://developer.android.com/intl/es/reference/junit/framework/package-summary.html 25 | [6]: http://mockito.org/ 26 | 27 | ## Inspiring 28 | 29 | I created my own implementation of Clean Architecture and I want to thank you how much I've learned from these magnificent developers. 30 | 31 | * [Uncle Bob - The Clean Architecture](https://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html) 32 | * [Karumi Team - Rosie is an Android framework to create applications following the principles of Clean Architecture](https://github.com/Karumi/Rosie) 33 | * [Fernando Cejas - Clean Architecture Sample](https://github.com/android10/Android-CleanArchitecture) 34 | 35 | 36 | Do you want to contribute? 37 | -------------------------- 38 | 39 | Feel free to report or add any useful feature, I will be glad to improve it with your help. 40 | 41 | 42 | Developed By 43 | ------------ 44 | 45 | * Erik Jhordan Rey - 46 | 47 | License 48 | ------- 49 | 50 | Copyright 2016 Erik Jhordan Rey 51 | 52 | Licensed under the Apache License, Version 2.0 (the "License"); 53 | you may not use this file except in compliance with the License. 54 | You may obtain a copy of the License at 55 | 56 | http://www.apache.org/licenses/LICENSE-2.0 57 | 58 | Unless required by applicable law or agreed to in writing, software 59 | distributed under the License is distributed on an "AS IS" BASIS, 60 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 61 | See the License for the specific language governing permissions and 62 | limitations under the License. 63 | 64 | 65 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 29 5 | 6 | defaultConfig { 7 | applicationId "io.github.erikjhordanrey.cleanarchitecture" 8 | minSdkVersion 21 9 | targetSdkVersion 29 10 | versionCode 1 11 | versionName "1.0" 12 | multiDexEnabled true 13 | } 14 | 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | 22 | packagingOptions { 23 | exclude 'META-INF/services/javax.annotation.processing.Processor' 24 | exclude 'META-INF/LICENSE' 25 | exclude 'META-INF/LICENSE.txt' 26 | } 27 | 28 | compileOptions { 29 | sourceCompatibility JavaVersion.VERSION_1_8 30 | targetCompatibility JavaVersion.VERSION_1_8 31 | } 32 | 33 | lintOptions { 34 | abortOnError false 35 | } 36 | 37 | buildFeatures { 38 | viewBinding = true 39 | } 40 | } 41 | 42 | dependencies { 43 | 44 | implementation androidXdependencies.appCompat 45 | implementation androidXdependencies.material 46 | implementation androidXdependencies.annotation 47 | 48 | implementation daggerDependencies.dagger 49 | annotationProcessor daggerDependencies.daggerCompiler 50 | 51 | implementation rxDependencies.rxJava 52 | implementation rxDependencies.rxAndroid 53 | 54 | implementation circleImageView 55 | implementation picasso 56 | implementation gson 57 | 58 | testImplementation testingDependencies.junit 59 | testImplementation testingDependencies.mockito 60 | testImplementation testingDependencies.hamcrest 61 | testImplementation testingDependencies.robolectric 62 | } 63 | 64 | -------------------------------------------------------------------------------- /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/Jhordan/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 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 16 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/assets/euro.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erikjhordan-rey/Clean-Architecture-Android/88c9b8428133a9eeede22699c9b7eb1710e988ac/app/src/main/assets/euro.ttf -------------------------------------------------------------------------------- /app/src/main/assets/euro_data.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "flag": "ALB", 4 | "name": "Albania", 5 | "images": [ 6 | { 7 | "img_flag": "https://www.nationsonline.org/flags_big/albania_lgflag.gif", 8 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/ALB.jpg", 9 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/ALB.jpg", 10 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Goldenjubilee/01/59/01/50/1590150_w1.jpg" 11 | } 12 | ], 13 | "team_declaimer": "Albania jugará en la UEFA EURO 2016 su primera gran fase final de un torneo gracias al trabajo del seleccionador Gianni De Biasi, que ya dio esperanzas a los albaneses en la fase de clasificación para el Mundial de 2014.", 14 | "best_result": "nunca se había clasificado previamente", 15 | "coach": "Gianni De Biasi", 16 | "leading_scorer": "histórico, Erjon Bogdani (18); actual, Hamdi Salihi (11)", 17 | "nick_name": " Shqiponja (las águilas)", 18 | "stadium": "Elbasani Arena, Elbasan", 19 | "description_part_1": "Albania, una de las federaciones fundadoras de la UEFA, nunca se había clasificado para un gran torneo tras alcanzar la fase final de la UEFA EURO 2016, aunque sus resultados habían mejorado en los últimos años bajo las órdenes de experimentados seleccionadores como el alemán Hans-Peter Briegel o el holandés Arie Haan. Albania evitó la última plaza de su grupo en sus siete últimas fases de grupos. En la fase de clasificación para la Copa Mundial de la FIFA de 2014 estuvo cerca de alcanzar los play-offs bajo la dirección del italiano Gianni De Biasi, y ahora, ha logrado la clasificación tras terminar subcampeón en el Grupo I por detrás de Francia.", 20 | "matches_played": "J 93 G 18 E 22 P 53 GF 78 GC 159", 21 | "overall": "J 0 G 0 E 0 P 0 GF 0 GC 0", 22 | "final_tournament": "J 93 G 18 E 22 P 53 GF 78 GC 159", 23 | "description_part_2": "En su campaña de debut en el Campeonato de Europa de la UEFA, Albania logró una famosa victoria aislada en un grupo sin demasiados buenos resultados, un patrón que se ha repetido en numerosas fases de clasificación hasta la de la UEFA EURO 2016. Después de quedarse sin participar en el torneo de 1960, logró su primer triunfo en la competición en los octavos de final ante Dinamarca en su intento de lograr una plaza en la fase final de 1964. Un equipo liderado por el que quizá sea el jugador más destacado en la historia del país, Panajot Pano, ganó por 1-0 en Tirana, pero los daneses ya tenían encarrilada la eliminatoria con el 4-0 que habían logrado en el partido de ida.", 24 | "description_part_3": "Cuatro años después, Albania de nuevo demostró su calidad, a pesar de que ya estaba eliminada. Empató 0-0 ante la República Federal de Alemania y le impidió clasificarse para una fase final por única vez en su historia. Desde entonces, ha logrado éxitos de forma esporádica, como cuando venció por 3-0 a Turquía en la fase de clasificación para el torneo de 1972, o en su memorable triunfo por 3-1 sobre Rusia en 2003. Albania logró su mejor actuación en la fase de clasificación para la UEFA EURO 2008, donde sumó once puntos, pero aun así no logró el pase a la fase final. Cuatro años más tarde, ha finalizado segunda de grupo por detrás de Portugal para alcanzar su primera fase final." 25 | }, 26 | { 27 | "flag": "AUT", 28 | "name": "Austria", 29 | "images": [ 30 | { 31 | "img_flag": "https://www.nationsonline.org/flags_big/Austria_lgflag.gif", 32 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/AUT.jpg", 33 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/AUT.jpg", 34 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Comp_Matches/71/52/30/715230_w1.jpg" 35 | } 36 | ], 37 | "team_declaimer": "Los grandes días del fútbol austriaco quedaron atrás, pero hay señales de aliento para los co-anfitriones de la UEFA EURO 2008 con el suizo Marcel Koller al mando.", 38 | "best_result": "fase de grupos de 2008", 39 | "coach": "Marcel Koller", 40 | "leading_scorer": "histórico, Toni Polster (44); actual, Marc Janko (25)", 41 | "nick_name": "ninguno", 42 | "stadium": "Ernst-Happel-Stadion, Viena", 43 | "description_part_1": "Los días de gloria del fútbol austríaco son cosa del pasado, con la tercera plaza en la Copa Mundial de la FIFA de 1954 como su mayor logro. En total, Austria ha participado en siete Mundiales, la última vez en Francia '98, pero sólo había competido en un Campeonato de Europa de la UEFA, cuando fue co-anfitriona en 2008 y se quedó fuera de las rondas eliminatorias tras caer ante Alemania. Su rival del otro lado de la frontera volvió a ver su bestia negra en la fase de clasificación de la UEFA EURO 2012 y de la Copa Mundial de la FIFA de 2014, aunque parece que hay signos de recuperación bajo el mando del técnico suizo Marcel Koller después de lograr el pase a Francia tras nueve victorias y un empate en diez encuentros de clasificación. ", 44 | "matches_played": "J 103 G 45 E 18 P 40 GF 185 GC 150", 45 | "overall": "J 3 G 0 E 1 P 2 GF 1 GC 3", 46 | "final_tournament": "J 100 G 45 E 17 P 38 GF 184 GC 147", 47 | "description_part_2": "La UEFA EURO 2008 sigue siendo la única participación de Austria en una fase final de una Eurocopa y no duró mucho en un torneo que acogió junto a Suiza, ya que los de Josef Hickersberger pagaron la falta de experiencia. Perdieron el primer partido ante Croacia, y tras empatar en el segundo ante Polonia, no llegaron a las rondas eliminatorias al perder el tercer encuentro por 1-0 ante Alemania.", 48 | "description_part_3": "Austria nunca ha podido repetir sus impresionantes clasificaciones para la Copa Mundial de la FIFA en los Campeonatos de Europa de la UEFA, aunque en la campaña de 2012 estuvo cerca, pero después de un brillante inicio terminó cuarta en la fase de clasificación. Se quedó a un punto de la clasificación directa para la fase final de 1980 y debido a dos derrotas en Reino Unido, 1-0 en Gales (1976) y 5-3 en Irlanda del Norte (1996), también se quedó fuera de otros dos campeonatos." 49 | }, 50 | { 51 | "flag": "BEL", 52 | "name": "Bélgica", 53 | "images": [ 54 | { 55 | "img_flag": "https://www.nationsonline.org/flags_big/Belgium_lgflag.gif", 56 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/BEL.jpg", 57 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/BEL.jpg", 58 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Comp_Matches/01/72/52/31/1725231_w1.jpg" 59 | } 60 | ], 61 | "team_declaimer": "Vea los cinco goles de Bélgica durante la fase de clasificación y eche un vistazo a su trayectoria en la EURO, a la cual regresa el combinado belga ocupando el primer puesto del ránking FIFA.", 62 | "best_result": "finalista (1980)", 63 | "coach": "Marc Wilmots", 64 | "leading_scorer": "histórico, Bernard Voorhoff, Paul Van Himst (30); actual, Marouane Fellaini (15)", 65 | "nick_name": "Rode Duivels/Diables Rouges (los diablos rojos)", 66 | "stadium": "Stade Roi Baudaouin, Bruselas", 67 | "description_part_1": "Bélgica acabó con 12 años de ausencia en un gran torneo con una impresionante clasificación para la Copa Mundial de la FIFA de 2014, donde llegó a cuartos de final. Los buenos tiempos vuelven del lado de Marc Wilmots, que lideró al combinado hacia la UEFA EURO 2016. En Francia espera mejorar o igualar anteriores éxitos, como el subcampeonato de la EURO '80 y la cuarta plaza de la Copa Mundial de la FIFA de 1986.", 68 | "matches_played": "J 116 G 53 E 28 P 35 GF 183 GC 132", 69 | "overall": "J 12 G 4 E 2 P 6 GF 13 GC 20", 70 | "final_tournament": "J 104 G 49 E 26 P 29 GF 170 GC 112", 71 | "description_part_2": "Bélgica ha vuelto al grupo de élite en Europa y ha puesto fin a tres décadas desde su última clasificación para un Campeonato de Europa de la UEFA en el cual era un inquilino habitual de las fases finales durante la década de los 70 y principios de los 80. Bélgica acabó tercera en casa en 1972 y ocho años después subió un peldaño más en su búsqueda de levantar el trofeo, pero cayó en Roma por 2-1 ante la República Federal de Alemania.", 72 | "description_part_3": "Desde entonces los 'diablos rojos' llegaron a dos fases de grupos más, en 1984 y 2000, cuando fue co-anfitriona, aunque en ambas ocasiones se quedó fuera a las primeras de cambio. La fase de clasificación a la UEFA EURO 2012 llegó muy pronto para la nueva generación belga, y el equipo de Georges Leekens nunca se recuperó de sus dos primeras derrotas en el Grupo A y acabó en la tercera plaza, dos puntos por detrás de Turquía en la lucha por el play-off. Ahora, sin embargo, tienen cuatro años más de experiencia." 73 | 74 | }, 75 | { 76 | "flag": "CRO", 77 | "name": "Croacia", 78 | "images": [ 79 | { 80 | "img_flag": "https://www.nationsonline.org/flags_big/Croatia_lgflag.gif", 81 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/CRO.jpg", 82 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/CRO.jpg", 83 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/DomesticLeague/01/60/08/55/1600855_w1.jpg" 84 | } 85 | ], 86 | "team_declaimer": "Desde la secesión de Yugoslavia en 1991, se ha convertido en una fuerza en el fútbol internacional, llegando a cinco fases finales europeas en sólo seis intentos.", 87 | "best_result": "cuartos de final (1996, 2008)", 88 | "coach": "Ante Čačić", 89 | "leading_scorer": "histórico, Davor Šuker (45); actual, Darijo Srna (21)", 90 | "nick_name": "Kockasti (en referencia a su camiseta ajedrezada)", 91 | "stadium": "Stadion Maksimir, Zagreb", 92 | "description_part_1": "Desde la desintegración de Yugoslavia en 1991, Croacia se ha convertido en una de las grandes selecciones del panorama internacional. El conjunto croata logró la clasificación en sus campañas de debut tanto en el Campeonato de Europa de la UEFA como en la Copa Mundial de la FIFA, terminando tercero en Francia '98 donde Davor Šuker, con seis goles, fue máximo goleador de la cita mundialista. Croacia se ha convertido en una habitual de las fases finales, perdiéndose sólo dos (2000 y 2010) aunque sólo ha superado la fase de grupos una vez más, en la UEFA EURO 2008. Los croatas lograron la clasificación para fase final de la UEFA EURO 2016, su cuarta de manera seguida, al ser subcampeones del Grupo H por detrás de Italia.", 93 | "matches_played": "J 76 G 46 E 18 P 12 GF 136 GC 55 ", 94 | "overall": "J 14 G 6 E 4 P 4 GF 18 GC 16 ", 95 | "final_tournament": "J 62 G 40 E 14 P 8 GF 118 GC 39", 96 | "description_part_2": "La UEFA EURO 2012 fue la cuarta fase final continental de Croacia en cinco intentos desde que se independizó de Yugoslavia, con el único fallo en el año 2000. Inspirado por un 'hat-trick' de Davor Šuker, el cuadro de Miroslav Blažević alcanzó los cuartos final en 1996 en su primera participación y se quedó a las puertas de semifinales en 2008 antes de que Turquía igualase en el último suspiro y venciese en penaltis.", 97 | "description_part_3": "Croacia aportó jugadores al equipo de Yugoslavia que fue dos veces subcampeón del Campeonato de Europa de la UEFA. Perdió en el primer torneo en 1960 ante la Unión Soviética por 2-1 en la prórroga y sucumbió 2-0 contra Italia en el choque decisivo ocho años después." 98 | 99 | }, 100 | { 101 | "flag": "CZE", 102 | "name": "República Checa", 103 | "images": [ 104 | { 105 | "img_flag": "https://www.nationsonline.org/flags_big/Czech_Republic_lgflag.gif", 106 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/CZE.jpg", 107 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/CZE.jpg", 108 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/EURO/66/50/98/665098_w1.jpg" 109 | } 110 | ], 111 | "team_declaimer": "Sólo ha estado compitiendo como nación independiente durante 20 años, sin embargo, desde ese momento el país se ha clasificado para todos los Campeonato de Europa de la UEFA.", 112 | "best_result": "Campeón 1976, (como Checoslovaquia)", 113 | "coach": "Pavel Vrba", 114 | "leading_scorer": "histórico, Jan Koller (55); actual, Tomáš Rosický (22)", 115 | "nick_name": "Národní tým (equipo nacional)", 116 | "stadium": "varias", 117 | "description_part_1": "La República Checa sólo lleva 20 años compitiendo como nación independiente aunque en este tiempo el país se ha clasificado para todos los Campeonatos de Europa de la UEFA, terminando como subcampeona de la EURO '96, su primer gran torneo, y alcanzando las semifinales de la UEFA EURO 2004. Por el contrario, su clasificación para la Copa Mundial de la FIFA ha sido algo más decepcionante, logrando sólo una participación en la fase final, la de Alemania 2006 donde cayó en la fase de grupos. La antigua Checoslovaquia se alzó con el título europeo en 1976, ganando en la tanda de penaltis a la República Federal de Alemania y acabó como subcampeona del Mundial en dos ocasiones (1934 y 1962).", 118 | "matches_played": "J 145 G 89 E 26 P 30 GF 278 GC 129 ", 119 | "overall": "J 29 G 13 E 5 P 11 GF 40 GC 38 ", 120 | "final_tournament": "J 116 G 76 E 21 P 19 GF 238 GC 91", 121 | "description_part_2": "La República Checa alcanzó los cuartos de final de la UEFA EURO 2012, su quinta EURO desde la disolución de Checoslovaquia en 1993. En la EURO '96 cayó en la final ante Alemania con un gol de oro obra de Oliver Bierhoff que supuso el 2-1 final. Ocho años después también sufrió en la prórroga, cuando cayó en semifinales ante Grecia.", 122 | "description_part_3": "De camino a la UEFA EURO 2000, se convirtió en la segunda selección en lograr el pase con un pleno de victorias, aunque cayó bastante pronto en la fase final, como sucedió también en 2008. No ocurrió lo mismo en 1976, cuando un memorable gol de penalti del jugador nacido en Praga Antonín Panenka dio a Checoslovaquia la victoria por 5-3 en la tanda definitiva sobre la República Federal de Alemania tras un empate 2-2 en el tiempo reglamentario. Los checos fueron terceros en su defensa del título cuatro años más tarde." 123 | 124 | }, 125 | { 126 | "flag": "ENG", 127 | "name": "Inglaterra", 128 | "images": [ 129 | { 130 | "img_flag": "https://upload.wikimedia.org/wikipedia/en/thumb/b/be/Flag_of_England.svg/1280px-Flag_of_England.svg.png", 131 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/ENG.jpg", 132 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/ENG.jpg", 133 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/General/01/50/64/18/1506418_w1.jpg" 134 | } 135 | ], 136 | "team_declaimer": "El único país europeo que ha ganado la Copa Mundial de la FIFA, pero no ha levantado la Copa Henri Delaunay, podría haber tenido un éxito más reciente de no haber sido por las tandas de penaltis.", 137 | "best_result": "semifinales (1968, 1996)", 138 | "coach": "Roy Hodgson", 139 | "leading_scorer": "histórico, Wayne Rooney (51); actual, Wayne Rooney (51).", 140 | "nick_name": "la selección de los 'tres leones' ", 141 | "stadium": "Wembley, Londres", 142 | "description_part_1": "La reciente historia de Inglaterra en los grandes torneos podría haber sido muy diferente si no hubiesen existido las tandas de penaltis. Desde que perdiera en la definitiva tanda en las seminales de la Copa Mundial de la FIFA de 1990 ante la República Federal de Alemania, Inglaterra ha sido eliminada de un torneo desde los once metros en cinco ocasiones: tres Campeonatos de Europa (1996, 2004 y 2012) y dos Mundiales (1998, 2006). De hecho, el Mundial logrado en su propio país en 1966 es su única participación en una final aunque para el Mundial de Brasil de 2014 se clasificó para la fase final como primera de su grupo. Mientras, a Francia llega tras ganar los diez partidos que disputó para la fase final de la UEFA EURO 2016.", 143 | "matches_played": "J 127 G 75 E 33 P 19 GF 257 GC 89 ", 144 | "overall": "J 27 G 9 E 9 P 9 GF 36 GC 31", 145 | "final_tournament": "J 100 G 66 E 24 P 10 GF 221 GC 58", 146 | "description_part_2": "Inglaterra sigue siendo la única selección europea ganadora de un Mundial (1966) que no ha sido capaz de conseguir la Copa Henri Delaunay. De hecho, aún no ha alcanzado una final del Campeonato de Europa, siendo la edición de 1996 la vez que más cerca ha estado, cuando cayó en la tanda de penaltis ante Alemania en las semifinales disputadas en Wembley. Como campeona del Mundo, en 1968 también alcanzó las semifinales, aunque Inglaterra no tiene grandes recuerdos en la competición.", 147 | "description_part_3": "En los torneos disputados por ocho selecciones, entre 1980 y 1992, Inglaterra no logró alcanzar las rondas eliminatorias mientras que en Francia 1984 no consiguió la clasificación para la fase final. Dejando de lado la EURO'96, el conjunto inglés ha tenido problemas para impresionar en las fases finales de 16 equipos, cayendo eliminado en la fase de grupos del 2000 y quedándose fuera del torneo de 2008. En otras dos ocasiones, en 2004 y 2012, Inglaterra cayó en los cuartos de final ante Portugal e Italia en la tanda de penaltis. " 148 | 149 | }, 150 | { 151 | "flag": "ESP", 152 | "name": "España", 153 | "images": [ 154 | { 155 | "img_flag": "https://www.nationsonline.org/flags_big/Spain_lgflag.gif", 156 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/ESP.jpg", 157 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/ESP.jpg", 158 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/EURO/72/92/23/729223_w1.jpg" 159 | } 160 | ], 161 | "team_declaimer": "Después de décadas sin conseguir grandes logros después de su victoria como local en el Campeonato de Europa de la UEFA de 1964, ha sido la gran dominadora en 2008 y 2012.", 162 | "best_result": "campeón en 1964, 2008, 2012", 163 | "coach": "Vicente del Bosque", 164 | "leading_scorer": "histórico - David Villa (59); actual - David Silva (23)", 165 | "nick_name": "La Roja", 166 | "stadium": "sin estadio fijo", 167 | "description_part_1": "Tras décadas de decepciones y malos resultados tras la victoria en el Campeonato de Europa de la UEFA de 1964 disputado en casa, España se ha convertido en la potencia dominante del fútbol mundial. La UEFA EURO 2008, en la que ganó tras derrotar 1-0 a Alemania en la final, fue seguida del triunfo en la Copa Mundial de la FIFA de 2010 dos años después en Sudáfrica. El equipo de Vicente Del Bosque fue el primero en levantar el Mundial fuera del Viejo Continente.", 168 | "matches_played": "J 151 G 98 E 27 P 26 GF 333 GC 118", 169 | "overall": "J 36 G 17 E 11 P 8 GF 50 GC 32", 170 | "final_tournament": "J 115 G 81 E 16 P 18 GF 283 GC 86", 171 | "description_part_2": "La larga espera de España por lograr un título acabó en Viena en 2008 con la selección de Luis Aragonés derrotando a Alemania por 1-0 en un torneo en el que fue muy superior. Fernando Torres marcó el gol definitivo y cuatro años más tarde se convirtió en el primer jugador en marcar en dos finales de una Eurocopa en la victoria, esta última bajo las órdenes de Vicente Del Bosque, en la UEFA EURO 2012.", 172 | "description_part_3": "Es la quinta selección que completó una fase de clasificación perfecta en otra memorable campaña que acabó con los goles en la final ante Italia de David Silva, Jordi Alba, Torres y Juan Mata." 173 | 174 | }, 175 | { 176 | "flag": "FRA", 177 | "name": "Francia", 178 | "images": [ 179 | { 180 | "img_flag": "https://www.nationsonline.org/flags_big/France_lgflag.gif", 181 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/FRA.jpg", 182 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/FRA.jpg", 183 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/NationalAss/93/79/77/937977_w1.jpg" 184 | } 185 | ], 186 | "team_declaimer": "Ha estado siempre presente en las fases finales de la EURO desde que se perdió la edición de 1988 y espera poder mantener la feliz costumbre de cumplir con las expectativas como local en la UEFA EURO 2016.", 187 | "best_result": "Campeón (1984, 2000)", 188 | "coach": "Didier Deschamps", 189 | "leading_scorer": "histórico, Thierry Henry (51); actual, Karim Benzema (27)", 190 | "nick_name": "les bleus (los azules)", 191 | "stadium": "Stade de France, Saint-Denis", 192 | "description_part_1": "Los franceses tienen la feliz costumbre de cumplir con sus expectativas en su propio suelo. Conquistaron el Campeonato de Europa de la UEFA de 1984, cuando Michel Platini les lideró a la victoria final con un récord goleador de nueve dianas, e hicieron lo propio en la Copa Mundial de la FIFA de 1998, cuando otro número 10, Zinédine Zidane, les llevó a la victoria con dos goles en la gran final ante Brasil (3-0). También fue campeona de la UEFA EURO 2000 y subcampeona en el Mundial de 2006, cuando cayó ante Italia. Sin embargo, fue eliminada en las fases de grupo de los torneos de 2008 y 2010 y quedó apeada en los cuartos de final de la UEFA EURO 2012.", 193 | "matches_played": "J 134 G 74 E 34 P 26 GF 255 GC 124", 194 | "overall": "J 32 G 15 E 8 P 9 GF 49 GC 39", 195 | "final_tournament": "J 102 G 59 E 26 P 17 GF 206 GC 85", 196 | "description_part_2": "Francia siempre ha estado presente en las fases finales de la EURO desde que se perdiese la edición de 1988, cuando no logró defender con éxito el título logrado cuatro años antes. Su segunda conquista llegó en la UEFA EURO 2000. El equipo de Roger Lemerre se convirtió entonces en el segundo combinado tras la República Federal de Alemania (1972, 1974) que fue a la vez campeón de Europa y del mundo.", 197 | "description_part_3": "El título de 2000 estuvo muy competido. Un lanzamiento de penalti de Zidane en la prórroga decidió una emocionante semifinal ante Portugal antes de que Sylvain Wiltord empatase aquella gran final ante Italia que decidió un gol de oro de David Trezeguet. Automáticamente clasificado como anfitriona, Francia buscará en 2016 unirse a España, campeona del torneo en tres ocasiones, después de caer por 2-0 ante 'La Roja' en los cuartos de final de la UEFA EURO 2012." 198 | 199 | }, 200 | { 201 | "flag": "GER", 202 | "name": "Alemania", 203 | "images": [ 204 | { 205 | "img_flag": "https://www.nationsonline.org/flags_big/Germany_lgflag.gif", 206 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/GER.jpg", 207 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/GER.jpg", 208 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Comp_Matches/66/50/85/665085_w1.jpg" 209 | } 210 | ], 211 | "team_declaimer": "Una fuente inagotable de fútbol europeo, la anteriormente conocida como República Federal de Alemania sólo una vez falló en clasificarse para la fase final de un Campeoanto de Europa de la UEFA o una Copa Mundial de la FIFA.", 212 | "best_result": "campeón 1972, 1980 (como República Federal de Alemania), 1996", 213 | "coach": "Joachim Löw", 214 | "leading_scorer": "histórico - Miroslav Klose (71); actual - Lukas Podolski (48)", 215 | "nick_name": "DFB-Elf (el once de la DFB) ", 216 | "stadium": "Varias, incluyendo el Olympiastadion, Berlin; y el Fußball Arena München, Múnich", 217 | "description_part_1": "Una potencia del fútbol europeo, Alemania (República Federal de Alemania entre 1945 y 1990) sólo se ha quedado una vez (1968) fuera de la fase final del Campeonato de Europa de la UEFA y de la Copa Mundial de la FIFA. Además, ha ganado el Mundial en cuatro ocasiones, logrando el cetro mundial en 1954, 1974, 1990 y 2014, y siendo campeona de Europa en 1972, 1980 y 1996. También ha ganado en tres ocasiones el Campeonato de Europa y cuatro Copas Mundiales. Si bien hace dos décadas de su último triunfo en la EURO, ha alcanzado al menos las semifinales en sus últimos dos torneos.", 218 | "matches_played": "J 141 G 92 E 30 P 19 GF 302 GC 106", 219 | "overall": "J 43 G 23 E 10 P 10 GF 65 GC 45", 220 | "final_tournament": "J 98 G 69 E 20 P 9 GF 237 GC 61", 221 | "description_part_2": "Tres veces campeona y tres veces subcampeona, en 1976, 1992 y 2008, Alemania ha ganado 23 de sus 43 partidos en fase finales, todos suman un récord, aunque comparte con España el palmarés de la competición. Además, la UEFA EURO 2012 fue la edición número 11 en la que Alemania participó en la fase final, lo cual es también un récord en el Campeonato de Europa de la UEFA. Aunque en Polonia y Ucrania realizó un gran torneo, Alemania perdió en semifinales por 2-1 contra Italia.", 222 | "description_part_3": "Alemania ha alcanzado las rondas eliminatorias en cada una de sus participaciones en la Copa Mundial de la FIFA, aunque en el Campeonato de Europa de la UEFA en tres ocasiones no superó la fase de grupos. En 1984 y 2004 quedó tercera en sus respectivos grupos, mientras que en 2000 fue última." 223 | 224 | }, 225 | { 226 | "flag": "HUN", 227 | "name": "Hungría", 228 | "images": [ 229 | { 230 | "img_flag": "https://www.nationsonline.org/flags_big/Hungary_lgflag.gif", 231 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/AUT.jpg", 232 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/AUT.jpg", 233 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Comp_Matches/01/67/23/81/1672381_w1.jpg" 234 | } 235 | ], 236 | "team_declaimer": "Una vez gigante del fútbol mundial, ya que fue subcampeón en las Copas del Mundo de de la FIFA de 1938 y 1954 y tres veces ganadora olímpica, llevaba 30 años sin alcanzar la fase final de un gran torneo.", 237 | "best_result": "tercera plaza en 1964", 238 | "coach": "Bernd Storck", 239 | "leading_scorer": "histórico - Ferenc Puskás (84); actual - Zoltán Gera (24)", 240 | "nick_name": "ninguno", 241 | "stadium": "Groupama Aréna, Budapest", 242 | "description_part_1": "Peso pesado en el continente y a nivel mundial en el pasado, tras terminar subcampeona en las Copas Mundiales de la FIFA de 1938 y 1954 además de ganar tres Juegos Olímpicos, Hungría llevaba 14 torneos sin alcanzar la fase final (desde el Mundial de 1986), pero puso fin a esta mala racha en la UEFA EURO 2016 a través de los play-offs. Con la edad dorada de Ferenc Puskás, József Bozsik, Sándor Kocsis y el resto de 'los magiares mágicos' que reinaron en la década de los 50 ya en el recuerdo, Hungría terminó tercera y cuarta en los Campeonatos de Europa de la UEFA de 1964 y 1972.", 243 | "matches_played": "J 125 G 53 E 26 P 46 GF 202 GC 167", 244 | "overall": "J 4 G 1 E 0 P 3 GF 5 GC 6", 245 | "final_tournament": "J 121 G 52 E 26 P 43 GF 197 GC 161", 246 | "description_part_2": "Flórián Albert guió a Hungría hasta la tercera plaza del torneo de 1964 y a la cuarta ocho años después. En 1964 superó a Gales, a la República Democrática de Alemania y a Francia antes de caer en la prórroga de las semifinales ante España (2-1). Tres días después Hungría se impuso 3-1, también en el tiempo extra, a Dinamarca en el partido por la tercera plaza gracias a los dos goles de Dezső Novák. En 1972, el conjunto húngaro superó a Rumanía en el partido de desempate de los cuartos de final pero un penalti fallado por Sándor Zámbó confirmó su derrota ante la URSS y esta vez el partido por la tercera plaza fue para la anfitriona Bélgica.", 247 | "description_part_3": "Tras ello, Hungría no logró superar la fase de clasificación en las siguientes diez campañas, aunque bajo el mando de Sándor Egervári el combinado húngaro terminó tercero en la clasificación para la UEFA EURO 2012, sólo por detrás de Holanda y Suecia. El punto álgido llegó en el encuentro en casa ante Suecia, en el que un tanto de Gergely Rudolf en el 90' dio el triunfo a Hungría por 2-1. De hecho, esa victoria fue la primera del conjunto húngaro ante una selección que estaba por encima en el ránking mundial de la FIFA en el presente siglo. " 248 | 249 | }, 250 | { 251 | "flag": "IRL", 252 | "name": "República de Irlanda", 253 | "images": [ 254 | { 255 | "img_flag": "https://www.nationsonline.org/flags_big/Ireland_lgflag.gif", 256 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/IRL.jpg", 257 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/IRL.jpg", 258 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Comp_Matches/01/73/91/05/1739105_w1.jpg" 259 | } 260 | ], 261 | "team_declaimer": "Se clasificó para su primer torneo en 1988, comenzando su participación con una victoria por 1-0 frente a Inglaterra, pero no regresó a la fase final de la EURO hasta 2012, cuando perdió los tres partidos.", 262 | "best_result": "se de grupos (1988, 2012)", 263 | "coach": "Martin O'Neill", 264 | "leading_scorer": "histórico, Robbie Keane (67); actual, Robie Keane (67)", 265 | "nick_name": "los chicos de verde", 266 | "stadium": "Dublin Arena", 267 | "description_part_1": "Irlanda se clasificó para su primer gran torneo en 1988, empezando su campaña con una famosa victoria sobre Inglaterra aunque se quedó sin una plaza en las semifinales tras caer ante Holanda. El técnico inglés Jack Charlton llevó a Irlanda hasta dos Copas Mundiales de la FIFA, la primera de ellas en Italia donde llegó a los cuartos de final. En 2002 llegó su tercera participación en un Mundial pero el conjunto irlandés no volvió a participar en una Eurocopa hasta 2012, cuando el equipo de Giovanni Trapattoni perdió los tres encuentros de la fase de grupos. ", 268 | "matches_played": "J 127 G 51 E 37 P 39 GF 186 GC 147 ", 269 | "overall": "J 6 G 1 E 1 P 4 GF 3 GC 11", 270 | "final_tournament": "J 121 G 50 E 36 P 35 GF 183 GC 136", 271 | "description_part_2": "Irlanda se clasificó para su primer gran torneo en el Campeonato de Europa de la UEFA de 1988, empezando la campaña con su famosa victoria por 1-0 ante Inglaterra gracias a un remate de cabeza de Ray Houghton. Después de eso, el conjunto de Charlton empató ante la Unión Soviética y se quedó fuera de las semifinales tras caer ante Holanda.", 272 | "description_part_3": "En 1992, Irlanda se perdió la fase final de 1992 y perdió en los play-offs ante Holanda (1996) y Turquía (2000). En 2004 y 2008 terminó tercera en la fase de clasificación pero en 2012 logró el pase para la fase final, logrando una plaza después de ganar en los play-offs a Estonia. El conjunto de Trapattoni llegó a Polonia y Ucrania tras sumar 14 partidos invicto, pero en la fase de grupos cayó ante Croacia (3-1), España (4-0) e Italia (2-0). " 273 | 274 | }, 275 | { 276 | "flag": "ISL", 277 | "name": "Islandia", 278 | "images": [ 279 | { 280 | "img_flag": "https://www.nationsonline.org/flags_big/Iceland_lgflag.gif", 281 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/ISL.jpg", 282 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/ISL.jpg", 283 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Comp_Matches/01/69/41/08/1694108_w1.jpg" 284 | } 285 | ], 286 | "team_declaimer": "Aunque tarda en dejar su huella en la fase de clasificación para un Campeonato de Europa de la UEFA, es ahora una selección en crecimiento, construida sobre los cimientos del éxito reciente en categoría sub-21.", 287 | "best_result": "nunca se había clasificado previamente", 288 | "coach": "Lars Lagerbäck/Heimir Hallgrímsson ", 289 | "leading_scorer": "histórico, Eidur Gudjohnsen (25); actual, Eidur Gudjohnsen (25)", 290 | "nick_name": "Strákarnir okkar (Nuestros hijos)", 291 | "stadium": "Laugardalsvöllur, Reykjavik", 292 | "description_part_1": "Equipo en crecimiento basado en el talentoso equipo sub-21 que se clasificó para el Campeonato de Europa Sub-21 de la UEFA de 2011 en Dinamarca. Islandia hizo historia al llegar al play-off de la Copa Mundial de la FIFA de 2014. Liderado por el antiguo seleccionador sueco Lars Lagerbäck, acabó segundo en su grupo de la fase de clasificación, perdiendo su lugar en Brasil tras su derrota por un global de 2-0 ante Croacia. Fue un mejor participación en un gran torneo, mejorando su esfuerzo en el camino hacia la UEFA EURO 2000, cuando cayó en la última jornada por 3-2 ante Francia y perdió sus opciones. Pero se superó al ser la segunda selección clasificada en el Grupo A de la fase de clasificación a la UEFA EURO 2016 para llegar a su primer gran torneo.", 293 | "matches_played": "J 96 G 24 E 17 D 55 GF 81 GC 146", 294 | "overall": "J 0 G 0 E 0 P 0 GF 0 GC 0", 295 | "final_tournament": "J 96 G 24 E 17 P 55 GF 81 GC 146", 296 | "description_part_2": "Islandia se tomó con calma su camino hasta impresionar en la fase de clasificación del Campeonato de Europa de la UEFA, fallando en su intento de lograr una victoria en la fase de clasificación de 1964. Tras no entrar en 1968 y 1972, sólo ganó dos partidos en sus siguientes tres campañas, aunque logró un triunfo por 2-1 ante la República Democrática de Alemania en Reykjavik en 1975.", 297 | "description_part_3": "La historia reciente de Islandia suena mucho mejor. En el camino a la UEFA EURO 2000 logró cuatro victorias para obtener 15 puntos y acabar por detrás de Francia, Ucrania y Rusia. Cuatro años más tarde llegó más lejos y se quedó a un punto de disputar el play-off tras conseguir la mitad de triunfos en sus ocho encuentros. Acabó segundo por la cola en las fases de clasificación a la UEFA EURO 2008 y 2012." 298 | 299 | }, 300 | { 301 | "flag": "ITA", 302 | "name": "Italia", 303 | "images": [ 304 | { 305 | "img_flag": "https://www.nationsonline.org/flags_big/Italy_lgflag.gif", 306 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/ITA.jpg", 307 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/ITA.jpg", 308 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/EURO/66/51/02/665102_w1.jpg" 309 | } 310 | ], 311 | "team_declaimer": "El combinado europeo con más triunfos en la Copa Mundial de la FIFA, cuatro triunfos en 1934, 1938, 1982 y 2006, se ha coronado campeona de Europa en tan solo una ocasión.", 312 | "best_result": "Campeón (1968)", 313 | "coach": "Antonio Conte", 314 | "leading_scorer": "histórico, Luigi Riva (35); actual, Daniele De Rossi (17) ", 315 | "nick_name": "Azzurri (azules)", 316 | "stadium": "sin estadio fijo", 317 | "description_part_1": "Selección más laureada de Europa en la Copa Mundial de la FIFA con cuatro entorchados (1934, 1938, 1982 y 2006), Italia se ha coronado campeona de Europa en solo una ocasión, en el año 1968 cuando levantó la Copa Henri Delaunay tras la repetición de la final ante Yugoslavia en Roma.", 318 | "matches_played": "J 141 G 77 E 45 P 19 GF 220 GC 97", 319 | "overall": "J 33 G 13 E 15 P 5 GF 33 GC 25", 320 | "final_tournament": "J 108 G 64 E 30 P 14 GF 186 GC 6", 321 | "description_part_2": "El único éxito de Italia en el Campeonato de Europa de la UEFA llegó en Roma en 1968 bajó las órdenes de Ferrucio Valcareggi y con Dino Zoff en la portería. Yugoslavia cayó 2-0 en la repetición de la final dos días después del 1-1 del primer partido. Los azzurri estuvieron cerca de ganar su segundo título europeo en 2000, pero el gol del empate en el último suspiro de Sylvain Wiltord para Francia lo evitó y el posterior gol de oro de David Trezeguet en la prórroga acabó con los sueños transalpinos.", 322 | "description_part_3": "En 2012 el revés se repitió, pero esta vez la final se resolvió con un 4-0 en contra ante España (goleada más amplia en una final de la EURO hasta la fecha). Semifinalista en 1980 y 1988, Italia se ha clasificado para todos los torneos desde 1992, cuando se quedó fuera al perder en la clasificación de la Comunidad de Estados Independientes." 323 | 324 | }, 325 | { 326 | "flag": "NIR", 327 | "name": "Irlanda del Norte", 328 | "images": [ 329 | { 330 | "img_flag": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/Flag_of_Northern_Ireland.svg/300px-Flag_of_Northern_Ireland.svg.png", 331 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/NIR.jpg", 332 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/NIR.jpg", 333 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/EURO/67/61/33/676133_w1.jpg" 334 | } 335 | ], 336 | "team_declaimer": "La selección británica nunca había jugado un Campeonato de Europa de la UEFA, pero ahora, tras una brillante clasificación para la UEFA EURO 2016 dentro del Grupo F, tendrá la oportunidad de jugarlo.", 337 | "best_result": "nunca se había clasificado previamente", 338 | "coach": "Michael O'Neill", 339 | "leading_scorer": "histórico, David Healy (36); actual, Kyle Lafferty (16)", 340 | "nick_name": "Norn Iron (Irlanda del Norte)", 341 | "stadium": "Windsor Park, Belfast", 342 | "description_part_1": "A pesar de haber logrado algunas victorias memorables, Irlanda del Norte nunca había conseguido clasificarse para una fase final de un Campeonato de Europa, siendo la edición de 1984 la que más cerca estuvo de lograrlo cuando ganó a la entonces campeona, la República Federal de Alemania, tanto en casa como a domicilio. Por el contrario, Irlanda del Norte ha participado en tres Copas Mundiales de la FIFA, la primera vez en 1958, cuando alcanzó los cuartos, y la segunda en 1982, venciendo por 1-0 a la anfitriona España. De la misma forma que el máximo goleador de todos los tiempos David Healy, el gran George Best nunca disputó un gran torneo. Pero ahora, bajo el mando de Michael O'Neill, otros jugadores tendrán la oportunidad de brillar en Francia.", 343 | "matches_played": "J 110 G 40 E 25 P 45 GF 120 GC 138", 344 | "overall": "J 0 G 0 E 0 P 0 GF 0 GC 0", 345 | "final_tournament": "J 110 G 40 E 25 P 45 GF 120 GC 138", 346 | "description_part_2": "La primera participación de Irlanda del Norte fue durante la ronda preliminar del Campeonato de Europa de la UEFA de 1964, donde ganó a Polonia por un global de 4-0, pero después cayó ante una España que acabaría ganando el torneo. El equipo de Billy Bingham se impuso a la República Federal de Alemania en Belfast y en Hamburgo pero no logró la clasificación tras tener perdida la diferencia de goles con los germanos.", 347 | "description_part_3": "Los aficionados se ilusionaron de nuevo durante la fase de clasificación de la UEFA EURO 2008, cuando la magnífica racha goleadora de David Healy ayudó a la selección a lograr memorables victorias en casa ante la posterior campeona España (3-2), Suecia (2-1) y Dinamarca (2-1), aunque Irlanda del Norte finalmente solo pudo ser tercera. Bajo las órdenes de Nigel Worthington comenzó la fase de clasificación para la UEFA EURO 2012 de forma brillante, logrando un triunfo por 0-1 en Eslovenia y un empate 0-0 ante la finalmente campeona del grupo, Italia. Esos resultados elevaron las expectativas, pero la campaña terminó en decepción. Un frustrante empate 1-1 ante las Islas Feroe y una derrota por 4-1 ante Estonia en Tallin hicieron demasiado daño a las opciones del equipo." 348 | 349 | }, 350 | { 351 | "flag": "POL", 352 | "name": "Polonia", 353 | "images": [ 354 | { 355 | "img_flag": "https://www.nationsonline.org/flags_big/Poland_lgflag.gif", 356 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/POL.jpg", 357 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/POL.jpg", 358 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Comp_Matches/01/81/74/69/1817469_w1.jpg" 359 | } 360 | ], 361 | "team_declaimer": "Finalmente se clasificó para una primera fase final del Campeonato de Europa de la UEFA en 2008 y fue co-anfitriona cuatro años después, terminando último de su grupo en las dos ocasiones.", 362 | "best_result": "fase de grupos en 2008 y 2012", 363 | "coach": "Adam Nawałka", 364 | "leading_scorer": "histórico - Włodzimierz Lubański (48); actual - Robert Lewandowski (34)", 365 | "nick_name": "biało-czerwoni (blancos y rojos)", 366 | "stadium": "Estadio Nacional, Varsovia", 367 | "description_part_1": "Antes de que Polonia se clasificara para su primera fase final de un Campeonato de Europa de la UEFA, en 2008, el conjunto biało-czerwoni estuvo presente en siete Copas Mundiales de la FIFA. Como co-anfitriona de la UEFA EURO 2012, Polonia no pudo superar la fase de grupos después de no ganar ningún encuentro. La historia fue algo distinta en la década de los 70 y los 80, cuando con jugadores de talla mundial como los delanteros Grzegorz Lato y Zbigniew Boniek, Polonia alcanzó cuatro fases finales de un Mundial de forma consecutiva, logrando el bronce en la República Federal de Alemania (1974) y en España (1982). Liderada por un gran goleador como Robert Lewandowski, Polonia logró el pase para la fase final de la UEFA EURO 2016. Su atacante igualó el récord de goles en esta ronda al marcar 13 goles.", 368 | "matches_played": "J 106 G 44 E 30 P 32 GF 167 GC 117", 369 | "overall": "J 6 G 0 E 3 P 3 GF 3 GC 7", 370 | "final_tournament": "J 100 G 44 E 27 P 29 GF 164 GC 110", 371 | "description_part_2": "Polonia tuvo que esperar hasta 2008 para alcanzar la fase final del Campeonato de Europa de la UEFA, a la 13ª vez, después de liderar un grupo de clasificación en el que estaban Portugal, Serbia y Bélgica. El combinado de Leo Beenhakker no brilló mucho en Austria y Suiza ya que terminó con un punto y un solo gol marcado, obra de Roger Guerreiro.", 372 | "description_part_3": "Polonia mejoró como co-anfitriona de la UEFA EURO 2012, pero no pudo pasar de la fase de grupos, y después de firmar el segundo puesto en la fase de clasificación de la UEFA EURO 2016 por detrás de Alemania espera hacerlo mejor en Francia. Antes de 2008, lo más cerca que habían estado los polacos de la clasificación fue en 1976 y 1980. En 1976 cayó por la diferencia de los goles marcados a domicilio ante una Holanda que se cruzó en su camino cuatro años después, al remontar un 2-0 en contra y derrotar a República Democrática de Alemania para superar por un punto a Polonia." 373 | 374 | }, 375 | { 376 | "flag": "POR", 377 | "name": "Portugal", 378 | "images": [ 379 | { 380 | "img_flag": "https://www.nationsonline.org/flags_big/Portugal_lgflag.gif", 381 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/POR.jpg", 382 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/POR.jpg", 383 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Comp_Matches/01/74/50/75/1745075_w1.jpg" 384 | } 385 | ], 386 | "team_declaimer": "Tiene el honor no deseado de ser el único equipo en perder una final de la EURO en su propio terreno, pero tiene un registro reciente consistente y a Cristiano Ronaldo a su disposición.", 387 | "best_result": "finalista (2004)", 388 | "coach": "Fernando Santos", 389 | "leading_scorer": "histórico, Cristiano Ronaldo (55); actual, Cristiano Ronaldo (55)", 390 | "nick_name": "Selecção das Quinas (Equipo de los Escudos)", 391 | "stadium": "varias", 392 | "description_part_1": "Portugal logró superar la barrera de semifinales en un Campeonato de Europa de la UEFA cuando acogió el evento en 2004 y disputó la final en Lisboa, donde cayó ante Grecia, convirtiéndose en el único país en perder una final como anfitrión. Desde entonces, con Cristiano Ronaldo como gran protagonista, el conjunto luso ha alcanzado dos semifinales, en la Copa Mundial de la FIFA de 2006 y en la UEFA EURO 2012, perdiendo la última de ellas en la tanda de penaltis frente a España. Portugal lleva clasificándose para todos los campeonatos desde el cambio de siglo, y ahora lo ha conseguido tras liderar un grupo en que comenzó con problemas pero al final logró clasificarse para la fase final de la UEFA EURO 2016.", 393 | "matches_played": "J 135 G 76 E 29 P 30 GF 234 GC 127", 394 | "overall": "J 28 G 15 E 5 P 8 GF 40 GC 26", 395 | "final_tournament": "J 107 G 61 E 24 P 22 GF 194 GC 101", 396 | "description_part_2": "Portugal hizo su debut en una fase final de un Campeonato de Europa de la UEFA en 1984 y estuvo a seis minutos de dar la sorpresa. Con ventaja en la prórroga frente a la anfitriona Francia, Jean-François Domergue empató antes de que Michel Platini diese el triunfo a los galos en el minuto 119. Después se clasificó para el torneo en 1996 y es una de las siete selecciones que ha participado en las últimas cinco fases finales junto a España, Alemania, Italia, Holanda y República Checa.", 397 | "description_part_3": "Portugal nunca ha caído en la fase de grupos, perdiendo en semifinales en las ediciones de 1984 y 2000 ante una Francia que luego sería campeona, y con España en 2012, que también terminó venciendo. Lo hicieron mejor en su propio terreno en la UEFA EURO 2004, donde cayeron por 0-1 frente a Grecia, al igual que en el partido inaugural, en la final de Lisboa." 398 | 399 | }, 400 | { 401 | "flag": "ROU", 402 | "name": "Rumanía", 403 | "images": [ 404 | { 405 | "img_flag": "https://www.nationsonline.org/flags_big/Romania_lgflag.gif", 406 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/ROU.jpg", 407 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/ROU.jpg", 408 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Comp_Matches/01/82/61/44/1826144_w1.jpg" 409 | } 410 | ], 411 | "team_declaimer": "Uno de los cuatro países que participaron en cada una de las primeras tres Copas Mundiales de la FIFA, el mayor logro de Rumania en una EURO llegó en 2000, cuando alcanzó los cuartos de final.", 412 | "best_result": "cuartos de final (2000)", 413 | "coach": "Anghel Iordănescu", 414 | "leading_scorer": "histórico, Gheorghe Hagi y Adrian Mutu (35); actual, Ciprian Marica (25)", 415 | "nick_name": "ricolorii (la Tricolor)", 416 | "stadium": "Arena Națională, Bucarest", 417 | "description_part_1": "Rumanía, una de las cuatro selecciones en participar en las tres primeras Copas Mundiales de la FIFA, disfrutó de su mejor momento en el torneo de 1994 en Estados Unidos. Allí, con un Gheorghe Hagi en un gran estado de forma, alcanzó los cuartos de final, donde perdió ante Suecia en los penaltis.", 418 | "matches_played": "J 128 G 60 E 39 P 29 GF 216 GC 118", 419 | "overall": "J 13 G 1 E 4 P 8 GF 8 GC 17", 420 | "final_tournament": "J 115 G 59 E 35 P 21 GF 208 GC 101", 421 | "description_part_2": "Después de sufrir generalmente duros sorteos cuando ha alcanzado la fase final, el éxito de Rumanía en la EURO ha sido limitado aunque Emeric Ienei guió al equipo a los cuartos de final en la UEFA EURO 2000 en un grupo que contenía a Alemania, Portugal e Inglaterra. Este hito estuvo a punto de ser repetido ocho años después. Empató ante los dos finalistas del Mundial de 2006, Francia e Italia, ante estos últimos fallando Adrian Mutu un penalti en los últimos compases, y Rumanía cayó por 2-0 en la última jornada ante Holanda para caer eliminada.", 422 | "description_part_3": "Un flojo arranque le impidió estar en la UEFA EURO 2012. Los empates ante Albania y Bielorrusia precedieron a su derrota por 2-0 ante Francia. Tras seis partidos Răzvan Lucescu fue relevado por Piţurcă en su tercera etapa al frente de la selección. Tres empates y una victoria en los últimos cuatro choques le dieron la tercera plaza en su grupo y una esperanza para el futuro." 423 | 424 | }, 425 | { 426 | "flag": "RUS", 427 | "name": "Rusia", 428 | "images": [ 429 | { 430 | "img_flag": "https://www.nationsonline.org/flags_big/Russia_lgflag.gif", 431 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/RUS.jpg", 432 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/RUS.jpg", 433 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/EURO/66/50/99/665099_w1.jpg" 434 | } 435 | ], 436 | "team_declaimer": "Desde la desintegración de la Unión Soviética, campeón del inaugural Campeonato de Europa de la UEFA, en 1960, y subcampeón en 1964, 1972 y 1988, se ha mostrado regular en las fases de clasificación.", 437 | "best_result": "Campeón en 1960 (como la Unión Soviética) ", 438 | "coach": "Leonid Slutski", 439 | "leading_scorer": "histórico, Oleh Blokhin (42 con la Unión Soviética); actual, Aleksandr Kerzhakov (30) ", 440 | "nick_name": "ninguno", 441 | "stadium": "sin estadio fijo", 442 | "description_part_1": "Desde la disolución de la Unión Soviética (campeona de la edición inaugural del Campeonato de Europa de la UEFA en 1960 y subcampeona en 1964, 1972 y 1988), Rusia ha sido una habitual en las fases finales cada cuatro años, aunque solo ha superado una vez la fase de grupos. Eso fue en 2008, cuando el holandés Guus Hiddink llevó a una vistosa selección hasta las semifinales. En la época post-soviética Rusia se ha clasificado para las Copas Mundiales de la FIFA de 1994 y 2002, y también para Brasil 2014. La fase de clasificación para la UEFA EURO 2016 la logró siendo subcampeón dentro del Grupo G bajó el mando del nuevo seleccionador Leonid Slutski, que a mitad de dicha clasificación sustituyó a Fabio Capello. Logró ganar Rusia con Slutski los últimos cuatro partidos.", 443 | "matches_played": "J 150 G 85 E 35 P 30 GF 271 GC 125", 444 | "overall": "J 30 G 12 E 6 P 12 GF 36 GC 39", 445 | "final_tournament": "J 120 G 73 E 29 P 18 GF 235 GC 86", 446 | "description_part_2": "Como parte de la URSS, Rusia ayudó a ganar el primer torneo celebrado en 1960. Aquella selección tenía al portero del FC Dinamo Moskva Lev Yashin y al jugador del FC Spartak Moskva Igor Netto, que marcó a Yugoslavia en la final que se ganó por 2-1. El delantero Viktor Ponedelnik hizo el gol de la victoria en la prórroga de la final. La Unión Soviética fue subcampeona en España en 1964, perdió la final de 1972 ante la República Federal de Alemania y sufrió una nueva derrota en 1988 ante Holanda (2-0) con un combinado con marcado acento ucraniano.", 447 | "description_part_3": "Desde que jugó bajo la bandera de la CEI en 1992, Rusia no ha podido emular glorias pasadas. Solo ganó un partido en nueve choques de fases finales en 1992, 1996 y 2004, y en 2000 no logró ni clasificarse. En Austria y Suiza mostró su mejor cara y llegó hasta semifinales. En la UEFA EURO 2012 volvió a caer en la fase de grupos tras ganar en su primer partido por 4-1 ante la República Checa y empatar a uno con la co-anfitriona Polonia. A continuación perdió por 1-0 ante Grecia cuando un punto le valía para superar el grupo." 448 | 449 | }, 450 | { 451 | "flag": "SUI", 452 | "name": "Suiza", 453 | "images": [ 454 | { 455 | "img_flag": "https://www.nationsonline.org/flags_big/Switzerland_lgflag.gif", 456 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/SUI.jpg", 457 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/SUI.jpg", 458 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Comp_Matches/01/83/47/62/1834762_w1.jpg" 459 | } 460 | ], 461 | "team_declaimer": "El país que alberga la sede de la FIFA y de la UEFA, ha luchado desde entonces hasta llegar a la Copa Mundial de la FIFA 1994, la primera en 28 años.", 462 | "best_result": "fase de grupos (1996, 2004, 2008)", 463 | "coach": "Vladimir Petković", 464 | "leading_scorer": "histórico, Alexander Frei (42); actual, Tranquillo Barnetta (10); actual, Xherdan Shaqiri (17) ", 465 | "nick_name": "Schweizer Nati/Nati Suisse (selección suiza)", 466 | "stadium": "Stade de Suisse, Berna; St. Jakob-Park, Basilea", 467 | "description_part_1": "Suiza, país en el que se hayan las sedes de la FIFA y la UEFA, encadenó tres participaciones consecutivas en fases finales con la disputa de la Copa Mundial de la FIFA en Brasil en 2014. El equipo de Ottmar Hitzfeld encabezó su grupo de clasificación sin problemas, ganando siete partidos y empatando tres de sus diez encuentros. Mientras, en el camino hacia la fase final de la UEFA EURO 2016, tuvo que pelear mucho más, ya que sufrió tres derrotas pero finalmente logró ser subcampeón del Grupo E por detrás de Inglaterra. Las tres participaciones de los suizos en Campeonatos de Europa de la UEFA acabaron con eliminación en la fase de grupos, incluyendo la de 2008 en la que fueron co-anfitriones junto a Austria.", 468 | "matches_played": "J 101 G 40 E 24 P 37 GF 158 GC 129", 469 | "overall": "J 9 G 1 E 2 P 6 GF 5 GC 13", 470 | "final_tournament": "J 92 G 39 E 22 P 31 GF 153 GC 116", 471 | "description_part_2": "Durante años, Suiza sufrió dolorosas derrotas que se prolongaron hasta el nombramiento de Roy Hodgson, logrando el inglés un cambio en la suerte de los helvéticos. Tras la clasificación para el Mundial de 1994, la primera en 28 años, Hodgson guió al equipo en la EURO ’96 tras encabezar un grupo de clasificación con Turquía y Suecia, aunque Artur Jorge tomó el cargo para la fase final del torneo. Arrancó la fase final empatando a uno contra Inglaterra antes de que las derrotas ante Holanda y Escocia la dejaran fuera del torneo.", 472 | "description_part_3": "Suiza volvió a conseguir un puesto en la fase final de 2004 bajo el mando de Jakob 'Köbi' Kuhn, pero solo sacó un punto en el torneo en el que Johan Vonlanthen se convirtió en el hombre más joven en marcar en el Campeonato de Europa de la UEFA al anotar en la derrota por 3-1 ante Francia. Luego fueron co-anfitriones del torneo junto a Austria en 2008, pero no lograron sacar partido de la ventaja de jugar en casa. Perdieron ante la República Checa y ante Turquía antes de ganar a Portugal por 2-0. Las derrotas contra Inglaterra y Montenegro, y una campaña en la que solo consiguió dos puntos a domicilio, le hicieron perderse la UEFA EURO 2012 al terminar tercera en el Grupo B. " 473 | 474 | }, 475 | { 476 | "flag": "SVK", 477 | "name": "Eslovaquia", 478 | "images": [ 479 | { 480 | "img_flag": "https://www.nationsonline.org/flags_big/Slovakia_lgflag.gif", 481 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/SVK.jpg", 482 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/SVK.jpg", 483 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Comp_Matches/01/50/12/16/1501216_w1.jpg" 484 | } 485 | ], 486 | "team_declaimer": "Parte integral de la Checoslovaquia que inició la final del Campeonato de Europa de la UEFA de 1976 ante la República Federal de Alemania, su única fase final como país independiente se produjo en 2002.", 487 | "best_result": "nunca se había clasificado anteriormente", 488 | "coach": "Ján Kozák", 489 | "leading_scorer": "histórico – Róbert Vittek (23); actual – Róbert Vittek (23)", 490 | "nick_name": "ninguna", 491 | "stadium": "varias", 492 | "description_part_1": "Ocho de los once jugadores de la selección de Checoslovaquia que formaron el once titular de la final del Campeonato de Europa de la UEFA de 1976 ante la República Federal de Alemania procedían de Eslovaquia. Esa selección de Checoslovaquia se llevó el título en los penaltis después de un empate 2-2 en el tiempo reglamentario, pero tardó en competir como estados independiente. Sin embargo, la gloria llegó con la clasificación para la Copa Mundial de la FIFA 2010. La selección no solo lideró su grupo de clasificación, sino que también sorprendió a la vigente campeona Italia, ganándole por 3-2 en la fase final de Sudáfrica. Tras ello, Eslovaquia se clasificó para la UEFA EURO 2016 en Francia bajo el mando del seleccionador Ján Kozák después de enlazar siete victorias seguidas al inicio de la ronda de la fase de grupos.", 493 | "matches_played": "J 124 G 62 E 26 P 36 GF 213 GC 135", 494 | "overall": "J 8 G 3 E 3 P 2 GF 12 GC 10", 495 | "final_tournament": "J 116 G 59 E 23 P 34 GF 201 GC 125", 496 | "description_part_2": "Eslovaquia acabó tercera en su grupo de clasificación en sus tres primeros intentos de clasificarse para el Campeonato de Europa de la UEFA. Su pase a la fase final se complicó con las derrotas en casa ante Rumanía (en dos ocasiones), Portugal, Inglaterra y Turquía. Esa mala racha de derrotas en casa continuó en la fase de clasificación para la UEFA EURO 2008, cuando sufrió duras goleadas ante la República Checa (0-3), Alemania (1-4) y Gales (2-5).", 497 | "description_part_3": "La selección de Weiss afrontó con confianza la fase de clasificación para la UEFA EURO 2012, ya que logró sendas victorias por la mínima ante la Antigua República Yugoslava de Macedonia y Rusia. Sin embargo, Eslovaquia no consiguió marcar más de un gol en ninguno de sus diez partidos, y su dura derrota por 0-4 ante Armenia complicó una fase de clasificación que acabó de forma decepcionante. El éxito, sin embargo, volvió cuatro años después, cuando derrotó en casa a la vigente campeona España." 498 | 499 | }, 500 | { 501 | "flag": "SWE", 502 | "name": "Suecia", 503 | "images": [ 504 | { 505 | "img_flag": "https://www.nationsonline.org/flags_big/Sweden_lgflag.gif", 506 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/SWE.jpg", 507 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/SWE.jpg", 508 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Comp_Matches/01/72/54/21/1725421_w1.jpg" 509 | } 510 | ], 511 | "team_declaimer": "La única nación anfitriona de la Copa Mundial de la FIFA que ha sido derrotada en la final, nunca ha igualado su racha de 1958, pero llegó a semifinales en el único torneo que organizó, la EURO '92.", 512 | "best_result": "semifinales en 1992", 513 | "coach": "Erik Hamrén", 514 | "leading_scorer": "histórico - Zlatan Ibrahimović (62); actual - Zlatan Ibrahimović (62)", 515 | "nick_name": "Blågult (azules y amarillos)", 516 | "stadium": "Friends Arena, Solna", 517 | "description_part_1": "Suecia, la única selección anfitriona en una Copa Mundial que perdió en la final, nunca ha igualado la gesta de 1958, pero alcanzó las semifinales en el otro gran torneo que acogió, la EURO ’92. Fue la primera vez que llegaban a esa ronda en la competición continental. Dos años después consiguió el bronce en la Copa Mundial de la FIFA 1994, y aunque no se ha clasificado para los dos posteriores mundiales, ha estado en los últimos cinco Campeonatos de Europa de la UEFA, en buena parte gracias a los goles de Zlatan Ibrahimović.", 518 | "matches_played": "J 121 G 59 E 29 P 32 GF 198 GC 126", 519 | "overall": "J 17 G 5 E 5 P 7 GF 24 GC 21", 520 | "final_tournament": "J 104 G 54 E 24 P 26 GF 174 GC 105", 521 | "description_part_2": "Suecia llegó a semifinales jugando en casa en 1992 tras derrotar a Inglaterra y Dinamarca y empatar en el primer partido ante Francia. Sin embargo, con Stefan Schwarz sancionado y Jonas Thern jugando lesionado no pudo con Alemania y cayó en semifinales por 3-2.", 522 | "description_part_3": "No fue hasta 2000 cuando volvió a superar la ronda de clasificación para llegar a la fase final del torneo, una fase final en la que desde entonces ha estado siempre. Suecia acabó la UEFA EURO 2004 invicta, ya que cayó por 5-4 en la tanda de penaltis ante Holanda en cuartos de final después de empatar a cero. Sus dos últimas participaciones acabaron en la fase de grupos, donde dos derrotas y una victoria no fueron suficientes para pasar en ninguno de los dos casos. En 2012 perdió ante Ucrania e Inglaterra a pesar de ir ganando en ambos partidos, y ya estaba eliminada cuando Zlatan marcó un tanto espectacular en la victoria por 2-0 ante Francia en el último encuentro." 523 | 524 | }, 525 | { 526 | "flag": "TUR", 527 | "name": "Turquía", 528 | "images": [ 529 | { 530 | "img_flag": "https://www.nationsonline.org/flags_big/Turkey_lgflag.gif", 531 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/TUR.jpg", 532 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/TUR.jpg", 533 | "img_detail": "empty" 534 | } 535 | ], 536 | "team_declaimer": "Desde que alcanzó su primera final en un torneo en la EURO '96, ha ido viento en popa, logrando la clasificación para otras tres EUROs y para la Copa Mundial de la FIFA 2002.", 537 | "best_result": "semifinales (2008) ", 538 | "coach": "Fatih Terim", 539 | "leading_scorer": "histórico, Hakan Şükür (51); actual, Burak Yılmaz (19)", 540 | "nick_name": "Ay-Yıldızlılar (las estrellas emergentes) ", 541 | "stadium": "sin estadio fijo", 542 | "description_part_1": "La cota más alta alcanzada por Turquía llegó en la Copa Mundial de la FIFA de 2002, cuando el equipo de Şenol Güneş desafió todos los pronósticos quedando tercero. Era su segunda participación en un Mundial y desde entonces no ha vuelto. A Turquía le hicieron falta diez intentonas para clasificarse para su primera fase final del Campeonato de Europa de la UEFA, y tras perder los tres partidos en la EURO ’96, alcanzó los cuartos de final en la UEFA EURO 2000 bajo el mandato de Mustafa Denizli. En Austria y Suiza ocho años después fue un paso más allá, y tras una tanda de penaltis dramática ante Croacia, se metió en semifinales. En esa ronda cayó por 3-2 ante Alemania. Tras no estar en Polonia/Ucrania, vuelve a la fase final de la UEFA EURO 2016 después de clasificarse como el mejor tercero entre los nueve grupos de la fase de clasificación.", 543 | "matches_played": "J 122 G 47 E 29 P 46 GF 145 GC 167 ", 544 | "overall": "J 12 G 3 E 2 P 7 GF 11 GC 18 ", 545 | "final_tournament": "J 110 G 44 E 27 P 39 GF 134 GC 149", 546 | "description_part_2": "Tras no ganar ningún partido en la fase de clasificación, Turquía acabó llegando a su primera fase final en la EURO ’96, pero los hombres de Terim no sumaron ningún punto en Inglaterra. Mejoró en 2000, superando la fase de grupos antes de perder 2-0 en cuartos de final ante Portugal. Una derrota en el play-off ante Letonia dejó a la Turquía de Güneş sin la UEFA EURO 2004, pero Terim volvió al mando y el combinado otomano brilló en la UEFA EURO 2008. Las victorias en el último suspiro ante Suiza, la República Checa y Croacia les metieron en semifinales y allí se enfrentaron a Alemania.", 547 | "description_part_3": "A pesar del gran comienzo en un complicado Grupo A de clasificación para la UEFA EURO 2012, las derrotas ante Alemania y, más sorprendentemente ante Azerbaiyán, dejaron al equipo de Guus Hiddink tocado. Turquía se recuperó y acabó siendo segunda por delante de Bélgica, pero Croacia fue demasiado fuerte en el play-off y su victoria por 0-3 en Estambul fue decisiva." 548 | 549 | }, 550 | { 551 | "flag": "UKR", 552 | "name": "Ucrania", 553 | "images": [ 554 | { 555 | "img_flag": "https://www.nationsonline.org/flags_big/Ukraine_lgflag.gif", 556 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/UKR.jpg", 557 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/UKR.jpg", 558 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/Comp_Matches/01/81/59/53/1815953_w1.jpg" 559 | } 560 | ], 561 | "team_declaimer": "Fue un recurso prolífico para la Unión Soviética en el pasado y tuvo que esperar hasta que su papel como co-anfitriona de la UEFA EURO 2012 para su primera fase final como nación independiente.", 562 | "best_result": "fase de grupos (2012)", 563 | "coach": "Mykhailo Fomenko", 564 | "leading_scorer": "histórico, Andriy Shevchenko (48); actual, Andriy Yarmolenko (22)", 565 | "nick_name": "Synyo-Zhovti (azul y amarillos) ", 566 | "stadium": "NSK Olimpiyskyi, Kiev", 567 | "description_part_1": "Ucrania cedió varios jugadores a la Unión Soviética para participar en pasadas Copas Mundiales de la FIFA y el Campeonato de Europa de la UEFA, principalmente a finales de la década de los 80, con Valeriy Lobanovskiy como seleccionador. Desde la independencia el país ha luchado por entrar en los grandes torneos, pero sólo lo logró una vez.", 568 | "matches_played": "J 57 G 24 E 15 P 18 GF 75 GC 57 ", 569 | "overall": "J 3 G 1 E 0 P 2 GF 2 GC 4 ", 570 | "final_tournament": "J 54 G 23 E 15 P 16 GF 73 GC 53", 571 | "description_part_2": "Ucrania fue una gran fuente de jugadores para la Unión Soviética que ganó la edición inaugural del Campeonato de Europa de la UEFA de 1960 y que fue subcampeona en tres ocasiones: perdiendo ante España (1964), frente a la República Federal de Alemania (1972) y ante Holanda (1988). Ucrania nunca había logrado el pase para una fase final como país independiente pero estuvo a doce minutos de conseguir estar en la UEFA EURO 2000. Sin lograr el pase de forma automática tras empatar en la última jornada de la fase de clasificación ante Rusia, Ucrania estuvo cerca de lograrlo en los play-offs ante Eslovenia pero un gol de Miran Pavlin dio el pase al conjunto eslovaco por un resultado global de 3-2.", 572 | "description_part_3": "Tuvo que esperar hasta 2012 para su primera participación, siendo co-anfitriona junto a Polonia. El combinado de Blokhin tuvo un debut soñado, y dos tantos de un rejuvenecido Shevchenko dieron la vuelta al tanto inicial de Suecia para poner el definitivo 2-1 en el marcador del NSK Olimpiyskyi de Kiev. Luego cayó 2-0 ante Francia y 1-0 ante Inglaterra para quedar eliminados." 573 | 574 | }, 575 | { 576 | "flag": "WAL", 577 | "name": "Gales", 578 | "images": [ 579 | { 580 | "img_flag": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/59/Flag_of_Wales_2.svg/400px-Flag_of_Wales_2.svg.png", 581 | "img_profile": "https://img.uefa.com/imgml/2016/euro/teams/profile/S/WAL.jpg", 582 | "img_header": "https://img.uefa.com/imgml/2016/euro/teams/header/m/WAL.jpg", 583 | "img_detail": "https://img.uefa.com/MultimediaFiles/Photo/competitions/General/01/90/99/05/1909905_w1.jpg" 584 | } 585 | ], 586 | "team_declaimer": "Tras más de medio siglo desde su última participación en un gran torneo, el combinado de Gareth Bale ha protagonizado una exitosa campaña de clasificación para la UEFA EURO 2016.", 587 | "best_result": "nunca se ha clasificado", 588 | "coach": "Chris Coleman", 589 | "leading_scorer": "histórico, Ian Rush (28); actual, Gareth Bale (19)", 590 | "nick_name": "dreigiau (dragones)", 591 | "stadium": "Cardiff City Stadium, Millennium Stadium, Cardiff", 592 | "description_part_1": "Ha pasado más de medio siglo desde que Gales participó en su último gran torneo, la Copa Mundial de la FIFA de 1958 celebrada en Suecia, en la que un equipo con un inspirado John Charles llegó a los cuartos de final. En 1976, el combinado galés alcanzó los cuartos de final en el Campeonato de Europa de la UEFA pero perdió en la eliminatoria a doble partido frente a Yugoslavia y se quedó fuera de la fase final de cuatro equipos. Desde entonces han surgido jugadores de primer nivel, como Ian Rush o Ryan Giggs, pero Gales nunca había logrado estar entre las grandes selecciones del continente y ahora, con Gareth Bale al frente, el combinado estará en la UEFA EURO 2016 y pondrá fin a 58 años de espera.", 593 | "matches_played": "J 104 G 41 E 21 P 42 GF 125 GC 133", 594 | "overall": "J 0 G 0 E 0 P 0 GF 0 GC 0", 595 | "final_tournament": "J 104 G 41 E 21 P 42 GF 125 GC 133", 596 | "description_part_2": "Yugoslavia fue siempre la 'bestia negra' de Gales en los Campeonatos de Europa de la UEFA, negándole una plaza en la fase final de cuatro equipos del torneo de 1976 y dejando a los dragones fuera de la fase final de 1984. Una victoria en el último partido en casa le hubiese dado el pase, pero el empate de Mehmed Baždarević en el minuto 81 dio a los visitantes una plaza en la fase final.", 597 | "description_part_3": "No fue hasta la UEFA EURO 2004 cuando Gales estuvo otra vez cerca. El play-off ante Rusia fue esquivo tras empatar 0-0 en Moscú y caer 0-1 en casa. La fase de clasificación de la UEFA EURO 2012 resultó ser una campaña más problemática, con los resultados prometedores en el terreno de juego ensombrecidos por la muerte del seleccionador Gary Speed en noviembre de 2011." 598 | 599 | } 600 | ] -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/EuroApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture; 18 | 19 | import android.app.Application; 20 | import io.github.erikjhordanrey.cleanarchitecture.di.components.DaggerMainComponent; 21 | import io.github.erikjhordanrey.cleanarchitecture.di.components.MainComponent; 22 | import io.github.erikjhordanrey.cleanarchitecture.di.modules.MainModule; 23 | 24 | public class EuroApplication extends Application { 25 | 26 | private MainComponent mainComponent; 27 | 28 | @Override public void onCreate() { 29 | super.onCreate(); 30 | initializeInjector(); 31 | } 32 | 33 | private void initializeInjector() { 34 | mainComponent = DaggerMainComponent.builder().mainModule(new MainModule(this)).build(); 35 | } 36 | 37 | public MainComponent getMainComponent() { 38 | return mainComponent; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/core/mapper/Mapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 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 io.github.erikjhordanrey.cleanarchitecture.core.mapper; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | public abstract class Mapper { 23 | 24 | public abstract T2 map(T1 value); 25 | 26 | public abstract T1 reverseMap(T2 value); 27 | 28 | public List map(List values) { 29 | List returnValues = new ArrayList<>(values.size()); 30 | for (T1 value : values) { 31 | returnValues.add(map(value)); 32 | } 33 | return returnValues; 34 | } 35 | 36 | public List reverseMap(List values) { 37 | List returnValues = new ArrayList<>(values.size()); 38 | for (T2 value : values) { 39 | returnValues.add(reverseMap(value)); 40 | } 41 | return returnValues; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/core/presenter/Presenter.java: -------------------------------------------------------------------------------- 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 io.github.erikjhordanrey.cleanarchitecture.core.presenter; 18 | 19 | public class Presenter { 20 | 21 | private T view; 22 | 23 | public T getView() { 24 | return view; 25 | } 26 | 27 | public void setView(T view) { 28 | this.view = view; 29 | } 30 | 31 | public void initialize() { 32 | 33 | } 34 | 35 | public interface View { 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/data/entity/ImageEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.data.entity; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | 21 | public class ImageEntity { 22 | 23 | @SerializedName("img_flag") private String imageFlag; 24 | @SerializedName("img_profile") private String imageProfile; 25 | @SerializedName("img_header") private String imageHeader; 26 | @SerializedName("img_detail") private String imageDetail; 27 | 28 | public String getImageFlag() { 29 | return imageFlag; 30 | } 31 | 32 | public void setImageFlag(String imageFlag) { 33 | this.imageFlag = imageFlag; 34 | } 35 | 36 | public String getImageProfile() { 37 | return imageProfile; 38 | } 39 | 40 | public void setImageProfile(String imageProfile) { 41 | this.imageProfile = imageProfile; 42 | } 43 | 44 | public String getImageHeader() { 45 | return imageHeader; 46 | } 47 | 48 | public void setImageHeader(String imageHeader) { 49 | this.imageHeader = imageHeader; 50 | } 51 | 52 | public String getImageDetail() { 53 | return imageDetail; 54 | } 55 | 56 | public void setImageDetail(String imageDetail) { 57 | this.imageDetail = imageDetail; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/data/entity/TeamEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.data.entity; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | import java.util.List; 21 | 22 | public class TeamEntity { 23 | 24 | @SerializedName("flag") private String teamFlag; 25 | @SerializedName("name") private String teamName; 26 | @SerializedName("images") private List images; 27 | @SerializedName("team_declaimer") private String disclaimer; 28 | @SerializedName("best_result") private String bestResult; 29 | @SerializedName("coach") private String coach; 30 | @SerializedName("leading_scorer") private String leadingScorer; 31 | @SerializedName("nick_name") private String nickName; 32 | @SerializedName("stadium") private String stadium; 33 | @SerializedName("description_part_1") private String firstDescription; 34 | @SerializedName("matches_played") private String matchesPlayed; 35 | @SerializedName("overall") private String teamOverall; 36 | @SerializedName("final_tournament") private String finalTournament; 37 | @SerializedName("description_part_2") private String secondDescription; 38 | @SerializedName("description_part_3") private String thirdDescription; 39 | 40 | public String getTeamFlag() { 41 | return teamFlag; 42 | } 43 | 44 | public void setTeamFlag(String teamFlag) { 45 | this.teamFlag = teamFlag; 46 | } 47 | 48 | public String getTeamName() { 49 | return teamName; 50 | } 51 | 52 | public void setTeamName(String teamName) { 53 | this.teamName = teamName; 54 | } 55 | 56 | public List getImages() { 57 | return images; 58 | } 59 | 60 | public void setImages(List images) { 61 | this.images = images; 62 | } 63 | 64 | public String getDisclaimer() { 65 | return disclaimer; 66 | } 67 | 68 | public String getBestResult() { 69 | return bestResult; 70 | } 71 | 72 | public String getCoach() { 73 | return coach; 74 | } 75 | 76 | public String getLeadingScorer() { 77 | return leadingScorer; 78 | } 79 | 80 | public String getNickName() { 81 | return nickName; 82 | } 83 | 84 | public String getStadium() { 85 | return stadium; 86 | } 87 | 88 | public String getFirstDescription() { 89 | return firstDescription; 90 | } 91 | 92 | public String getMatchesPlayed() { 93 | return matchesPlayed; 94 | } 95 | 96 | public String getTeamOverall() { 97 | return teamOverall; 98 | } 99 | 100 | public String getFinalTournament() { 101 | return finalTournament; 102 | } 103 | 104 | public String getSecondDescription() { 105 | return secondDescription; 106 | } 107 | 108 | public String getThirdDescription() { 109 | return thirdDescription; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/data/local/LocalTeamApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.data.local; 18 | 19 | import android.content.Context; 20 | import androidx.annotation.NonNull; 21 | import java.io.BufferedReader; 22 | import java.io.IOException; 23 | import java.io.InputStream; 24 | import java.io.InputStreamReader; 25 | 26 | public class LocalTeamApi { 27 | 28 | private final Context context; 29 | 30 | public LocalTeamApi(@NonNull Context context) { 31 | this.context = context; 32 | } 33 | 34 | public String readEuroDataJson() { 35 | final String EURO_DATA_FILE = "euro_data.json"; 36 | String str = ""; 37 | try { 38 | StringBuilder builder = new StringBuilder(); 39 | InputStream json = context.getAssets().open(EURO_DATA_FILE); 40 | BufferedReader in = new BufferedReader(new InputStreamReader(json)); 41 | 42 | while ((str = in.readLine()) != null) { 43 | builder.append(str); 44 | } 45 | in.close(); 46 | str = builder.toString(); 47 | } catch (IOException e) { 48 | e.printStackTrace(); 49 | } 50 | return str; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/data/local/LocalTeamApiToTeamEntityMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.data.local; 18 | 19 | import io.github.erikjhordanrey.cleanarchitecture.data.entity.TeamEntity; 20 | import com.google.gson.Gson; 21 | import com.google.gson.JsonSyntaxException; 22 | import com.google.gson.reflect.TypeToken; 23 | 24 | import java.lang.reflect.Type; 25 | import java.util.List; 26 | 27 | import javax.inject.Inject; 28 | 29 | public class LocalTeamApiToTeamEntityMapper { 30 | 31 | private final Gson gson; 32 | 33 | @Inject 34 | public LocalTeamApiToTeamEntityMapper(Gson gson) { 35 | this.gson = gson; 36 | } 37 | 38 | public TeamEntity transformTeamEntity(String teamJsonResponse) throws JsonSyntaxException { 39 | try { 40 | final Type typeTeamEntity = new TypeToken() { 41 | }.getType(); 42 | return gson.fromJson(teamJsonResponse, typeTeamEntity); 43 | } catch (JsonSyntaxException exception) { 44 | exception.printStackTrace(); 45 | throw exception; 46 | } 47 | } 48 | 49 | public List transformTeamEntityCollection(String teamListJsonResponse) throws JsonSyntaxException { 50 | try { 51 | final Type typeTeamEntityList = new TypeToken>() { 52 | }.getType(); 53 | return gson.fromJson(teamListJsonResponse, typeTeamEntityList); 54 | } catch (JsonSyntaxException exception) { 55 | exception.printStackTrace(); 56 | throw exception; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/data/repository/TeamsRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.data.repository; 18 | 19 | import androidx.annotation.NonNull; 20 | import io.github.erikjhordanrey.cleanarchitecture.data.repository.datasource.TeamsLocalDataSource; 21 | import io.github.erikjhordanrey.cleanarchitecture.data.repository.datasource.TeamEntityToTeamMapper; 22 | import io.github.erikjhordanrey.cleanarchitecture.domain.model.Team; 23 | 24 | import io.reactivex.rxjava3.core.Observable; 25 | import java.util.List; 26 | 27 | public class TeamsRepository { 28 | 29 | private final TeamsLocalDataSource teamsLocalDataSource; 30 | private final TeamEntityToTeamMapper teamEntityToTeamMapper; 31 | 32 | public TeamsRepository(@NonNull TeamsLocalDataSource teamsLocalDataSource, @NonNull TeamEntityToTeamMapper teamEntityToTeamMapper) { 33 | this.teamsLocalDataSource = teamsLocalDataSource; 34 | this.teamEntityToTeamMapper = teamEntityToTeamMapper; 35 | } 36 | 37 | public Observable> getTeamList() { 38 | return teamsLocalDataSource.teamEntityList().map(teamEntityToTeamMapper::map); 39 | } 40 | 41 | public Observable getTeam(String flag) { 42 | return teamsLocalDataSource.teamEntity(flag).map(teamEntityToTeamMapper::map); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/data/repository/datasource/TeamEntityToTeamMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.data.repository.datasource; 18 | 19 | import io.github.erikjhordanrey.cleanarchitecture.core.mapper.Mapper; 20 | import io.github.erikjhordanrey.cleanarchitecture.data.entity.TeamEntity; 21 | import io.github.erikjhordanrey.cleanarchitecture.domain.model.Team; 22 | import javax.inject.Inject; 23 | import javax.inject.Singleton; 24 | 25 | @Singleton 26 | public class TeamEntityToTeamMapper extends Mapper { 27 | 28 | @Inject 29 | public TeamEntityToTeamMapper() { 30 | } 31 | 32 | @Override 33 | public Team map(TeamEntity value) { 34 | final Team team = new Team(); 35 | team.setFlag(value.getTeamFlag()); 36 | team.setName(value.getTeamName()); 37 | team.setImageFlag(value.getImages().get(0).getImageFlag()); 38 | team.setImageProfile(value.getImages().get(0).getImageProfile()); 39 | team.setImageHeader(value.getImages().get(0).getImageHeader()); 40 | team.setImageDetail(value.getImages().get(0).getImageDetail()); 41 | team.setDisclaimer(value.getDisclaimer()); 42 | team.setBestResult(value.getBestResult()); 43 | team.setCoach(value.getCoach()); 44 | team.setLeadingScorer(value.getLeadingScorer()); 45 | team.setNickName(value.getNickName()); 46 | team.setStadium(value.getStadium()); 47 | team.setDescriptionPart1(value.getFirstDescription()); 48 | team.setMatchesPlayed(value.getMatchesPlayed()); 49 | team.setOverall(value.getTeamOverall()); 50 | team.setFinalTournament(value.getFinalTournament()); 51 | team.setDescriptionPart2(value.getSecondDescription()); 52 | team.setDescriptionPart3(value.getThirdDescription()); 53 | return team; 54 | } 55 | 56 | @Override 57 | public TeamEntity reverseMap(Team value) { 58 | throw new UnsupportedOperationException(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/data/repository/datasource/TeamsLocalDataSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.data.repository.datasource; 18 | 19 | import io.github.erikjhordanrey.cleanarchitecture.data.entity.TeamEntity; 20 | import io.github.erikjhordanrey.cleanarchitecture.data.local.LocalTeamApi; 21 | import io.github.erikjhordanrey.cleanarchitecture.data.local.LocalTeamApiToTeamEntityMapper; 22 | import io.reactivex.rxjava3.core.Observable; 23 | import java.util.List; 24 | 25 | public class TeamsLocalDataSource { 26 | 27 | private final LocalTeamApi localTeamApi; 28 | private final LocalTeamApiToTeamEntityMapper localTeamApiToTeamEntityMapper; 29 | 30 | public TeamsLocalDataSource(LocalTeamApi localTeamApi, LocalTeamApiToTeamEntityMapper localTeamApiToTeamEntityMapper) { 31 | this.localTeamApi = localTeamApi; 32 | this.localTeamApiToTeamEntityMapper = localTeamApiToTeamEntityMapper; 33 | } 34 | 35 | public Observable> teamEntityList() { 36 | return Observable.create(emitter -> { 37 | List teamEntityList = getAll(); 38 | if (teamEntityList != null) { 39 | emitter.onNext(teamEntityList); 40 | emitter.onComplete(); 41 | } else { 42 | emitter.onError( 43 | new Throwable("Error getting team data list from the local json (euro_data.json)")); 44 | } 45 | }); 46 | } 47 | 48 | public Observable teamEntity(String flag) { 49 | return Observable.create(emitter -> { 50 | TeamEntity teamEntity = getByFlag(flag); 51 | if (teamEntity != null) { 52 | emitter.onNext(teamEntity); 53 | emitter.onComplete(); 54 | } else { 55 | emitter.onError( 56 | new Throwable("Error getting team data by flag from the local json (euro_data.json)")); 57 | } 58 | }); 59 | } 60 | 61 | private List getAll() { 62 | return localTeamApiToTeamEntityMapper.transformTeamEntityCollection(localTeamApi.readEuroDataJson()); 63 | } 64 | 65 | private TeamEntity getByFlag(String flag) { 66 | TeamEntity result = null; 67 | for (TeamEntity entity : getAll()) { 68 | if (entity.getTeamFlag().equals(flag)) { 69 | result = entity; 70 | break; 71 | } 72 | } 73 | return result; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/di/components/MainComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.di.components; 18 | 19 | import android.content.Context; 20 | import io.github.erikjhordanrey.cleanarchitecture.di.modules.MainModule; 21 | import io.github.erikjhordanrey.cleanarchitecture.view.activity.TeamDetailActivity; 22 | import io.github.erikjhordanrey.cleanarchitecture.view.activity.TeamsActivity; 23 | import dagger.Component; 24 | import javax.inject.Singleton; 25 | 26 | @Singleton @Component(modules = MainModule.class) public interface MainComponent { 27 | 28 | void inject(TeamsActivity activity); 29 | 30 | void inject(TeamDetailActivity activity); 31 | 32 | Context context(); 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/di/modules/MainModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.di.modules; 18 | 19 | import android.content.Context; 20 | import io.github.erikjhordanrey.cleanarchitecture.EuroApplication; 21 | import io.github.erikjhordanrey.cleanarchitecture.data.local.LocalTeamApi; 22 | import io.github.erikjhordanrey.cleanarchitecture.data.local.LocalTeamApiToTeamEntityMapper; 23 | import io.github.erikjhordanrey.cleanarchitecture.data.repository.TeamsRepository; 24 | import io.github.erikjhordanrey.cleanarchitecture.data.repository.datasource.TeamEntityToTeamMapper; 25 | import io.github.erikjhordanrey.cleanarchitecture.data.repository.datasource.TeamsLocalDataSource; 26 | import com.google.gson.Gson; 27 | import dagger.Module; 28 | import dagger.Provides; 29 | import javax.inject.Singleton; 30 | 31 | @Module 32 | public class MainModule { 33 | 34 | private final EuroApplication euroApplication; 35 | 36 | public MainModule(EuroApplication euroApplication) { 37 | this.euroApplication = euroApplication; 38 | } 39 | 40 | @Provides 41 | @Singleton 42 | Context provideApplicationContext() { 43 | return euroApplication; 44 | } 45 | 46 | @Provides 47 | @Singleton 48 | Gson provideGson() { 49 | return new Gson(); 50 | } 51 | 52 | @Provides 53 | @Singleton 54 | LocalTeamApi provideLocalTeamApi(Context context) { 55 | return new LocalTeamApi(context); 56 | } 57 | 58 | @Provides 59 | @Singleton 60 | TeamsLocalDataSource provideTeamsLocalDataSource(LocalTeamApi localTeamApi, 61 | LocalTeamApiToTeamEntityMapper localTeamApiToTeamEntityMapper) { 62 | return new TeamsLocalDataSource(localTeamApi, localTeamApiToTeamEntityMapper); 63 | } 64 | 65 | @Provides 66 | @Singleton 67 | TeamsRepository provideRepository(TeamsLocalDataSource teamsLocalDataSource, TeamEntityToTeamMapper teamEntityToTeamMapper) { 68 | return new TeamsRepository(teamsLocalDataSource, teamEntityToTeamMapper); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/domain/model/Team.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.domain.model; 18 | 19 | public class Team { 20 | 21 | private String flag; 22 | private String name; 23 | private String imageFlag; 24 | private String imageProfile; 25 | private String imageHeader; 26 | private String imageDetail; 27 | private String disclaimer; 28 | private String bestResult; 29 | private String coach; 30 | private String leadingScorer; 31 | private String nickName; 32 | private String stadium; 33 | private String descriptionPart1; 34 | private String matchesPlayed; 35 | private String overall; 36 | private String finalTournament; 37 | private String descriptionPart2; 38 | private String descriptionPart3; 39 | 40 | public String getFlag() { 41 | return flag; 42 | } 43 | 44 | public void setFlag(String flag) { 45 | this.flag = flag; 46 | } 47 | 48 | public String getName() { 49 | return name; 50 | } 51 | 52 | public void setName(String name) { 53 | this.name = name; 54 | } 55 | 56 | public String getImageFlag() { 57 | return imageFlag; 58 | } 59 | 60 | public void setImageFlag(String imageFlag) { 61 | this.imageFlag = imageFlag; 62 | } 63 | 64 | public String getImageProfile() { 65 | return imageProfile; 66 | } 67 | 68 | public void setImageProfile(String imageProfile) { 69 | this.imageProfile = imageProfile; 70 | } 71 | 72 | public String getImageHeader() { 73 | return imageHeader; 74 | } 75 | 76 | public void setImageHeader(String imageHeader) { 77 | this.imageHeader = imageHeader; 78 | } 79 | 80 | public String getImageDetail() { 81 | return imageDetail; 82 | } 83 | 84 | public void setImageDetail(String imageDetail) { 85 | this.imageDetail = imageDetail; 86 | } 87 | 88 | public String getDisclaimer() { 89 | return disclaimer; 90 | } 91 | 92 | public void setDisclaimer(String disclaimer) { 93 | this.disclaimer = disclaimer; 94 | } 95 | 96 | public String getBestResult() { 97 | return bestResult; 98 | } 99 | 100 | public void setBestResult(String bestResult) { 101 | this.bestResult = bestResult; 102 | } 103 | 104 | public String getCoach() { 105 | return coach; 106 | } 107 | 108 | public void setCoach(String coach) { 109 | this.coach = coach; 110 | } 111 | 112 | public String getLeadingScorer() { 113 | return leadingScorer; 114 | } 115 | 116 | public void setLeadingScorer(String leadingScorer) { 117 | this.leadingScorer = leadingScorer; 118 | } 119 | 120 | public String getNickName() { 121 | return nickName; 122 | } 123 | 124 | public void setNickName(String nickName) { 125 | this.nickName = nickName; 126 | } 127 | 128 | public String getStadium() { 129 | return stadium; 130 | } 131 | 132 | public void setStadium(String stadium) { 133 | this.stadium = stadium; 134 | } 135 | 136 | public String getDescriptionPart1() { 137 | return descriptionPart1; 138 | } 139 | 140 | public void setDescriptionPart1(String descriptionPart1) { 141 | this.descriptionPart1 = descriptionPart1; 142 | } 143 | 144 | public String getMatchesPlayed() { 145 | return matchesPlayed; 146 | } 147 | 148 | public void setMatchesPlayed(String matchesPlayed) { 149 | this.matchesPlayed = matchesPlayed; 150 | } 151 | 152 | public String getOverall() { 153 | return overall; 154 | } 155 | 156 | public void setOverall(String overall) { 157 | this.overall = overall; 158 | } 159 | 160 | public String getFinalTournament() { 161 | return finalTournament; 162 | } 163 | 164 | public void setFinalTournament(String finalTournament) { 165 | this.finalTournament = finalTournament; 166 | } 167 | 168 | public String getDescriptionPart2() { 169 | return descriptionPart2; 170 | } 171 | 172 | public void setDescriptionPart2(String descriptionPart2) { 173 | this.descriptionPart2 = descriptionPart2; 174 | } 175 | 176 | public String getDescriptionPart3() { 177 | return descriptionPart3; 178 | } 179 | 180 | public void setDescriptionPart3(String descriptionPart3) { 181 | this.descriptionPart3 = descriptionPart3; 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/domain/usecase/GetTeamUseCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.domain.usecase; 18 | 19 | import io.github.erikjhordanrey.cleanarchitecture.data.repository.TeamsRepository; 20 | import io.github.erikjhordanrey.cleanarchitecture.domain.model.Team; 21 | 22 | import io.reactivex.rxjava3.core.Observable; 23 | import javax.inject.Inject; 24 | 25 | public class GetTeamUseCase { 26 | 27 | private final TeamsRepository teamsRepository; 28 | 29 | @Inject 30 | public GetTeamUseCase(TeamsRepository teamsRepository) { 31 | this.teamsRepository = teamsRepository; 32 | } 33 | 34 | public Observable getTeam(String flag) { 35 | return teamsRepository.getTeam(flag); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/domain/usecase/GetTeamsUseCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.domain.usecase; 18 | 19 | import io.github.erikjhordanrey.cleanarchitecture.data.repository.TeamsRepository; 20 | import io.github.erikjhordanrey.cleanarchitecture.domain.model.Team; 21 | import io.reactivex.rxjava3.core.Observable; 22 | import java.util.List; 23 | import javax.inject.Inject; 24 | 25 | public class GetTeamsUseCase { 26 | 27 | private final TeamsRepository teamsRepository; 28 | 29 | @Inject 30 | public GetTeamsUseCase(TeamsRepository teamsRepository) { 31 | this.teamsRepository = teamsRepository; 32 | } 33 | 34 | public Observable> getTeamList() { 35 | return teamsRepository.getTeamList(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/view/activity/TeamDetailActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.view.activity; 18 | 19 | import android.content.Context; 20 | import android.content.Intent; 21 | import android.os.Bundle; 22 | import android.view.MenuItem; 23 | import android.widget.ImageView; 24 | import androidx.annotation.Nullable; 25 | import androidx.appcompat.app.AppCompatActivity; 26 | import androidx.core.content.ContextCompat; 27 | import io.github.erikjhordanrey.cleanarchitecture.EuroApplication; 28 | import io.github.erikjhordanrey.cleanarchitecture.R; 29 | import io.github.erikjhordanrey.cleanarchitecture.databinding.ActivityTeamDetailBinding; 30 | import io.github.erikjhordanrey.cleanarchitecture.view.model.TeamUi; 31 | import io.github.erikjhordanrey.cleanarchitecture.view.presenter.TeamDetailPresenter; 32 | import com.squareup.picasso.Picasso; 33 | import java.util.Objects; 34 | import javax.inject.Inject; 35 | 36 | public class TeamDetailActivity extends AppCompatActivity implements TeamDetailPresenter.View { 37 | 38 | private final static String TEAM_FLAG_KEY = "team_flag_key"; 39 | 40 | @Inject 41 | TeamDetailPresenter presenter; 42 | 43 | private ActivityTeamDetailBinding binding; 44 | 45 | @Override 46 | protected void onCreate(@Nullable Bundle savedInstanceState) { 47 | super.onCreate(savedInstanceState); 48 | binding = ActivityTeamDetailBinding.inflate(getLayoutInflater()); 49 | setContentView(binding.getRoot()); 50 | initializeToolbar(); 51 | initializeDagger(); 52 | initializePresenter(); 53 | } 54 | 55 | private void initializeDagger() { 56 | EuroApplication euroApplication = (EuroApplication) getApplication(); 57 | euroApplication.getMainComponent().inject(this); 58 | } 59 | 60 | private void initializePresenter() { 61 | presenter.setView(this); 62 | final String flag = getTeamFlagKey(); 63 | presenter.setTeamFlag(flag); 64 | presenter.initialize(); 65 | } 66 | 67 | @Override 68 | public boolean onOptionsItemSelected(MenuItem item) { 69 | if (item.getItemId() == android.R.id.home) { 70 | onBackPressed(); 71 | } 72 | return super.onOptionsItemSelected(item); 73 | } 74 | 75 | @Override 76 | protected void onDestroy() { 77 | super.onDestroy(); 78 | presenter.destroy(); 79 | } 80 | 81 | @Override 82 | public void showTeam(TeamUi teamUi) { 83 | binding.toolbar.setTitle(teamUi.getName()); 84 | binding.headerDetail.initializeHeader(teamUi.getDisclaimer(), teamUi.getNickName()); 85 | getImage(teamUi.getPictureOfDetail(), binding.imageDetailHistory); 86 | binding.labelBestResult.setText(teamUi.getBestResult()); 87 | binding.labelCoach.setText(teamUi.getCoach()); 88 | binding.labelLeadingScorer.setText(teamUi.getLeadingScorer()); 89 | binding.labelStadium.setText(teamUi.getStadium()); 90 | binding.labelDescription1.setText(teamUi.getDescriptionPart1()); 91 | binding.labelMatchesPlayed.setText(teamUi.getMatchesPlayed()); 92 | binding.labelOverall.setText(teamUi.getOverall()); 93 | binding.labelFinalTournament.setText(teamUi.getFinalTournament()); 94 | getImage(teamUi.getPictureOfProfile(), binding.imageDetailProfile); 95 | binding.labelDescription2.setText(teamUi.getDescriptionPart2()); 96 | binding.labelDescription3.setText(teamUi.getDescriptionPart3()); 97 | } 98 | 99 | private String getTeamFlagKey() { 100 | return Objects.requireNonNull(getIntent().getExtras()).getString(TEAM_FLAG_KEY); 101 | } 102 | 103 | private void getImage(String photo, ImageView photoImageView) { 104 | Picasso.get().load(photo).fit().centerCrop().into(photoImageView); 105 | } 106 | 107 | private void initializeToolbar() { 108 | setSupportActionBar(binding.toolbar); 109 | if (getSupportActionBar() != null) { 110 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 111 | } 112 | getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.colorPrimaryDark)); 113 | } 114 | 115 | public static void open(Context context, String superHeroName) { 116 | Intent intent = new Intent(context, TeamDetailActivity.class); 117 | intent.putExtra(TEAM_FLAG_KEY, superHeroName); 118 | context.startActivity(intent); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/view/activity/TeamsActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.view.activity; 18 | 19 | import android.content.Intent; 20 | import android.net.Uri; 21 | import android.os.Bundle; 22 | import android.view.Menu; 23 | import android.view.MenuItem; 24 | import android.view.View; 25 | import androidx.appcompat.app.AppCompatActivity; 26 | import androidx.recyclerview.widget.DividerItemDecoration; 27 | import androidx.recyclerview.widget.LinearLayoutManager; 28 | import io.github.erikjhordanrey.cleanarchitecture.EuroApplication; 29 | import io.github.erikjhordanrey.cleanarchitecture.R; 30 | import io.github.erikjhordanrey.cleanarchitecture.databinding.ActivityTeamsBinding; 31 | import io.github.erikjhordanrey.cleanarchitecture.view.adapter.TeamsAdapter; 32 | import io.github.erikjhordanrey.cleanarchitecture.view.model.TeamUi; 33 | import io.github.erikjhordanrey.cleanarchitecture.view.presenter.TeamsPresenter; 34 | import java.util.List; 35 | import javax.inject.Inject; 36 | 37 | public class TeamsActivity extends AppCompatActivity implements TeamsPresenter.View { 38 | 39 | private final static String REPOSITORY_URL = "https://github.com/erikjhordan-rey/Clean-Architecture-Android"; 40 | private final static String BLOG_URL = "https://erikjhordan-rey.github.io/blog/2016/01/27/ANDROID-clean-architecture.html"; 41 | 42 | private ActivityTeamsBinding binding; 43 | private TeamsAdapter adapter; 44 | 45 | @Inject 46 | TeamsPresenter presenter; 47 | 48 | @Override 49 | protected void onCreate(Bundle savedInstanceState) { 50 | super.onCreate(savedInstanceState); 51 | binding = ActivityTeamsBinding.inflate(getLayoutInflater()); 52 | setContentView(binding.getRoot()); 53 | initializeToolbar(); 54 | initializeDagger(); 55 | initializePresenter(); 56 | initializeAdapter(); 57 | initializeRecyclerView(); 58 | presenter.initialize(); 59 | } 60 | 61 | @Override 62 | protected void onDestroy() { 63 | super.onDestroy(); 64 | presenter.destroy(); 65 | } 66 | 67 | @Override 68 | public boolean onCreateOptionsMenu(Menu menu) { 69 | getMenuInflater().inflate(R.menu.menu_scrolling, menu); 70 | return true; 71 | } 72 | 73 | @Override 74 | public boolean onOptionsItemSelected(MenuItem item) { 75 | startActivityActionView((R.id.action_code == item.getItemId()) ? REPOSITORY_URL : BLOG_URL); 76 | return super.onOptionsItemSelected(item); 77 | } 78 | 79 | @Override 80 | public void showEuroTeams(List teamList) { 81 | adapter.addAll(teamList); 82 | adapter.notifyDataSetChanged(); 83 | } 84 | 85 | @Override 86 | public void openTeamScreen(TeamUi team) { 87 | TeamDetailActivity.open(TeamsActivity.this, team.getFlag()); 88 | } 89 | 90 | @Override 91 | public void showLoading() { 92 | binding.contentTeams.progressTeam.setVisibility(View.VISIBLE); 93 | binding.contentTeams.listTeams.setVisibility(View.GONE); 94 | } 95 | 96 | @Override 97 | public void hideLoading() { 98 | binding.contentTeams.progressTeam.setVisibility(View.GONE); 99 | binding.contentTeams.listTeams.setVisibility(View.VISIBLE); 100 | } 101 | 102 | private void initializeToolbar() { 103 | setSupportActionBar(binding.toolbar); 104 | if (getSupportActionBar() != null) { 105 | getSupportActionBar().setDisplayShowTitleEnabled(false); 106 | } 107 | } 108 | 109 | private void initializeDagger() { 110 | EuroApplication app = (EuroApplication) getApplication(); 111 | app.getMainComponent().inject(this); 112 | } 113 | 114 | private void initializePresenter() { 115 | presenter.setView(this); 116 | } 117 | 118 | private void initializeAdapter() { 119 | adapter = new TeamsAdapter(presenter); 120 | } 121 | 122 | private void initializeRecyclerView() { 123 | binding.contentTeams.listTeams.setLayoutManager(new LinearLayoutManager(this)); 124 | binding.contentTeams.listTeams.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL)); 125 | binding.contentTeams.listTeams.setHasFixedSize(true); 126 | binding.contentTeams.listTeams.setAdapter(adapter); 127 | } 128 | 129 | private void startActivityActionView(String url) { 130 | startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/view/adapter/TeamViewHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.view.adapter; 18 | 19 | import android.widget.ImageView; 20 | import androidx.annotation.NonNull; 21 | import androidx.recyclerview.widget.RecyclerView; 22 | import io.github.erikjhordanrey.cleanarchitecture.databinding.TeamRowBinding; 23 | import io.github.erikjhordanrey.cleanarchitecture.view.model.TeamUi; 24 | import io.github.erikjhordanrey.cleanarchitecture.view.presenter.TeamsPresenter; 25 | import com.squareup.picasso.Picasso; 26 | 27 | class TeamViewHolder extends RecyclerView.ViewHolder { 28 | 29 | private final TeamsPresenter teamsPresenter; 30 | private final TeamRowBinding teamRowBinding; 31 | 32 | TeamViewHolder(@NonNull TeamRowBinding binding, @NonNull TeamsPresenter teamsPresenter) { 33 | super(binding.getRoot()); 34 | this.teamRowBinding = binding; 35 | this.teamsPresenter = teamsPresenter; 36 | } 37 | 38 | void render(TeamUi teamUi) { 39 | renderTeamHeaderImage(teamUi.getPictureOfHeader()); 40 | renderTeamFlagImage(teamUi.getPictureOfFlag()); 41 | renderTeamName(teamUi.getName()); 42 | onItemClick(teamUi); 43 | } 44 | 45 | private void renderTeamHeaderImage(String urlHeaderImage) { 46 | getImage(urlHeaderImage, teamRowBinding.imageHeader); 47 | } 48 | 49 | private void renderTeamFlagImage(String urlFlagImage) { 50 | getImage(urlFlagImage, teamRowBinding.imageFlag); 51 | } 52 | 53 | private void renderTeamName(String name) { 54 | teamRowBinding.labelName.setText(name); 55 | } 56 | 57 | private void onItemClick(final TeamUi teamUi) { 58 | itemView.setOnClickListener(v -> teamsPresenter.onTeamClicked(teamUi)); 59 | } 60 | 61 | private void getImage(String photo, ImageView photoImageView) { 62 | Picasso.get().load(photo).fit().centerCrop().into(photoImageView); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/view/adapter/TeamsAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.view.adapter; 18 | 19 | import android.view.LayoutInflater; 20 | import android.view.ViewGroup; 21 | import androidx.annotation.NonNull; 22 | import androidx.recyclerview.widget.RecyclerView; 23 | import io.github.erikjhordanrey.cleanarchitecture.databinding.TeamRowBinding; 24 | import io.github.erikjhordanrey.cleanarchitecture.view.presenter.TeamsPresenter; 25 | import io.github.erikjhordanrey.cleanarchitecture.view.model.TeamUi; 26 | import java.util.ArrayList; 27 | import java.util.Collection; 28 | import java.util.List; 29 | 30 | public class TeamsAdapter extends RecyclerView.Adapter { 31 | 32 | private final TeamsPresenter presenter; 33 | private final List teamUiList; 34 | 35 | public TeamsAdapter(@NonNull TeamsPresenter presenter) { 36 | this.presenter = presenter; 37 | teamUiList = new ArrayList<>(); 38 | } 39 | 40 | @NonNull 41 | @Override 42 | public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 43 | return new TeamViewHolder(TeamRowBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false), presenter); 44 | } 45 | 46 | @Override 47 | public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { 48 | final TeamViewHolder teamViewHolder = (TeamViewHolder) holder; 49 | teamViewHolder.render(teamUiList.get(position)); 50 | } 51 | 52 | @Override 53 | public int getItemCount() { 54 | return teamUiList.size(); 55 | } 56 | 57 | public void addAll(Collection collection) { 58 | teamUiList.addAll(collection); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/view/model/TeamUi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 | package io.github.erikjhordanrey.cleanarchitecture.view.model; 17 | 18 | public class TeamUi { 19 | 20 | private String flag; 21 | private String name; 22 | private String pictureOfFlag; 23 | private String pictureOfProfile; 24 | private String pictureOfHeader; 25 | private String pictureOfDetail; 26 | private String disclaimer; 27 | private String bestResult; 28 | private String coach; 29 | private String leadingScorer; 30 | private String nickName; 31 | private String stadium; 32 | private String descriptionPart1; 33 | private String matchesPlayed; 34 | private String overall; 35 | private String finalTournament; 36 | private String descriptionPart2; 37 | private String descriptionPart3; 38 | 39 | public String getFlag() { 40 | return flag; 41 | } 42 | 43 | public void setFlag(String flag) { 44 | this.flag = flag; 45 | } 46 | 47 | public String getName() { 48 | return name; 49 | } 50 | 51 | public void setName(String name) { 52 | this.name = name; 53 | } 54 | 55 | public String getPictureOfFlag() { 56 | return pictureOfFlag; 57 | } 58 | 59 | public void setPictureOfFlag(String pictureOfFlag) { 60 | this.pictureOfFlag = pictureOfFlag; 61 | } 62 | 63 | public String getPictureOfProfile() { 64 | return pictureOfProfile; 65 | } 66 | 67 | public void setPictureOfProfile(String pictureOfProfile) { 68 | this.pictureOfProfile = pictureOfProfile; 69 | } 70 | 71 | public String getPictureOfHeader() { 72 | return pictureOfHeader; 73 | } 74 | 75 | public void setPictureOfHeader(String pictureOfHeader) { 76 | this.pictureOfHeader = pictureOfHeader; 77 | } 78 | 79 | public String getPictureOfDetail() { 80 | return pictureOfDetail; 81 | } 82 | 83 | public void setPictureOfDetail(String pictureOfDetail) { 84 | this.pictureOfDetail = pictureOfDetail; 85 | } 86 | 87 | public String getDisclaimer() { 88 | return disclaimer; 89 | } 90 | 91 | public void setDisclaimer(String disclaimer) { 92 | this.disclaimer = disclaimer; 93 | } 94 | 95 | public String getBestResult() { 96 | return bestResult; 97 | } 98 | 99 | public void setBestResult(String bestResult) { 100 | this.bestResult = bestResult; 101 | } 102 | 103 | public String getCoach() { 104 | return coach; 105 | } 106 | 107 | public void setCoach(String coach) { 108 | this.coach = coach; 109 | } 110 | 111 | public String getLeadingScorer() { 112 | return leadingScorer; 113 | } 114 | 115 | public void setLeadingScorer(String leadingScorer) { 116 | this.leadingScorer = leadingScorer; 117 | } 118 | 119 | public String getNickName() { 120 | return nickName; 121 | } 122 | 123 | public void setNickName(String nickName) { 124 | this.nickName = nickName; 125 | } 126 | 127 | public String getStadium() { 128 | return stadium; 129 | } 130 | 131 | public void setStadium(String stadium) { 132 | this.stadium = stadium; 133 | } 134 | 135 | public String getDescriptionPart1() { 136 | return descriptionPart1; 137 | } 138 | 139 | public void setDescriptionPart1(String descriptionPart1) { 140 | this.descriptionPart1 = descriptionPart1; 141 | } 142 | 143 | public String getMatchesPlayed() { 144 | return matchesPlayed; 145 | } 146 | 147 | public void setMatchesPlayed(String matchesPlayed) { 148 | this.matchesPlayed = matchesPlayed; 149 | } 150 | 151 | public String getOverall() { 152 | return overall; 153 | } 154 | 155 | public void setOverall(String overall) { 156 | this.overall = overall; 157 | } 158 | 159 | public String getFinalTournament() { 160 | return finalTournament; 161 | } 162 | 163 | public void setFinalTournament(String finalTournament) { 164 | this.finalTournament = finalTournament; 165 | } 166 | 167 | public String getDescriptionPart2() { 168 | return descriptionPart2; 169 | } 170 | 171 | public void setDescriptionPart2(String descriptionPart2) { 172 | this.descriptionPart2 = descriptionPart2; 173 | } 174 | 175 | public String getDescriptionPart3() { 176 | return descriptionPart3; 177 | } 178 | 179 | public void setDescriptionPart3(String descriptionPart3) { 180 | this.descriptionPart3 = descriptionPart3; 181 | } 182 | } 183 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/view/model/mapper/TeamToTeamUiMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.view.model.mapper; 18 | 19 | import io.github.erikjhordanrey.cleanarchitecture.core.mapper.Mapper; 20 | import io.github.erikjhordanrey.cleanarchitecture.domain.model.Team; 21 | import io.github.erikjhordanrey.cleanarchitecture.view.model.TeamUi; 22 | import javax.inject.Inject; 23 | 24 | public class TeamToTeamUiMapper extends Mapper { 25 | 26 | @Inject 27 | public TeamToTeamUiMapper() { 28 | } 29 | 30 | @Override 31 | public TeamUi map(Team value) { 32 | final TeamUi teamUi = new TeamUi(); 33 | teamUi.setFlag(value.getFlag()); 34 | teamUi.setName(value.getName()); 35 | teamUi.setPictureOfFlag(value.getImageFlag()); 36 | teamUi.setPictureOfProfile(value.getImageProfile()); 37 | teamUi.setPictureOfHeader(value.getImageHeader()); 38 | teamUi.setPictureOfDetail(value.getImageDetail()); 39 | teamUi.setDisclaimer(value.getDisclaimer()); 40 | teamUi.setBestResult(value.getBestResult()); 41 | teamUi.setCoach(value.getCoach()); 42 | teamUi.setLeadingScorer(value.getLeadingScorer()); 43 | teamUi.setNickName(value.getNickName()); 44 | teamUi.setStadium(value.getStadium()); 45 | teamUi.setDescriptionPart1(value.getDescriptionPart1()); 46 | teamUi.setMatchesPlayed(value.getMatchesPlayed()); 47 | teamUi.setOverall(value.getOverall()); 48 | teamUi.setFinalTournament(value.getFinalTournament()); 49 | teamUi.setDescriptionPart2(value.getDescriptionPart2()); 50 | teamUi.setDescriptionPart3(value.getDescriptionPart3()); 51 | return teamUi; 52 | } 53 | 54 | @Override 55 | public Team reverseMap(TeamUi value) { 56 | throw new UnsupportedOperationException(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/view/presenter/TeamDetailPresenter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 | package io.github.erikjhordanrey.cleanarchitecture.view.presenter; 17 | 18 | import androidx.annotation.NonNull; 19 | import io.github.erikjhordanrey.cleanarchitecture.core.presenter.Presenter; 20 | import io.github.erikjhordanrey.cleanarchitecture.domain.usecase.GetTeamUseCase; 21 | import io.github.erikjhordanrey.cleanarchitecture.view.model.TeamUi; 22 | import io.github.erikjhordanrey.cleanarchitecture.view.model.mapper.TeamToTeamUiMapper; 23 | import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; 24 | import io.reactivex.rxjava3.disposables.CompositeDisposable; 25 | import io.reactivex.rxjava3.disposables.Disposable; 26 | import io.reactivex.rxjava3.schedulers.Schedulers; 27 | import javax.inject.Inject; 28 | 29 | public class TeamDetailPresenter extends Presenter { 30 | 31 | private final CompositeDisposable compositeDisposable = new CompositeDisposable(); 32 | private final GetTeamUseCase getTeamUseCase; 33 | private final TeamToTeamUiMapper teamToTeamUiMapper; 34 | private String teamFlag; 35 | 36 | @Inject 37 | public TeamDetailPresenter(@NonNull GetTeamUseCase getTeamUseCase, 38 | @NonNull TeamToTeamUiMapper teamToTeamUiMapper) { 39 | this.getTeamUseCase = getTeamUseCase; 40 | this.teamToTeamUiMapper = teamToTeamUiMapper; 41 | } 42 | 43 | public void setTeamFlag(String teamFlag) { 44 | this.teamFlag = teamFlag; 45 | } 46 | 47 | @Override 48 | public void initialize() { 49 | super.initialize(); 50 | Disposable disposable = getTeamUseCase.getTeam(teamFlag) 51 | .subscribeOn(Schedulers.io()) 52 | .observeOn(AndroidSchedulers.mainThread()) 53 | .map(teamToTeamUiMapper::map) 54 | .subscribe(teamUi -> getView().showTeam(teamUi), Throwable::printStackTrace); 55 | compositeDisposable.add(disposable); 56 | } 57 | 58 | public void destroy() { 59 | compositeDisposable.dispose(); 60 | setView(null); 61 | } 62 | 63 | public interface View extends Presenter.View { 64 | void showTeam(TeamUi teamUi); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/view/presenter/TeamsPresenter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.view.presenter; 18 | 19 | import androidx.annotation.NonNull; 20 | import io.github.erikjhordanrey.cleanarchitecture.core.presenter.Presenter; 21 | import io.github.erikjhordanrey.cleanarchitecture.domain.usecase.GetTeamsUseCase; 22 | import io.github.erikjhordanrey.cleanarchitecture.view.model.TeamUi; 23 | import io.github.erikjhordanrey.cleanarchitecture.view.model.mapper.TeamToTeamUiMapper; 24 | import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; 25 | import io.reactivex.rxjava3.disposables.CompositeDisposable; 26 | import io.reactivex.rxjava3.disposables.Disposable; 27 | import io.reactivex.rxjava3.schedulers.Schedulers; 28 | import java.util.List; 29 | import javax.inject.Inject; 30 | 31 | public class TeamsPresenter extends Presenter { 32 | 33 | private final CompositeDisposable compositeDisposable = new CompositeDisposable(); 34 | private final GetTeamsUseCase getTeamsUseCase; 35 | private final TeamToTeamUiMapper teamToTeamUiMapper; 36 | 37 | @Inject 38 | public TeamsPresenter(@NonNull GetTeamsUseCase getTeamsUseCase, @NonNull TeamToTeamUiMapper teamToTeamUiMapper) { 39 | this.getTeamsUseCase = getTeamsUseCase; 40 | this.teamToTeamUiMapper = teamToTeamUiMapper; 41 | } 42 | 43 | @Override 44 | public void initialize() { 45 | super.initialize(); 46 | getView().showLoading(); 47 | Disposable disposable = getTeamsUseCase.getTeamList() 48 | .subscribeOn(Schedulers.io()) 49 | .observeOn(AndroidSchedulers.mainThread()) 50 | .map(teamToTeamUiMapper::map) 51 | .doOnTerminate(() -> getView().hideLoading()) 52 | .subscribe(teamUiList -> getView().showEuroTeams(teamUiList), Throwable::printStackTrace); 53 | compositeDisposable.add(disposable); 54 | } 55 | 56 | public void onTeamClicked(TeamUi team) { 57 | getView().openTeamScreen(team); 58 | } 59 | 60 | public void destroy() { 61 | compositeDisposable.dispose(); 62 | setView(null); 63 | } 64 | 65 | public interface View extends Presenter.View { 66 | 67 | void showEuroTeams(List teamList); 68 | 69 | void openTeamScreen(TeamUi team); 70 | 71 | void showLoading(); 72 | 73 | void hideLoading(); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/view/widget/CustomFontTextView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.view.widget; 18 | 19 | import android.content.Context; 20 | import android.graphics.Typeface; 21 | import android.util.AttributeSet; 22 | 23 | import androidx.appcompat.widget.AppCompatTextView; 24 | 25 | public class CustomFontTextView extends AppCompatTextView { 26 | 27 | final static String EURO_FONT = "euro.ttf"; 28 | 29 | public CustomFontTextView(Context context) { 30 | super(context); 31 | if (!isInEditMode()) { 32 | init(context); 33 | } 34 | } 35 | 36 | public CustomFontTextView(Context context, AttributeSet attrs) { 37 | super(context, attrs); 38 | if (!isInEditMode()) { 39 | init(context); 40 | } 41 | } 42 | 43 | public CustomFontTextView(Context context, AttributeSet attrs, int defStyleAttr) { 44 | super(context, attrs, defStyleAttr); 45 | if (!isInEditMode()) { 46 | init(context); 47 | } 48 | } 49 | 50 | private void init(Context context) { 51 | this.setTypeface(getRobotoBlackTypeFace(context)); 52 | } 53 | 54 | private Typeface getRobotoBlackTypeFace(Context context) { 55 | return Typeface.createFromAsset(context.getAssets(), EURO_FONT); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/erikjhordanrey/cleanarchitecture/view/widget/HeaderView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Erik Jhordan Rey. 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 io.github.erikjhordanrey.cleanarchitecture.view.widget; 18 | 19 | import android.content.Context; 20 | import android.util.AttributeSet; 21 | import android.view.LayoutInflater; 22 | import android.widget.LinearLayout; 23 | import io.github.erikjhordanrey.cleanarchitecture.databinding.HeaderDetailBinding; 24 | 25 | public class HeaderView extends LinearLayout { 26 | 27 | private HeaderDetailBinding binding; 28 | 29 | public HeaderView(Context context) { 30 | super(context); 31 | } 32 | 33 | public HeaderView(Context context, AttributeSet attrs) { 34 | super(context, attrs); 35 | } 36 | 37 | public HeaderView(Context context, AttributeSet attrs, int defStyleAttr) { 38 | super(context, attrs, defStyleAttr); 39 | } 40 | 41 | @Override 42 | protected void onFinishInflate() { 43 | super.onFinishInflate(); 44 | binding = HeaderDetailBinding.inflate(LayoutInflater.from(getContext()), this, true); 45 | } 46 | 47 | public void initializeHeader(String disclaimer, String nickName) { 48 | binding.txtHeaderTitle.setText(disclaimer); 49 | binding.txtHeaderSubtitle.setText(nickName); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/background_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/background_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/euro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erikjhordan-rey/Clean-Architecture-Android/88c9b8428133a9eeede22699c9b7eb1710e988ac/app/src/main/res/drawable/euro.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_team_detail.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | 14 | 21 | 22 | 27 | 28 | 29 | 30 | 34 | 35 | 41 | 42 | 43 | 49 | 50 | 51 | 54 | 55 | 58 | 59 | 62 | 63 | 66 | 67 | 70 | 71 | 74 | 75 | 76 | 79 | 80 | 83 | 84 | 85 | 91 | 92 | 96 | 97 | 101 | 102 | 106 | 107 | 110 | 111 | 114 | 115 | 118 | 119 | 122 | 123 | 126 | 127 | 134 | 135 | 139 | 140 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_teams.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 18 | 26 | 27 | 37 | 38 | 43 | 44 | 45 | 46 | 47 | 48 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_teams.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 18 | 19 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/header_detail.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 22 | 23 | 24 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/team_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 21 | 22 | 28 | 29 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_scrolling.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erikjhordan-rey/Clean-Architecture-Android/88c9b8428133a9eeede22699c9b7eb1710e988ac/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erikjhordan-rey/Clean-Architecture-Android/88c9b8428133a9eeede22699c9b7eb1710e988ac/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erikjhordan-rey/Clean-Architecture-Android/88c9b8428133a9eeede22699c9b7eb1710e988ac/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erikjhordan-rey/Clean-Architecture-Android/88c9b8428133a9eeede22699c9b7eb1710e988ac/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erikjhordan-rey/Clean-Architecture-Android/88c9b8428133a9eeede22699c9b7eb1710e988ac/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | > 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #01467D 4 | #01355E 5 | #01579B 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 180dp 3 | 16dp 4 | 16dp 5 | 6 | 7 | 2dp 8 | 4dp 9 | 8dp 10 | 16dp 11 | 32dp 12 | 64dp 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Euro2016 - Clean Architecture 3 | 4 | Show me Code 5 | Read the Post / Blog 6 | 7 | Mejor clasificación en la EURO 8 | Seleccionador 9 | Máximo goleador 10 | Apodo 11 | Sede 12 | Trayectoria en la EURO 13 | Partidos jugados 14 | total 15 | Fase final 16 | Fase de clasificación 17 | Content profile 18 | Content history 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 16 | 17 | 26 | 27 | 28 | 33 | 34 | 42 | 43 | 50 | 51 |