Skip to content

Commit

Permalink
Merge pull request #7 from manununhez/epic/1-custom-base-project
Browse files Browse the repository at this point in the history
epic/1-custom-base-project #1
  • Loading branch information
manununhez authored Apr 9, 2024
2 parents 25aaab5 + e878e7c commit 98fc73b
Show file tree
Hide file tree
Showing 55 changed files with 608 additions and 330 deletions.
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# PurrfectPics

PurrfectPics is your ultimate companion for discovering, customizing, and sharing adorable cat images on Android. With a wide range of features, PurrfectPics brings joy to every cat lover's heart.
PurrfectPics is your ultimate companion for discovering, customizing, and sharing adorable cat
images on Android. With a wide range of features, PurrfectPics brings joy to every cat lover's
heart.

## Features

- **Discover:** Explore a vast collection of random cat images sourced from the web.
- **Filter:** Narrow down your search with advanced filtering options based on tags, categories, and colors.
- **Customize:** Edit the appearance of cat images with built-in color editing tools, including brightness, contrast, and saturation adjustments.
- **Save Favorites:** Save your favorite cat images to easily revisit them later and create your personalized collection.
- **Share:** Share delightful cat images with friends, family, and fellow cat enthusiasts with just a tap.
- **Filter:** Narrow down your search with advanced filtering options based on tags, categories, and
colors.
- **Customize:** Edit the appearance of cat images with built-in color editing tools, including
brightness, contrast, and saturation adjustments.
- **Save Favorites:** Save your favorite cat images to easily revisit them later and create your
personalized collection.
- **Share:** Share delightful cat images with friends, family, and fellow cat enthusiasts with just
a tap.

## Screenshots

Expand All @@ -20,15 +26,17 @@ To get started with PurrfectPics, follow these steps:

1. Clone the repository to your local machine:
git clone [email protected]:manununhez/purrfect-pics.git


2. Open the project in Android Studio.

3. Build and run the app on your device or emulator.

## Contributing

We welcome contributions from the open-source community to help improve PurrfectPics. Whether you're a developer, designer, or cat lover with ideas to share, we'd love to have you onboard! Here are some ways you can contribute:
We welcome contributions from the open-source community to help improve PurrfectPics. Whether you're
a developer, designer, or cat lover with ideas to share, we'd love to have you onboard! Here are
some ways you can contribute:

- Submit bug reports or feature requests via GitHub issues.
- Fork the repository, make changes, and submit pull requests for review.
Expand All @@ -40,5 +48,6 @@ PurrfectPics is licensed under the [MIT License](LICENSE).

## About

PurrfectPics is developed and maintained by [Manuel Nuñez]. For inquiries, please contact [[email protected]].
PurrfectPics is developed and maintained by [Manuel Nuñez]. For inquiries, please
contact [[email protected]].

89 changes: 54 additions & 35 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,46 +1,65 @@
plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsKotlinAndroid)
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.hilt.gradle)
alias(libs.plugins.ksp)
}

android {
namespace = "com.manuelnunez.apps.purrfectpics"
compileSdk = 34
namespace = "com.manuelnunez.apps.purrfectpics"
compileSdk = 34

defaultConfig {
applicationId = "com.manuelnunez.apps.purrfectpics"
minSdk = 21
targetSdk = 34
versionCode = 1
versionName = "1.0"
defaultConfig {
applicationId = "com.manuelnunez.apps.purrfectpics"
minSdk = 21
targetSdk = 34
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

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

buildFeatures { compose = true }

composeOptions {
kotlinCompilerExtensionVersion = "1.5.2" // androidxComposeCompiler
}
}

dependencies {
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
implementation(projects.core.commonUi)

implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.core.ktx)

implementation(libs.androidx.activity.compose)

implementation(libs.androidx.compose.material3)

// Compose
val composeBom = platform(libs.androidx.compose.bom)
implementation(composeBom)
androidTestImplementation(composeBom)

// Hilt Dependency Injection
implementation(libs.hilt.android)
ksp(libs.hilt.compiler)

testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
package com.manuelnunez.apps.purrfectpics

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.manuelnunez.apps.purrfectpics", appContext.packageName)
}
}
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.manuelnunez.apps.purrfectpics", appContext.packageName)
}
}
15 changes: 13 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,25 @@
xmlns:tools="http://schemas.android.com/tools">

<application
android:name=".MainApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.PurrfectPics"
tools:targetApi="31" />
android:theme="@style/Theme.PurrfectPics.Splash"
tools:targetApi="31">

<activity
android:name=".MainActivity"
android:exported="true">
<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.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.manuelnunez.apps.purrfectpics

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.manuelnunez.apps.core.ui.theme.MainTheme
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class MainActivity : ComponentActivity() {
private val viewModel: SplashViewModel by viewModels()

override fun onCreate(savedInstanceState: Bundle?) {
val splashScreen = installSplashScreen()
super.onCreate(savedInstanceState)

splashScreen.setKeepOnScreenCondition { viewModel.isLoading.value }

setContent { MainTheme {} }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.manuelnunez.apps.purrfectpics

import android.app.Application
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp class MainApplication : Application()
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.manuelnunez.apps.purrfectpics

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch
import javax.inject.Inject

@HiltViewModel
class SplashViewModel @Inject constructor() : ViewModel() {

private val mutableStateFlow = MutableStateFlow(true)
val isLoading = mutableStateFlow.asStateFlow()

init {
viewModelScope.launch {
delay(2000)
mutableStateFlow.value = false
}
}
}
30 changes: 0 additions & 30 deletions app/src/main/res/drawable-v24/ic_launcher_foreground.xml

This file was deleted.

Loading

0 comments on commit 98fc73b

Please sign in to comment.