Skip to content

Commit c8b83bc

Browse files
committed
Initial launch
0 parents  commit c8b83bc

File tree

94 files changed

+2736
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2736
-0
lines changed

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
.cxx
15+
local.properties

.idea/compiler.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/deploymentTargetDropDown.xml

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
id 'kotlin-parcelize'
5+
id 'kotlin-kapt'
6+
}
7+
8+
apply from: '../shared_dependencies.gradle'
9+
10+
android {
11+
compileSdk 32
12+
13+
defaultConfig {
14+
applicationId 'com.cat'
15+
minSdk 21
16+
targetSdk 32
17+
versionCode 1
18+
versionName "1.0"
19+
20+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
21+
buildConfigField("String", "API_KEY", '"af46940d-54f1-43d3-a0b7-6ee3ae80c4c3"')
22+
}
23+
24+
buildTypes {
25+
release {
26+
minifyEnabled true
27+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
28+
}
29+
}
30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_1_8
32+
targetCompatibility JavaVersion.VERSION_1_8
33+
}
34+
kotlinOptions {
35+
jvmTarget = '1.8'
36+
}
37+
buildFeatures {
38+
viewBinding true
39+
}
40+
dynamicFeatures = [':favorite']
41+
}
42+
43+
dependencies {
44+
implementation project(":core")
45+
implementation 'androidx.appcompat:appcompat:1.4.2'
46+
implementation 'com.google.android.material:material:1.6.1'
47+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
48+
}

app/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

app/release/app-release.apk

10.9 MB
Binary file not shown.

app/release/output-metadata.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": 3,
3+
"artifactType": {
4+
"type": "APK",
5+
"kind": "Directory"
6+
},
7+
"applicationId": "com.cat",
8+
"variantName": "release",
9+
"elements": [
10+
{
11+
"type": "SINGLE",
12+
"filters": [],
13+
"attributes": [],
14+
"versionCode": 1,
15+
"versionName": "1.0",
16+
"outputFile": "app-release.apk"
17+
}
18+
],
19+
"elementType": "File"
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.cat
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.game", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
package="com.cat">
5+
6+
<uses-permission android:name="android.permission.INTERNET" />
7+
8+
<application
9+
android:name=".MyApplication"
10+
android:allowBackup="true"
11+
android:dataExtractionRules="@xml/data_extraction_rules"
12+
android:fullBackupContent="@xml/backup_rules"
13+
android:icon="@mipmap/ic_launcher"
14+
android:label="@string/app_name"
15+
android:roundIcon="@mipmap/ic_launcher_round"
16+
android:supportsRtl="true"
17+
android:theme="@style/Theme.Cat"
18+
tools:targetApi="31">
19+
<activity
20+
android:name=".activity.CatDetailActivity"
21+
android:exported="false" />
22+
<activity
23+
android:name=".activity.MainActivity"
24+
android:exported="true">
25+
<intent-filter>
26+
<action android:name="android.intent.action.MAIN" />
27+
28+
<category android:name="android.intent.category.LAUNCHER" />
29+
</intent-filter>
30+
</activity>
31+
</application>
32+
33+
</manifest>
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.cat
2+
3+
import com.cat.viewmodel.CatViewModel
4+
import com.cat.core.usecase.CatInteractor
5+
import com.cat.core.usecase.CatUseCase
6+
import org.koin.androidx.viewmodel.dsl.viewModel
7+
import org.koin.dsl.module
8+
9+
val useCaseModule = module {
10+
factory<CatUseCase> { CatInteractor(get()) }
11+
}
12+
13+
val viewModelModule = module {
14+
viewModel { CatViewModel(get()) }
15+
}

app/src/main/java/com/cat/Display.kt

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.cat
2+
3+
import android.content.Context
4+
import android.widget.ImageView
5+
import androidx.cardview.widget.CardView
6+
import com.bumptech.glide.Glide
7+
8+
fun placeImage(context: Context, image: String, imageView: ImageView) {
9+
Glide.with(context)
10+
.load(image)
11+
.into(imageView)
12+
//.placeholder(R.drawable.ic_baseline_person_24)
13+
//.error(R.drawable.ic_baseline_error_24)
14+
}
15+
16+
fun placeImage(context: CardView, image: String, imageView: ImageView) {
17+
Glide.with(context)
18+
.load(image)
19+
.into(imageView)
20+
//.placeholder(R.drawable.ic_baseline_person_24)
21+
//.error(R.drawable.ic_baseline_error_24)
22+
}
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.cat
2+
3+
import android.app.Application
4+
import com.cat.core.databaseModule
5+
import com.cat.core.networkModule
6+
import com.cat.core.repositoryModule
7+
import org.koin.android.ext.koin.androidContext
8+
import org.koin.core.context.startKoin
9+
10+
open class MyApplication : Application() {
11+
override fun onCreate() {
12+
super.onCreate()
13+
14+
startKoin {
15+
androidContext(this@MyApplication)
16+
modules(
17+
listOf(
18+
databaseModule,
19+
networkModule,
20+
repositoryModule,
21+
useCaseModule,
22+
viewModelModule
23+
))
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)