Skip to content

Commit

Permalink
Merge develop commits into main
Browse files Browse the repository at this point in the history
Release 1.0
  • Loading branch information
lhalegria authored Jun 28, 2023
2 parents e387429 + 063d0ee commit 0710937
Show file tree
Hide file tree
Showing 86 changed files with 1,463 additions and 428 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# Dogga
Simple Android Native Application consuming the https://dog.ceo/dog-api/

![Dogga App icon](app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp)

Simple Android Native Application consuming the [Dog API](https://dog.ceo/dog-api/)

This app is made just for portfolio and study purposes and it is in constant evolution.


It is made using:

- MVVM
- Jetpack Compose
- Retrofit
- JUnit4
- Mockk
- Kotlin DSL (kts script)
- Koin

66 changes: 0 additions & 66 deletions app/build.gradle

This file was deleted.

105 changes: 105 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import BuildSetup.APPLICATION_ID
import BuildSetup.BUILD_TOOLS_VERSION
import BuildSetup.COMPILE_SDK_VERSION
import BuildSetup.COMPOSE_KOTLIN_COMPILER
import BuildSetup.MIN_SDK_VERSION
import BuildSetup.NAMESPACE
import BuildSetup.TARGET_SDK_VERSION
import BuildSetup.TEST_INSTRUMENTATION_RUNNER
import BuildSetup.VERSION_CODE
import BuildSetup.VERSION_NAME

plugins {
id(Plugins.ANDROID_APPLICATION)
kotlin(Plugins.KOTLIN_ANDROID)
}

@Suppress("UnstableApiUsage")
android {
namespace = NAMESPACE
compileSdk = COMPILE_SDK_VERSION
buildToolsVersion = BUILD_TOOLS_VERSION

defaultConfig {
applicationId = APPLICATION_ID

minSdk = MIN_SDK_VERSION
targetSdk = TARGET_SDK_VERSION
versionCode = VERSION_CODE
versionName = VERSION_NAME

vectorDrawables.useSupportLibrary = true
testInstrumentationRunner = TEST_INSTRUMENTATION_RUNNER
}

buildTypes {
debug {
applicationIdSuffix = BuildTypeDebug.applicationIdSuffix
versionNameSuffix = BuildTypeDebug.versionNameSuffix
}

release {
isMinifyEnabled = BuildTypeRelease.isMinifyEnabled
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = COMPOSE_KOTLIN_COMPILER
}

packaging {
resources.excludes.addAll(
listOf("/META-INF/{AL2.0,LGPL2.1}")
)
}
}

dependencies {
implementation(AndroidX.CORE)
implementation(AndroidX.LIFECYCLE)
implementation(AndroidX.Compose.ACTIVITY)
implementation(platform(AndroidX.Compose.BOM))
implementation(AndroidX.Compose.LIFECYCLE)
implementation(AndroidX.Compose.UI)
implementation(AndroidX.Compose.UI_GRAPHICS)
implementation(AndroidX.Compose.UI_TOOLING)
implementation(AndroidX.Compose.MATERIAL_3)
implementation(AndroidX.Compose.NAVIGATION)

implementation(platform(Other.KOTLIN_BOM))
implementation(Other.COIL)

implementation(Koin.KOIN)
implementation(Koin.KOIN_COMPOSE)

implementation(Square.RETROFIT)
implementation(Square.OKHTTP)
implementation(Square.OKHTTP_LOG_INTERCEPTOR)
implementation(Square.GSON_CONVERTER)

testImplementation(Test.JUNIT)
testImplementation(Test.MOCKK)
testImplementation(Test.CORE_TESTING)
testImplementation(Test.COROUTINES)
androidTestImplementation(Test.ANDROIDX_JUNIT)
androidTestImplementation(Test.ESPRESSO)
androidTestImplementation(platform(AndroidX.Compose.BOM))
androidTestImplementation(Test.COMPOSE_UI_JUNIT4)

debugImplementation(AndroidX.Compose.UI_TOOLING)
debugImplementation(Test.COMPOSE_TEST_MANIFEST)
}
4 changes: 2 additions & 2 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand All @@ -18,4 +18,4 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
9 changes: 5 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

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

<application
android:name=".DoggaApp"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand All @@ -12,17 +15,15 @@
android:supportsRtl="true"
android:theme="@style/Theme.Dogga"
tools:targetApi="31">

<activity
android:name=".MainActivity"
android:name=".view.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Dogga">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Binary file added app/src/main/ic_launcher-playstore.webp
Binary file not shown.
46 changes: 0 additions & 46 deletions app/src/main/java/dev/lhalegria/dogga/MainActivity.kt

This file was deleted.

11 changes: 0 additions & 11 deletions app/src/main/java/dev/lhalegria/dogga/ui/theme/Color.kt

This file was deleted.

34 changes: 0 additions & 34 deletions app/src/main/java/dev/lhalegria/dogga/ui/theme/Type.kt

This file was deleted.

25 changes: 25 additions & 0 deletions app/src/main/kotlin/dev/lhalegria/dogga/DoggaApp.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package dev.lhalegria.dogga

import android.app.Application
import android.content.res.Resources
import dev.lhalegria.dogga.datasource.di.dataSourceModule
import dev.lhalegria.dogga.di.mainModule
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.startKoin

class DoggaApp : Application() {

override fun onCreate() {
super.onCreate()
appResources = this.resources
startKoin {
androidContext(this@DoggaApp)
modules(listOf(dataSourceModule, mainModule))
}
}

companion object {
lateinit var appResources: Resources
private set
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package dev.lhalegria.dogga.datasource.di

import dev.lhalegria.dogga.datasource.network.retrofitApi
import dev.lhalegria.dogga.datasource.service.BreedService
import org.koin.dsl.module

val dataSourceModule = module {

factory { retrofitApi }
factory { retrofitApi.create(BreedService::class.java) }
}
Loading

0 comments on commit 0710937

Please sign in to comment.