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
Binary file added .DS_Store
Binary file not shown.
14 changes: 14 additions & 0 deletions TesteAndroid/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*.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
17 changes: 17 additions & 0 deletions TesteAndroid/.idea/$CACHE_FILE$

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

1 change: 1 addition & 0 deletions TesteAndroid/.idea/.name

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

122 changes: 122 additions & 0 deletions TesteAndroid/.idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions TesteAndroid/.idea/codeStyles/codeStyleConfig.xml

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

6 changes: 6 additions & 0 deletions TesteAndroid/.idea/dictionaries

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

21 changes: 21 additions & 0 deletions TesteAndroid/.idea/gradle.xml

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

25 changes: 25 additions & 0 deletions TesteAndroid/.idea/jarRepositories.xml

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

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

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

12 changes: 12 additions & 0 deletions TesteAndroid/.idea/runConfigurations.xml

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

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

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

33 changes: 33 additions & 0 deletions TesteAndroid/READ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Overview sobre o projeto

Seguem algumas considerações sobre a arquitetura utilizada no projeto:

Utilizei MVVMClean como arquitetura, separando as camadas em Fragment, ViewModel, Handler e Presenter.

Segue um resumo da responsabilidade de cada camada:
- No fragment ficam basicamente os observers dos objetos LiveData adicionados nas ViewModels e nos ViewPresenters, atualizando os dados da
interface diretamente no xml, utilizando databinding.
- Na ViewModel ficam os objetos LiveData, os eventos de click de botão e as funções que controlam as ações do usuário, de acordo com ação de cada view.
Também ficam na ViewModel as requisições ao serviço, por meio da classe Handler.
- Por sua vez, a classe Handler é responsável por trabalhar com os dados requisitados pelo usuário. Sejam eles por meio de input de dados ou ações/requisições.
- É nela onde são feitas as chamadas à classe Service, que por sua vez busca/envia os dados usando a classe Repository.
- Também é nela onde enviam-se os dados trabalhados para objetos na classe Presenter, que por sua vez guarda dados de input,
estados das Views (selected, enabled), label texts, etc. e gerencia estados de componentes através de objetos LiveData.

Utilizei injeção de dependência com a biblioteca Koin, que também foi utilizada nas rotinas de teste, utilizando a classe KoinTest.
Para as reqisições à API utilizei Retrofit.

### # Observações gerais

Na tela de login, há a validação de usuário e senha, onde para habilitar o botão de login, é necessário digitar os dados de acordo com a validação
sugerida (nome de usuário utilizando email ou cpf, e senha com ao menos 1 número, 1 caractere especial e uma letra maiúscula).
Fiz a validação desta maneira e não após o toque no botão de Sign in pois acredito que neste cenário entende-se que o usuário á está cadastrado e sabe
das regras de cadastro de nome de usuário e senha.

*Para executar o projeto basta abrir no Android Studio, aguardar o gradle sincronizar as dependências e executar o mesmo.

# OBRIGADO PELA OPORTUNIDADE!

#MARLON

#Estou me candidatando através da empresa HProjekt. Recrutador/Contato: Luiz Pontes.
1 change: 1 addition & 0 deletions TesteAndroid/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
62 changes: 62 additions & 0 deletions TesteAndroid/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: "androidx.navigation.safeargs.kotlin"

android {
compileSdkVersion 29

buildFeatures {
dataBinding = true
}

defaultConfig {
applicationId "br.com.mdr.testeandroid"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'

implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'

// Koin
implementation "org.koin:koin-androidx-scope:2.1.6"
implementation "org.koin:koin-androidx-viewmodel:2.1.1"
testImplementation "org.koin:koin-test:2.1.6"

// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'

// OkHttp
implementation "com.squareup.okhttp3:logging-interceptor:3.12.1"

testImplementation 'android.arch.core:core-testing:1.1.1'
testImplementation 'junit:junit:4.12'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.7'

androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
21 changes: 21 additions & 0 deletions TesteAndroid/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
Loading