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
15 changes: 15 additions & 0 deletions Bank/.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 Bank/.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 Bank/.idea/compiler.xml

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

17 changes: 17 additions & 0 deletions Bank/.idea/deploymentTargetDropDown.xml

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

20 changes: 20 additions & 0 deletions Bank/.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 Bank/.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 Bank/.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 Bank/.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 Bank/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
64 changes: 64 additions & 0 deletions Bank/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import org.jetbrains.kotlin.storage.CacheResetOnProcessCanceled.enabled

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
}

android {
namespace = "com.jisellemartins.bank"
compileSdk = 33

defaultConfig {
applicationId = "com.jisellemartins.bank"
minSdk = 21
targetSdk = 33
versionCode = 1
versionName = "1.0"

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


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 {
//noinspection DataBindingWithoutKapt
dataBinding = true
}

}

dependencies {

implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.9.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
testImplementation("junit:junit:4.13.2")
testImplementation ("androidx.test:core:1.0.0")
testImplementation ("org.mockito:mockito-core:1.10.19")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
implementation ("io.insert-koin:koin-android:3.4.3")
implementation ("com.squareup.retrofit2:retrofit:2.9.0")
implementation ("com.google.code.gson:gson:2.10.1")
implementation("com.squareup.retrofit2:converter-gson:2.2.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1")
}
21 changes: 21 additions & 0 deletions Bank/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 Bank/app/release/app-release.apk
Binary file not shown.
20 changes: 20 additions & 0 deletions Bank/app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.jisellemartins.bank",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-release.apk"
}
],
"elementType": "File"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.jisellemartins.bank

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

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.jisellemartins.bank", appContext.packageName)
}
}
37 changes: 37 additions & 0 deletions Bank/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?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" />

<application
android:name=".BankAplication"
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.Bank"
tools:targetApi="31">
<activity
android:name=".ui.screens.DetailsUserActivity"
android:exported="false" />
<activity
android:name=".ui.screens.StatementsActivity"
android:exported="true"
android:theme="@style/Base.Theme.Bank" />
<activity
android:name=".ui.screens.LoginActivity"
android:exported="true"
android:theme="@style/Base.Theme.Bank">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

</manifest>
18 changes: 18 additions & 0 deletions Bank/app/src/main/java/com/jisellemartins/bank/BankAplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.jisellemartins.bank

import android.app.Application
import com.jisellemartins.bank.di.moduleGlobal
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.GlobalContext

class BankAplication:Application() {
override fun onCreate() {
super.onCreate()
GlobalContext.startKoin {
androidLogger()
androidContext(this@BankAplication)
modules(moduleGlobal)
}
}
}
18 changes: 18 additions & 0 deletions Bank/app/src/main/java/com/jisellemartins/bank/di/ModuleGlobal.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.jisellemartins.bank.di

import com.jisellemartins.bank.repositories.BankRepository
import com.jisellemartins.bank.service.BankService
import com.jisellemartins.bank.service.service
import com.jisellemartins.bank.viewmodel.LoginViewModel
import com.jisellemartins.bank.viewmodel.StatementsViewModel
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.dsl.module
import retrofit2.Retrofit

val moduleGlobal = module {
single<Retrofit> { service.api }
single<BankService> { get<Retrofit>().create(BankService::class.java)}
single<BankRepository> { BankRepository(get()) }
viewModel<LoginViewModel>{ LoginViewModel(get())}
viewModel<StatementsViewModel>{ StatementsViewModel(get()) }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.jisellemartins.bank.extensions

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData

fun <T> MutableLiveData<T>.toLiveData() = this as LiveData<T>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.jisellemartins.bank.model

data class Credencials(
val user: String = "",
val password: String = ""
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.jisellemartins.bank.model

class DetailsUser(
var id: String,
var loginId: String,
var account: String,
var balance: Int,
var user: User,
var statementsList: List<Statements>
)
9 changes: 9 additions & 0 deletions Bank/app/src/main/java/com/jisellemartins/bank/model/Login.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.jisellemartins.bank.model

class Login (
var user:String = "",
var password:String = ""
)



Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.jisellemartins.bank.model

class Statements (
var type:String,
var title:String,
var value: Double,
var date: String
)
7 changes: 7 additions & 0 deletions Bank/app/src/main/java/com/jisellemartins/bank/model/User.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.jisellemartins.bank.model

class User (
var id:String,
var user: String,
var message: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.jisellemartins.bank.network

sealed class Output<out Response> {
data class Success<out T>(val data: T?) : Output<T>()
data class Loading<out T>(val data: T? = null) : Output<T>()
data class Error<out T>(val data: T? = null) : Output<T>()
data class ErrorT<out T>(val error: Throwable) : Output<T>()
object NetworkError : Output<Nothing>()
}
Loading