Skip to content

Commit

Permalink
Merge pull request #14 from Louiixx-h/improvement/update-readme
Browse files Browse the repository at this point in the history
Improvement/update readme
  • Loading branch information
Louiixx-h committed Oct 14, 2023
2 parents 1b349b7 + bbd8341 commit 5a9a084
Show file tree
Hide file tree
Showing 24 changed files with 205 additions and 60 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: cute-cat-gallery-ci-pipeline
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.0
- name: Setup Java JDK
uses: actions/setup-java@v3.13.0
with:
java-version: '17'
distribution: 'adopt'
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Gradle Build Action
uses: gradle/gradle-build-action@v2.9.0
with:
arguments: build
gradle-version: 7.6
- name: Run Tests
uses: gradle/gradle-build-action@v2.9.0
with:
arguments: test
gradle-version: 7.6
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.3
with:
name: CuteCatsGallery
path: app/build/outputs/apk/debug/app-debug.apk
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,5 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/java,linux,macos,windows,android,intellij,androidstudio
# End of https://www.gitignore.io/api/java,linux,macos,windows,android,intellij,androidstudio
/.idea/
6 changes: 0 additions & 6 deletions .idea/kotlinc.xml

This file was deleted.

119 changes: 114 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,118 @@
# Cute Cats Gallery
<a name="readme-top"></a>

Galeria de gatinhos fofos

<div>
<img src="./images/home.png" width="200"/>
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]

<br />
<div align="center">
<a href="https://github.com/othneildrew/Best-README-Template">
<img src="./app/src/main/ic_launcher-playstore.png" alt="Logo" width="80" height="80">
</a>

<h1 align="center">Cute Cats Gallery</h1>
</div>

<details>
<summary>Table of Contents</summary>
<ol>
<li>
<a href="#about-the-project">About The Project</a>
<ul>
<li><a href="#built-with">Built With</a></li>
</ul>
</li>
<li>
<a href="#getting-started">Getting Started</a>
<ul>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#installation">Installation</a></li>
</ul>
</li>
<li><a href="#usage">Usage</a></li>
<li><a href="#roadmap">Roadmap</a></li>
<li><a href="#contributing">Contributing</a></li>
<li><a href="#license">License</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#acknowledgments">Acknowledgments</a></li>
</ol>
</details>

## About The Project
<div>
<img src="./images/home.png" width="200"/>
<img src="./images/loading.png" width="200"/>
<img src="./images/error.png" width="200"/>
</div>

### Built With

* Kotlin
* Android Studio
* View Model
* Coroutines
* View Binding
* Koin
* Glide
* Retrofit
* Gson

## Clone project

```git clone https://github.dev/Louiixx-h/cute-cats-gallery-app```

## Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "improvement".
Don't forget to give the project a star! Thanks again!

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'feat: Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## Contact

