-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ab3c4bc
Showing
167 changed files
with
3,984 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: main | ||
'on': | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
apk: | ||
name: Generate APK | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.4.0 | ||
- name: Setup JDK | ||
uses: actions/setup-java@v2.5.0 | ||
with: | ||
distribution: temurin | ||
java-version: '17' | ||
- name: Set execution flag for gradlew | ||
run: chmod +x gradlew | ||
- name: Build APK | ||
run: bash ./gradlew assembleDebug --stacktrace | ||
- name: Upload APK | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: apk | ||
path: app/build/outputs/apk/debug/app-debug.apk | ||
release: | ||
name: Release APK | ||
needs: apk | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download APK from build | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: apk | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | ||
with: | ||
tag_name: ${{ github.ref_name }} | ||
release_name: '${{ github.event.repository.name }} v${{ github.ref_name }}' | ||
- name: Upload Release APK | ||
id: upload_release_asset | ||
uses: actions/upload-release-asset@v1.0.1 | ||
env: | ||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | ||
with: | ||
upload_url: '${{ steps.create_release.outputs.upload_url }}' | ||
asset_path: apk/app-debug.apk | ||
asset_name: '${{ github.event.repository.name }}.apk' | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Base | ||
.gradle | ||
/local.properties | ||
.DS_Store | ||
/build | ||
/captures | ||
.cxx | ||
|
||
# Built application files | ||
*.apk | ||
*.ap_ | ||
|
||
# Files for the ART/Dalvik VM | ||
*.dex | ||
|
||
# Java class files | ||
*.class | ||
|
||
# Generated files | ||
bin/ | ||
gen/ | ||
out/ | ||
|
||
# Gradle files | ||
/.idea | ||
.gradle/ | ||
build/ | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Proguard folder generated by Eclipse | ||
proguard/ | ||
|
||
# Log Files | ||
*.log | ||
|
||
# Android Studio Navigation editor temp files | ||
.navigation/ | ||
|
||
# Android Studio captures folder | ||
captures/ | ||
|
||
# Intellij | ||
*.iml | ||
.idea/workspace.xml | ||
.idea/tasks.xml | ||
.idea/gradle.xml | ||
.idea/dictionaries | ||
.idea/libraries | ||
/.idea/caches | ||
/.idea/modules.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
app/.idea/ | ||
|
||
# Mac | ||
*.DS_Store | ||
|
||
# Keystore files | ||
*.jks | ||
|
||
# External native build folder generated in Android Studio 2.2 and later | ||
.externalNativeBuild | ||
|
||
# Google Services (e.g. APIs or Firebase) | ||
google-services.json | ||
|
||
# Freeline | ||
freeline.py | ||
freeline/ | ||
freeline_project_description.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Pokédex using Jetpack Compose | ||
[![Android Arsenal](https://img.shields.io/badge/X-mike14u-blue.svg)](https://www.x.com/mike14u) | ||
[![Android Arsenal](https://img.shields.io/badge/Github-mike14u-ff69b4.svg)](https://github.com/mike14u) | ||
|
||
A Pokémon list project that exhibits the next generation way for us to build our multi-module Android Applications using Jetpack Compose, Hilt, Clean Architecture, Kotlin Flow and more... | ||
|
||
<p align="center"> | ||
<img src="https://raw.githubusercontent.com/mike14u/pokedex/main/images/showcase.png" /> | ||
</p> | ||
|
||
## Overview | ||
|
||
This project will be helpful for many things both Pokémon and Tech, building with Jetpack Compose | ||
|
||
<img src="https://raw.githubusercontent.com/mike14u/pokedex/main/images/gif.gif" height="800" /> | ||
|
||
### Pokédex Features | ||
* **List of Pokémon:** #1010 as of the moment since the 5 others are newly released no further info is provided | ||
* **Shiny Pokémon Image:** Get to see what their shiny form looks like in the details page | ||
* **Search Pokémon:** Either search by their name or number | ||
* **Responsive Layout:** Supports both portrait and landscape orientation | ||
* **Android OS Support:** Supports Android Phones starting Nougat (Android 7.0 API Level 24) onwards | ||
|
||
### Tech Features | ||
<img src="https://raw.githubusercontent.com/mike14u/pokedex/main/images/directory.png" /> | ||
|
||
* **Multi-module:** App is multi-module ready to better isolate feature and layer modules that can be handled by big teams. Better way to reuse certain feature and spend less on build times as well | ||
* **Clean Architecture:** Uses modern android way of building using Clean Architecture | ||
|
||
<p align="center"> | ||
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQPxJYFYDDFI8-kdeuQrCEkocLizXyUhbsTyQ" width="400"/> | ||
<img src="https://developer.android.com/static/topic/libraries/architecture/images/mad-arch-overview.png" width="400"/> | ||
</p> | ||
<p align="center"> | ||
Each feature module is built with a sub-module that follows Domain, Data and UI | ||
</p> | ||
|
||
* **Navigation Across Multi-module Features:** Access different features from different module using composables | ||
* **Navigation Compose Deeplinks:** Shows an example on how to achieve deeplinks, parameterized deeplinks in Navigation Compose | ||
|
||
> Can be tested using Firefox Android App | ||
> Home or Main page use: | ||
> pokedex:// or any other such as pokedex://home | ||
> Details page use: | ||
> pokedex://pokemon/{id} where id is the pokemon number | ||
* **Coil Image Loading:** Attempt to load an image using Coil with or without loading animation | ||
* **CI/CD Using Github:** Utilizing Github Actions and Github Releases page for pipelines and deployment (uses debug apk but you can build release or sign as you like) | ||
* **R8:** Release and R8 ready, just make sure to generate your own keystore / signing capability | ||
* **Lib Versions Catalog:** Uses new lib.versions.toml versions catalog to manage dependencies and their versions | ||
|
||
## Built With | ||
|
||
This project is built using next generation tools supported by the latest Canary version of **Android Studio Hedgehog | 2023.1.1 Canary 15:**. It is very important that your Kotlin, K2 Compiler, Jetpack Compose Compiler and Hilt versions aligned. In this case I used **(Kotlin 1.9.0, Jetpack Compose Compiler 1.5.0, Hilt 2.47)** | ||
|
||
* **Android Studio Hedgehog:** IDE used | ||
* **Kotlin:** Programming Language | ||
* **K2 Compiler:** In preparation for Kotlin 2.0 | ||
* **Jetpack Compose:** UI Toolkit | ||
* **Jetpack Libraries:** Lifecycle, View Model, Material 3, Navigation Compose etc. | ||
* **Hilt:** Dependency Injection | ||
* **Coil:** Image Loading | ||
* **Retrofit & OkHttp:** Networking and API management | ||
* **Kotlin Coroutines & Kotlin Flow:** Asynchrounous tasks and management | ||
|
||
## Credits | ||
|
||
<p align="center"> | ||
<img src="https://cdn.dribbble.com/users/1767024/screenshots/16833947/media/c9ba6952aa78a2e8365a9c03c1feec41.jpg?resize=1000x750&vertical=center" /> | ||
</p> | ||
|
||
* Artwork and UI mockup reference: [https://dribbble.com/shots/16833947-Mobile-Pokedex-App-Design-Exploration](https://dribbble.com/shots/16833947-Mobile-Pokedex-App-Design-Exploration) | ||
* API and Splashscreen Icon: [https://pokeapi.co/](https://pokeapi.co/) | ||
* Splashscreen Main Icon: [https://icon-library.com/icon/pokedex-icon-21.html](https://icon-library.com/icon/pokedex-icon-21.html) | ||
* App Launcher Icon: [https://dribbble.com/shots/2947190-Poke-Ball-Pokedex](https://dribbble.com/shots/2947190-Poke-Ball-Pokedex) | ||
|
||
## License | ||
|
||
``` | ||
Copyright 2023 Mike Lau | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed | ||
plugins { | ||
alias(libs.plugins.androidApplication) | ||
alias(libs.plugins.kotlinAndroid) | ||
alias(libs.plugins.hilt) | ||
alias(libs.plugins.kotlinSerialization) | ||
id(libs.plugins.kotlinKapt.get().pluginId) | ||
} | ||
|
||
android { | ||
|
||
namespace = "com.mikelau.pokedex" | ||
compileSdk = 33 | ||
|
||
defaultConfig { | ||
applicationId = "com.mikelau.pokedex" | ||
minSdk = 24 | ||
targetSdk = 33 | ||
versionCode = 1 | ||
versionName = "1.0.0" | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
vectorDrawables { | ||
useSupportLibrary = true | ||
} | ||
} | ||
buildTypes { | ||
release { | ||
isDebuggable = false | ||
isMinifyEnabled = true | ||
isShrinkResources = true | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro", | ||
) | ||
} | ||
} | ||
lint { | ||
baseline = file("lint-baseline.xml") | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "17" | ||
} | ||
kotlin { | ||
jvmToolchain(17) | ||
} | ||
buildFeatures { | ||
compose = true | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.5.0" | ||
} | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
// Core Common | ||
implementation(project(":core:common")) | ||
implementation(project(":core:feature")) | ||
|
||
// Feature Pokemon List | ||
implementation(project(":feature:pokemon:ui")) | ||
implementation(project(":feature:pokemon:domain")) | ||
implementation(project(":feature:pokemon:data")) | ||
|
||
// Feature Pokemon Details | ||
implementation(project(":feature:pokemondetails:ui")) | ||
implementation(project(":feature:pokemondetails:domain")) | ||
implementation(project(":feature:pokemondetails:data")) | ||
|
||
// Libraries | ||
implementation(libs.core.ktx) | ||
implementation(libs.lifecycle.runtime.ktx) | ||
implementation(libs.activity.compose) | ||
implementation(platform(libs.compose.bom)) | ||
implementation(libs.ui) | ||
implementation(libs.ui.graphics) | ||
implementation(libs.ui.tooling.preview) | ||
implementation(libs.material3) | ||
implementation(libs.material.icons.extended) | ||
implementation(libs.navigation.compose) | ||
implementation(libs.splashscreen) | ||
implementation(libs.accompanist.systemuicontroller) | ||
implementation(libs.hilt) | ||
kapt(libs.hilt.compiler) | ||
testImplementation(libs.junit) | ||
androidTestImplementation(libs.androidx.test.ext.junit) | ||
androidTestImplementation(libs.espresso.core) | ||
androidTestImplementation(platform(libs.compose.bom)) | ||
androidTestImplementation(libs.ui.test.junit4) | ||
debugImplementation(libs.ui.tooling) | ||
debugImplementation(libs.ui.test.manifest) | ||
} |
Oops, something went wrong.