Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions ExtractBank/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
3 changes: 3 additions & 0 deletions ExtractBank/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions ExtractBank/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions ExtractBank/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions ExtractBank/.idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions ExtractBank/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions ExtractBank/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ExtractBank/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
77 changes: 77 additions & 0 deletions ExtractBank/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
}

android {
namespace = "fingerfire.com.extractbank"
compileSdk = 34

defaultConfig {
applicationId = "fingerfire.com.extractbank"
minSdk = 19
targetSdk = 33
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

multiDexEnabled = true
}

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

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
viewBinding = true
}
}

dependencies {

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.10.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")

//Retrofit
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")

//OkHttp
implementation("com.squareup.okhttp3:okhttp:4.11.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.11.0")

//MVVM e LiveData
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.2")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")

//Koin
implementation("io.insert-koin:koin-core:3.4.3")
implementation("io.insert-koin:koin-android:3.4.3")

//Mockito
testImplementation("org.mockito:mockito-core:5.6.0")

//Test Kotlin
testImplementation("junit:junit:4.13.2")
testImplementation("androidx.test:core:1.5.0")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
testImplementation("androidx.arch.core:core-testing:2.2.0")
}
21 changes: 21 additions & 0 deletions ExtractBank/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Binary file added ExtractBank/app/release/app-debug.apk
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package fingerfire.com.extractbank

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.*
import org.junit.Test
import org.junit.runner.RunWith

/**
* 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("fingerfire.com.extractbank", appContext.packageName)
}
}
35 changes: 35 additions & 0 deletions ExtractBank/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

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

<application
android:name=".ExtractBankApplication"
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.ExtractBank"
tools:targetApi="31">
<activity
android:name=".features.statements.ui.StatementActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".features.login.ui.LoginActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package fingerfire.com.extractbank

import android.app.Application
import fingerfire.com.extractbank.di.ApiModules
import fingerfire.com.extractbank.di.DataModule
import fingerfire.com.extractbank.di.NetworkModules
import fingerfire.com.extractbank.di.UiModules
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.startKoin

class ExtractBankApplication : Application() {
override fun onCreate() {
super.onCreate()

startKoin {
androidContext(this@ExtractBankApplication)
modules(
listOf(
NetworkModules().getNetworkModules(),
ApiModules().getApiModules(),
UiModules().getViewModules(),
DataModule().getDataModules()
)
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package fingerfire.com.extractbank.api

import fingerfire.com.extractbank.features.statements.data.StatementsResponse
import fingerfire.com.extractbank.model.Login
import fingerfire.com.extractbank.model.User
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path

interface BankApi {
@POST("api/v1/login")
suspend fun login(
@Body login: Login
): Response<User>

@GET("api/v1/login/{loginId}/statement")
suspend fun getStatement(
@Path("loginId") id: String
): Response<List<StatementsResponse>>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package fingerfire.com.extractbank.di

import fingerfire.com.extractbank.api.BankApi
import org.koin.dsl.module
import retrofit2.Retrofit

class ApiModules {
fun getApiModules() = module {
factory<BankApi> {
get<Retrofit>().create(BankApi::class.java)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package fingerfire.com.extractbank.di

import android.app.Application
import android.content.SharedPreferences
import fingerfire.com.extractbank.features.login.data.LoginRepository
import fingerfire.com.extractbank.features.statements.data.StatementRepository
import org.koin.android.ext.koin.androidApplication
import org.koin.dsl.module

class DataModule {
private fun getSharedPrefs(androidApplication: Application): SharedPreferences {
return androidApplication.getSharedPreferences(
"default",
android.content.Context.MODE_PRIVATE
)
}

fun getDataModules() = module {
single {
getSharedPrefs(androidApplication())
}

single<SharedPreferences.Editor> {
getSharedPrefs(androidApplication()).edit()
}
factory {
LoginRepository(get(), get())
}

factory {
StatementRepository(get())
}
}
}
Loading