Luis Henrique da Silva Moreira - [luis-henrique.dev](https://luis-henrique.dev/) - louix.sm@gmail.com

Project Link: [https://github.dev/Louiixx-h/cute-cats-gallery-app](https://github.dev/Louiixx-h/cute-cats-gallery-app)


<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[contributors-shield]: https://img.shields.io/github/contributors/othneildrew/Best-README-Template.svg?style=for-the-badge
[contributors-url]: https://github.com/othneildrew/Best-README-Template/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/othneildrew/Best-README-Template.svg?style=for-the-badge
[forks-url]: https://github.com/othneildrew/Best-README-Template/network/members
[stars-shield]: https://img.shields.io/github/stars/othneildrew/Best-README-Template.svg?style=for-the-badge
[stars-url]: https://github.com/othneildrew/Best-README-Template/stargazers
[issues-shield]: https://img.shields.io/github/issues/othneildrew/Best-README-Template.svg?style=for-the-badge
[issues-url]: https://github.com/othneildrew/Best-README-Template/issues
[license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=for-the-badge
[license-url]: https://github.com/othneildrew/Best-README-Template/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/luishenr-m
[product-screenshot]: images/screenshot.png
[Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white
[Next-url]: https://nextjs.org/
[React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB
[React-url]: https://reactjs.org/
[Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D
[Vue-url]: https://vuejs.org/
[Angular.io]: https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white
[Angular-url]: https://angular.io/
[Svelte.dev]: https://img.shields.io/badge/Svelte-4A4A55?style=for-the-badge&logo=svelte&logoColor=FF3E00
[Svelte-url]: https://svelte.dev/
[Laravel.com]: https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge&logo=laravel&logoColor=white
[Laravel-url]: https://laravel.com
[Bootstrap.com]: https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge&logo=bootstrap&logoColor=white
[Bootstrap-url]: https://getbootstrap.com
[JQuery.com]: https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge&logo=jquery&logoColor=white
[JQuery-url]: https://jquery.com

11 changes: 6 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

android {
compileSdk 31
compileSdk 33

viewBinding {
enabled = true
Expand All @@ -13,7 +13,7 @@ android {
defaultConfig {
applicationId "com.luishenrique.cutecatsgallery"
minSdk 21
targetSdk 31
targetSdkVersion 33
versionCode 1
versionName "1.0"

Expand All @@ -27,12 +27,13 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}
namespace 'com.luishenrique.cutecatsgallery'
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.luishenrique.cutecatsgallery">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<application
android:name=".App"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import android.graphics.drawable.Drawable
import com.luishenrique.cutecatsgallery.R
import java.io.File
import android.graphics.Bitmap
import android.graphics.drawable.BitmapDrawable
import android.os.Environment
import android.widget.ImageView
import android.widget.TextView
import kotlinx.coroutines.CoroutineScope
Expand All @@ -24,7 +26,9 @@ import java.lang.Exception
import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.CustomTarget
import com.bumptech.glide.request.target.Target
import com.bumptech.glide.request.transition.Transition
import com.google.android.material.progressindicator.CircularProgressIndicator

class HomeAdapter(
Expand Down Expand Up @@ -87,34 +91,34 @@ class HomeAdapter(
}

private fun downloadImage(imageURL: String?) {
// if (imageURL.isNullOrBlank() || !verifyPermissions()) return
// val dirPath: String = run {
// Environment.getExternalStorageDirectory().absolutePath +
// "/" + context.getString(R.string.app_name_storage)
// }
// val dir = File(dirPath)
// val fileName: String = imageURL.substring(
// imageURL.lastIndexOf('/') + 1
// )
//
// Glide.with(context)
// .load(imageURL)
// .into(object : CustomTarget<Drawable>() {
// override fun onResourceReady(
// resource: Drawable,
// transition: Transition<in Drawable>?
// ) {
// val bitmap: Bitmap = (resource as BitmapDrawable).bitmap
// Toast.makeText(
// context,
// "Salvando imagem...",
// Toast.LENGTH_SHORT
// ).show()
// saveImage(bitmap, dir, fileName)
// }
// override fun onLoadCleared(placeholder: Drawable?) {}
// override fun onLoadFailed(errorDrawable: Drawable?) {}
// })
if (imageURL.isNullOrBlank() || !verifyPermissions()) return
val dirPath: String = run {
Environment.getExternalStorageDirectory().absolutePath +
"/" + context.getString(R.string.app_name_storage)
}
val dir = File(dirPath)
val fileName: String = imageURL.substring(
imageURL.lastIndexOf('/') + 1
)

Glide.with(context)
.load(imageURL)
.into(object : CustomTarget<Drawable>() {
override fun onResourceReady(
resource: Drawable,
transition: Transition<in Drawable>?
) {
val bitmap: Bitmap = (resource as BitmapDrawable).bitmap
Toast.makeText(
context,
"Salvando imagem...",
Toast.LENGTH_SHORT
).show()
saveImage(bitmap, dir, fileName)
}
override fun onLoadCleared(placeholder: Drawable?) {}
override fun onLoadFailed(errorDrawable: Drawable?) {}
})
}

private fun saveImage(image: Bitmap, storageDir: File, imageFileName: String) {
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30"
def gradle_version = "7.4.2"
classpath "com.android.tools.build:gradle:$gradle_version"
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
13 changes: 6 additions & 7 deletions domain/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ plugins {
}

android {
compileSdk 31
compileSdk 33

defaultConfig {
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"
targetSdkVersion 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand All @@ -23,12 +21,13 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}
namespace 'com.luishenrique.domain'
}

dependencies {
Expand Down
3 changes: 1 addition & 2 deletions domain/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.luishenrique.domain">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.code.style=official
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 5a9a084

Please sign in to comment.