├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── height.png │ │ │ │ ├── weight.png │ │ │ │ ├── appicon.png │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── font │ │ │ │ └── manropemedium.ttf │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── layout │ │ │ │ ├── splash_screen.xml │ │ │ │ ├── main_adapter_single_row.xml │ │ │ │ ├── activity_main.xml │ │ │ │ └── pokemon_detail.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── graphql │ │ │ └── com │ │ │ │ └── tayfuncesur │ │ │ │ └── pokehub │ │ │ │ ├── API.graphql │ │ │ │ ├── PokemonDetail.graphql │ │ │ │ └── schema.json │ │ ├── java │ │ │ └── com │ │ │ │ └── tayfuncesur │ │ │ │ └── pokehub │ │ │ │ ├── util │ │ │ │ └── Const.kt │ │ │ │ ├── base │ │ │ │ ├── Repository.kt │ │ │ │ ├── Resource.kt │ │ │ │ ├── ViewModelFactory.kt │ │ │ │ └── BaseDaggerActivity.kt │ │ │ │ ├── di │ │ │ │ ├── AppInjector.kt │ │ │ │ ├── module │ │ │ │ │ ├── FragmentModule.kt │ │ │ │ │ ├── AppModule.kt │ │ │ │ │ ├── ViewModelModule.kt │ │ │ │ │ └── NetworkModule.kt │ │ │ │ └── AppComponent.kt │ │ │ │ ├── binding │ │ │ │ └── BindingAdapter.kt │ │ │ │ ├── App.kt │ │ │ │ ├── ui │ │ │ │ ├── splash │ │ │ │ │ ├── SplashScreenViewModel.kt │ │ │ │ │ └── SplashActivity.kt │ │ │ │ ├── main │ │ │ │ │ ├── MainViewModel.kt │ │ │ │ │ ├── MainAdapter.kt │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── detail │ │ │ │ │ ├── PokemonDetailViewModel.kt │ │ │ │ │ ├── PokemonEvulotionAdapter.kt │ │ │ │ │ └── PokemonDetailFragment.kt │ │ │ │ ├── network │ │ │ │ └── ApiService.kt │ │ │ │ └── repository │ │ │ │ ├── PokemonRepository.kt │ │ │ │ └── PokemonDetailRepository.kt │ │ ├── AndroidManifest.xml │ │ └── assets │ │ │ └── anims │ │ │ ├── loading.json │ │ │ └── error.json │ └── androidTest │ │ └── java │ │ └── com │ │ └── tayfuncesur │ │ └── pokehub │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── README.md └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TayfunCesur/Pokehub/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/height.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TayfunCesur/Pokehub/HEAD/app/src/main/res/drawable/height.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/weight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TayfunCesur/Pokehub/HEAD/app/src/main/res/drawable/weight.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/appicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TayfunCesur/Pokehub/HEAD/app/src/main/res/drawable/appicon.png -------------------------------------------------------------------------------- /app/src/main/res/font/manropemedium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TayfunCesur/Pokehub/HEAD/app/src/main/res/font/manropemedium.ttf -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 250dp 4 | -------------------------------------------------------------------------------- /app/src/main/graphql/com/tayfuncesur/pokehub/API.graphql: -------------------------------------------------------------------------------- 1 | query PokemonRepository($first:Int!){ 2 | pokemons(first:$first) { 3 | id 4 | image 5 | name 6 | } 7 | } -------------------------------------------------------------------------------- /app/src/main/java/com/tayfuncesur/pokehub/util/Const.kt: -------------------------------------------------------------------------------- 1 | package com.tayfuncesur.pokehub.util 2 | 3 | var BASE_URL = "https://graphql-pokemon.now.sh/" 4 | const val SPLASH_SCREEN_DELAY = 1500L -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/tayfuncesur/pokehub/base/Repository.kt: -------------------------------------------------------------------------------- 1 | package com.tayfuncesur.pokehub.base 2 | 3 | import io.reactivex.disposables.Disposable 4 | 5 | interface Repository { 6 | 7 | fun addDisposable(disposable: Disposable) 8 | 9 | fun clear() 10 | 11 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Apr 13 22:12:41 EET 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/tayfuncesur/pokehub/base/Resource.kt: -------------------------------------------------------------------------------- 1 | package com.tayfuncesur.pokehub.base 2 | 3 | sealed class Resource { 4 | class Loading : Resource() 5 | data class Success(val data: T?) : Resource() 6 | data class Failure(val cause: String?) : Resource() 7 | } -------------------------------------------------------------------------------- /app/src/main/java/com/tayfuncesur/pokehub/di/AppInjector.kt: -------------------------------------------------------------------------------- 1 | package com.tayfuncesur.pokehub.di 2 | 3 | import com.tayfuncesur.pokehub.App 4 | 5 | object AppInjector { 6 | fun init(app: App) { 7 | DaggerAppComponent.builder().application(app) 8 | .build().inject(app) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/tayfuncesur/pokehub/di/module/FragmentModule.kt: -------------------------------------------------------------------------------- 1 | package com.tayfuncesur.pokehub.di.module 2 | 3 | import com.tayfuncesur.pokehub.ui.detail.PokemonDetailFragment 4 | import dagger.Module 5 | import dagger.android.ContributesAndroidInjector 6 | 7 | @Suppress("unused") 8 | @Module 9 | abstract class FragmentModule { 10 | 11 | @ContributesAndroidInjector 12 | abstract fun contributePokemonDetailFragment(): PokemonDetailFragment 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | #f44336 7 | #ffb74d 8 | #4caf50 9 | #000000 10 | #FFFFFF 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/tayfuncesur/pokehub/binding/BindingAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.tayfuncesur.pokehub.binding 2 | 3 | import android.databinding.BindingAdapter 4 | import android.view.View 5 | import android.widget.ImageView 6 | import com.bumptech.glide.Glide 7 | import com.bumptech.glide.request.RequestOptions 8 | 9 | object BindingAdapter { 10 | @JvmStatic 11 | @BindingAdapter("visibleGone") 12 | fun showHide(view: View, show: Boolean) { 13 | view.visibility = if (show) View.VISIBLE else View.GONE 14 | } 15 | 16 | 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/tayfuncesur/pokehub/di/module/AppModule.kt: -------------------------------------------------------------------------------- 1 | package com.tayfuncesur.pokehub.di.module 2 | 3 | import com.tayfuncesur.pokehub.ui.main.MainActivity 4 | import com.tayfuncesur.pokehub.ui.splash.SplashActivity 5 | import dagger.Module 6 | import dagger.android.ContributesAndroidInjector 7 | 8 | @Module 9 | abstract class AppModule { 10 | 11 | @ContributesAndroidInjector 12 | abstract fun bindSplashActivity() : SplashActivity 13 | 14 | @ContributesAndroidInjector(modules = [FragmentModule::class]) 15 | abstract fun bindMainActivity() : MainActivity 16 | 17 | 18 | } -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | PokeHub 3 | Loading Pokemons… 4 | An error has occurred 5 | Weight 6 | Height 7 | Resistant: 8 | Special Attacks 9 | Weaknesses 10 | Evolutions 11 | Getting Details.. 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 |