diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..c71cd77e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+
+SantanderTeste/.idea/codeStyles/Project.xml
+SantanderTeste/.idea/gradle.xml
+SantanderTeste/.idea/jarRepositories.xml
+SantanderTeste/.idea/misc.xml
+SantanderTeste/.idea/vcs.xml
+SantanderTeste/.idea/codeStyles/Project.xml
+SantanderTeste/.idea/gradle.xml
+SantanderTeste/.idea/misc.xml
diff --git a/SantanderTeste/.gitignore b/SantanderTeste/.gitignore
new file mode 100644
index 00000000..fd45b12f
--- /dev/null
+++ b/SantanderTeste/.gitignore
@@ -0,0 +1,11 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches/build_file_checksums.ser
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/SantanderTeste/.idea/codeStyles/Project.xml b/SantanderTeste/.idea/codeStyles/Project.xml
new file mode 100644
index 00000000..30aa626c
--- /dev/null
+++ b/SantanderTeste/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/.idea/gradle.xml b/SantanderTeste/.idea/gradle.xml
new file mode 100644
index 00000000..7ac24c77
--- /dev/null
+++ b/SantanderTeste/.idea/gradle.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/.idea/misc.xml b/SantanderTeste/.idea/misc.xml
new file mode 100644
index 00000000..e0d5b93f
--- /dev/null
+++ b/SantanderTeste/.idea/misc.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/.idea/runConfigurations.xml b/SantanderTeste/.idea/runConfigurations.xml
new file mode 100644
index 00000000..7f68460d
--- /dev/null
+++ b/SantanderTeste/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/README.md b/SantanderTeste/README.md
new file mode 100644
index 00000000..e2501099
--- /dev/null
+++ b/SantanderTeste/README.md
@@ -0,0 +1,17 @@
+Commit V8 = MVP da aplicação 1.2.1 - testes unitários
+NEW: Refactor para Clean Arch + MVP
+//@TODO1: criar PDF da tela de investimento;
+
+
+1. para rodar a aplicação, clone o a aplicaçao na linha de comando?
+-> git clone https://github.com/alesefs/TesteAndroid.git
+
+2. abra no android studio como "open an existing Android Studio Project"
+
+3. ajuste o SDK para o caaminho do SDK instalado na sua máquina (deve vir o alerta assim que você abrir a aplicação)
+
+4. espere a atualização do gradle e rode a aplicação no emulador ou no device físico
+
+
+OBS.: caso tente no device físico, verifique se a opção de desenvolvedor está habilitada, se a depuração por USB
+também está habilitada.
diff --git a/SantanderTeste/app/.gitignore b/SantanderTeste/app/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/SantanderTeste/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/SantanderTeste/app/build.gradle b/SantanderTeste/app/build.gradle
new file mode 100644
index 00000000..870fc2c8
--- /dev/null
+++ b/SantanderTeste/app/build.gradle
@@ -0,0 +1,44 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 28
+ defaultConfig {
+ applicationId "com.example.alessandrofsouza.santanderapp"
+ minSdkVersion 19
+ targetSdkVersion 28
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ vectorDrawables.useSupportLibrary = true
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+ testOptions {
+ unitTests {
+ includeAndroidResources = true
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 'com.android.support:appcompat-v7:28.0.0'
+ implementation 'com.android.support.constraint:constraint-layout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ testImplementation 'org.mockito:mockito-core:2.7.22'
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ androidTestImplementation 'org.mockito:mockito-android:2.7.22'
+
+ implementation 'com.android.support:design:28.0.0'
+ implementation 'com.android.support:recyclerview-v7:28.0.0'
+
+ implementation 'com.squareup.retrofit2:retrofit:2.5.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
+
+ implementation 'com.github.vipulasri.layouttoimage:library:1.0.0'
+}
diff --git a/SantanderTeste/app/proguard-rules.pro b/SantanderTeste/app/proguard-rules.pro
new file mode 100644
index 00000000..f1b42451
--- /dev/null
+++ b/SantanderTeste/app/proguard-rules.pro
@@ -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
diff --git a/SantanderTeste/app/src/androidTest/java/com/example/alessandrofsouza/santanderapp/ExampleInstrumentedTest.java b/SantanderTeste/app/src/androidTest/java/com/example/alessandrofsouza/santanderapp/ExampleInstrumentedTest.java
new file mode 100644
index 00000000..465633ae
--- /dev/null
+++ b/SantanderTeste/app/src/androidTest/java/com/example/alessandrofsouza/santanderapp/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.alessandrofsouza.santanderapp;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.example.alessandrofsouza.santanderapp", appContext.getPackageName());
+ }
+}
diff --git a/SantanderTeste/app/src/main/AndroidManifest.xml b/SantanderTeste/app/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..8782d026
--- /dev/null
+++ b/SantanderTeste/app/src/main/AndroidManifest.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/MainActivity.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/MainActivity.java
new file mode 100644
index 00000000..7dc9c1f1
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/MainActivity.java
@@ -0,0 +1,33 @@
+package com.example.alessandrofsouza.santanderapp;
+
+import android.os.Bundle;
+import android.support.design.widget.TabLayout;
+import android.support.v4.view.PagerAdapter;
+import android.support.v4.view.ViewPager;
+import android.support.v7.app.AppCompatActivity;
+
+import com.example.alessandrofsouza.santanderapp.presentation.adapters.PageAdapter;
+
+public class MainActivity extends AppCompatActivity {
+
+ private static final String TAG = "Santander ";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ getSupportActionBar().hide();
+
+// PageAdapter adapter = new PageAdapter(getSupportFragmentManager());
+// adapter.add(new InvestmentPresenter(), getString(R.string.investimento));
+// adapter.add(new ContactPresenter(), getString(R.string.contato));
+
+ PagerAdapter adapter = new PageAdapter(this, getSupportFragmentManager());
+
+ ViewPager viewPager = findViewById(R.id.mainPage);
+ viewPager.setAdapter(adapter);
+
+ TabLayout tabLayout = findViewById(R.id.pageTab);
+ tabLayout.setupWithViewPager(viewPager);
+ }
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/data/service/ApiService.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/data/service/ApiService.java
new file mode 100644
index 00000000..3a7c5145
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/data/service/ApiService.java
@@ -0,0 +1,37 @@
+package com.example.alessandrofsouza.santanderapp.data.service;
+
+import com.example.alessandrofsouza.santanderapp.domain.model.ContactModel;
+import com.example.alessandrofsouza.santanderapp.domain.model.InvestmentModel;
+
+import java.util.Set;
+
+import retrofit2.Call;
+import retrofit2.Retrofit;
+import retrofit2.converter.gson.GsonConverterFactory;
+import retrofit2.http.GET;
+
+public class ApiService {
+
+ //private String BASE_URL = "https://floating-mountain-50292.herokuapp.com/";
+
+ public ServiceApi getApi() {
+ Retrofit retrofit = new Retrofit
+ .Builder()
+ .baseUrl(ServiceApi.BASE_URL)
+ .addConverterFactory(GsonConverterFactory.create())
+ .build();
+ return retrofit.create(ServiceApi.class);
+ }
+
+ public interface ServiceApi {
+
+ public static final String BASE_URL = "https://floating-mountain-50292.herokuapp.com";
+
+ @GET("/cells.json")
+ Call listCells();
+
+ @GET("/fund.json")
+ Call listInvestment();
+
+ }
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/Cell.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/Cell.java
new file mode 100644
index 00000000..9a1d2f70
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/Cell.java
@@ -0,0 +1,107 @@
+package com.example.alessandrofsouza.santanderapp.domain.model;
+
+import com.google.gson.annotations.Expose;
+
+public class Cell {
+
+ @Expose
+ public int id;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ @Expose
+ public int type;
+
+ public int getType() {
+ return type;
+ }
+
+ public void setType(int type) {
+ this.type = type;
+ }
+
+ @Expose
+ public String message;
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ @Expose
+ public String typefield;
+
+ public String getTypefield() {
+ return typefield;
+ }
+
+ public void setTypefield(String typefield) {
+ this.typefield = typefield;
+ }
+
+ @Expose
+ public boolean hidden;
+
+ public boolean isHidden() {
+ return hidden;
+ }
+
+ public void setHidden(boolean hidden) {
+ this.hidden = hidden;
+ }
+
+ @Expose
+ public int topSpacing;
+
+ public int getTopSpacing() {
+ return topSpacing;
+ }
+
+ public void setTopSpacing(int topSpacing) {
+ this.topSpacing = topSpacing;
+ }
+
+ @Expose
+ public int show;
+
+ public int getShow() {
+ return show;
+ }
+
+ public void setShow(int show) {
+ this.show = show;
+ }
+
+ @Expose
+ public boolean required;
+
+ public boolean isRequired() {
+ return required;
+ }
+
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+
+
+
+ private String editTextValue;
+
+ public String getEditTextValue() {
+ return editTextValue;
+ }
+
+ public void setEditTextValue(String editTextValue) {
+ this.editTextValue = editTextValue;
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/ContactModel.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/ContactModel.java
new file mode 100644
index 00000000..2b5900e9
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/ContactModel.java
@@ -0,0 +1,18 @@
+package com.example.alessandrofsouza.santanderapp.domain.model;
+
+import java.util.ArrayList;
+
+public class ContactModel {
+
+ //@Expose
+ public ArrayList cells;
+
+ public ArrayList getCells() {
+ return cells;
+ }
+
+ public void setCells(ArrayList cells) {
+ this.cells = cells;
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/Infos.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/Infos.java
new file mode 100644
index 00000000..ec7a2e99
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/Infos.java
@@ -0,0 +1,48 @@
+package com.example.alessandrofsouza.santanderapp.domain.model;
+
+import com.google.gson.annotations.Expose;
+
+public class Infos {
+
+ @Expose
+ public String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+
+ @Expose
+ public String data;
+
+ public String getData() {
+ return data;
+ }
+
+ public void setData(String data) {
+ this.data = data;
+ }
+
+
+
+ public String title;
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public Infos(String sTitle, String sName, String sData) {
+ title = sTitle;
+ name = sName;
+ data = sData;
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/InvestmentModel.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/InvestmentModel.java
new file mode 100644
index 00000000..993b7418
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/InvestmentModel.java
@@ -0,0 +1,20 @@
+package com.example.alessandrofsouza.santanderapp.domain.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class InvestmentModel {
+
+ @SerializedName("screen")
+ @Expose
+ public Screen screen;
+
+ public Screen getScreen() {
+ return screen;
+ }
+
+ public void setScreen(Screen screen) {
+ this.screen = screen;
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/MoreInfo.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/MoreInfo.java
new file mode 100644
index 00000000..1da1dd17
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/MoreInfo.java
@@ -0,0 +1,44 @@
+package com.example.alessandrofsouza.santanderapp.domain.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class MoreInfo {
+
+ @Expose
+ public MoreInfoValues month;
+
+ public MoreInfoValues getMonth() {
+ return month;
+ }
+
+ public void setMonth(MoreInfoValues month) {
+ this.month = month;
+ }
+
+
+ @Expose
+ public MoreInfoValues year;
+
+ public MoreInfoValues getYear() {
+ return year;
+ }
+
+ public void setYear(MoreInfoValues year) {
+ this.year = year;
+ }
+
+
+ @SerializedName("12months")
+ @Expose
+ public MoreInfoValues months12;
+
+ public MoreInfoValues getMonths12() {
+ return months12;
+ }
+
+ public void setMonths12(MoreInfoValues months12) {
+ this.months12 = months12;
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/MoreInfoValues.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/MoreInfoValues.java
new file mode 100644
index 00000000..33af63cc
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/MoreInfoValues.java
@@ -0,0 +1,29 @@
+package com.example.alessandrofsouza.santanderapp.domain.model;
+
+import com.google.gson.annotations.Expose;
+
+public class MoreInfoValues {
+
+ @Expose
+ public Double fund;
+
+ public Double getFund() {
+ return fund;
+ }
+
+ public void setFund(Double fund) {
+ this.fund = fund;
+ }
+
+ @Expose
+ public Double CDI;
+
+ public Double getCDI() {
+ return CDI;
+ }
+
+ public void setCDI(Double CDI) {
+ this.CDI = CDI;
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/Screen.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/Screen.java
new file mode 100644
index 00000000..cbe0fc34
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/domain/model/Screen.java
@@ -0,0 +1,128 @@
+package com.example.alessandrofsouza.santanderapp.domain.model;
+
+import com.google.gson.annotations.Expose;
+
+import java.util.ArrayList;
+
+public class Screen {
+
+ @Expose
+ public String title;
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+
+ @Expose
+ public String fundName;
+
+ public String getFundName() {
+ return fundName;
+ }
+
+ public void setFundName(String fundName) {
+ this.fundName = fundName;
+ }
+
+
+ @Expose
+ public String whatIs;
+
+ public String getWhatIs() {
+ return whatIs;
+ }
+
+ public void setWhatIs(String whatIs) {
+ this.whatIs = whatIs;
+ }
+
+
+ @Expose
+ public String definition;
+
+ public String getDefinition() {
+ return definition;
+ }
+
+ public void setDefinition(String definition) {
+ this.definition = definition;
+ }
+
+
+ @Expose
+ public String riskTitle;
+
+ public String getRiskTitle() {
+ return riskTitle;
+ }
+
+ public void setRiskTitle(String riskTitle) {
+ this.riskTitle = riskTitle;
+ }
+
+
+ @Expose
+ public int risk;
+
+ public int getRisk() {
+ return risk;
+ }
+
+ public void setRisk(int risk) {
+ this.risk = risk;
+ }
+
+
+ @Expose
+ public String infoTitle;
+
+ public String getInfoTitle() {
+ return infoTitle;
+ }
+
+ public void setInfoTitle(String infoTitle) {
+ this.infoTitle = infoTitle;
+ }
+
+
+ @Expose
+ public MoreInfo moreInfo;
+
+ public MoreInfo getMoreInfo() {
+ return moreInfo;
+ }
+
+ public void setMoreInfo(MoreInfo moreInfo) {
+ this.moreInfo = moreInfo;
+ }
+
+
+ @Expose
+ public ArrayList info;
+
+ public ArrayList getInfo() {
+ return info;
+ }
+
+ public void setInfo(ArrayList info) {
+ this.info = info;
+ }
+
+
+ @Expose
+ public ArrayList downInfo;
+
+ public ArrayList getDownInfo() {
+ return downInfo;
+ }
+
+ public void setDownInfo(ArrayList downInfo) {
+ this.downInfo = downInfo;
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/adapters/PageAdapter.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/adapters/PageAdapter.java
new file mode 100644
index 00000000..baffcda9
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/adapters/PageAdapter.java
@@ -0,0 +1,71 @@
+package com.example.alessandrofsouza.santanderapp.presentation.adapters;
+
+import android.content.Context;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentPagerAdapter;
+
+import com.example.alessandrofsouza.santanderapp.R;
+import com.example.alessandrofsouza.santanderapp.presentation.pages.contact.ContactFragment;
+import com.example.alessandrofsouza.santanderapp.presentation.pages.contact.ContactPresenter;
+import com.example.alessandrofsouza.santanderapp.presentation.pages.investment.InvestmentFragment;
+import com.example.alessandrofsouza.santanderapp.presentation.pages.investment.InvestmentPresenter;
+
+import java.util.ArrayList;
+
+public class PageAdapter extends FragmentPagerAdapter {
+
+ private ArrayList fragments = new ArrayList<>();
+ private ArrayList title = new ArrayList<>();
+ private Context context;
+
+ public PageAdapter(Context ctx, FragmentManager fm) {
+ super(fm);
+ context = ctx;
+ }
+
+// public void add(Fragment frag, String title) {
+// this.fragments.add(frag);
+// this.title.add(title);
+// }
+
+ @Override
+ public Fragment getItem(int i) {
+// return this.fragments.get(i);
+
+ switch (i) {
+ case 0:
+ InvestmentFragment fragment1 = InvestmentFragment.newInstance();
+ new InvestmentPresenter(fragment1);
+ return fragment1;
+
+ case 1:
+ ContactFragment fragment0 = ContactFragment.newInstance();
+ new ContactPresenter(fragment0);
+ return fragment0;
+
+ default:
+ return null;
+
+ }
+ }
+
+ @Override
+ public int getCount() {
+// return this.fragments.size();
+ return 2;
+ }
+
+ @Override
+ public CharSequence getPageTitle(int position) {
+// return this.title.get(position);
+ switch (position) {
+ case 0:
+ return context.getResources().getString(R.string.investimento);
+ case 1:
+ return context.getResources().getString(R.string.contato);
+ default:
+ return null;
+ }
+ }
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/base/BasePresenter.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/base/BasePresenter.java
new file mode 100644
index 00000000..ff94f6d9
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/base/BasePresenter.java
@@ -0,0 +1,5 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.base;
+
+public interface BasePresenter {
+ void init();
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/base/BaseView.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/base/BaseView.java
new file mode 100644
index 00000000..fb8e3c1d
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/base/BaseView.java
@@ -0,0 +1,5 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.base;
+
+public interface BaseView {
+ void setPresenter(T presenter);
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactActionView.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactActionView.java
new file mode 100644
index 00000000..34352d69
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactActionView.java
@@ -0,0 +1,11 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.contact;
+
+import android.view.View;
+
+interface ContactActionView {
+// void setTitle(String title);
+//
+// void setStarCount(int starCount);
+
+ void click(View itemView, int position);
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactAdapter.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactAdapter.java
new file mode 100644
index 00000000..16c05adb
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactAdapter.java
@@ -0,0 +1,123 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.contact;
+
+import android.support.annotation.NonNull;
+import android.support.design.widget.TextInputEditText;
+import android.support.design.widget.TextInputLayout;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.TextView;
+
+import com.example.alessandrofsouza.santanderapp.R;
+import com.example.alessandrofsouza.santanderapp.domain.model.Cell;
+import com.example.alessandrofsouza.santanderapp.presentation.utils.Constants;
+
+import java.util.ArrayList;
+
+public class ContactAdapter extends RecyclerView.Adapter {
+
+ private static final String TAG = "Santander ";
+ private ArrayList dataSet;
+ private Cell cell;
+ private final ContactListPresenter presenter;
+ private ContactActionView rowView0;
+
+
+
+
+ public ContactAdapter(ContactActionView listener) {
+ dataSet = new ArrayList<>();
+ cell = new Cell();
+ presenter = new ContactListPresenter(dataSet);
+ rowView0 = listener;
+ }
+
+
+ @NonNull
+ @Override
+ public ContactAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+ switch (i){
+ case Constants.TYPE_FIELD:
+ return new ContactAdapter.ViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_edit_text, viewGroup, false), rowView0);
+
+ case Constants.TYPE_SEND:
+ return new ContactAdapter.ViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_button_round, viewGroup, false), rowView0);
+
+ case Constants.TYPE_CHECKBOX:
+ return new ContactAdapter.ViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_checkbox, viewGroup, false), rowView0);
+
+ case Constants.TYPE_TEXT:
+ return new ContactAdapter.ViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_text, viewGroup, false), rowView0);
+
+ default:
+ //@TODO: change to ImageView or create 1 more field to
+ return new ContactAdapter.ViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_text, viewGroup, false), rowView0);
+ }
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ContactAdapter.ViewHolder viewHolder, int i) {
+ presenter.onBindRepositoryRowViewAtPosition(i, viewHolder);
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ cell = dataSet.get(position);
+ int viewType = cell.getType();
+ return viewType;
+ }
+
+ @Override
+ public int getItemCount() {
+ return presenter.getRepositoriesRowsCount();
+ }
+
+ public void addListContact(ArrayList cellList) {
+ dataSet.clear();
+ dataSet.addAll(cellList);
+ notifyDataSetChanged();
+ }
+
+ public boolean getValidatorForm() {
+ return presenter.getValidForm();
+ }
+
+ public void clearListContact() {
+ presenter.clearForm();
+ }
+
+
+ public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
+
+ public TextView textView;
+ public TextInputLayout textInputLayout;
+ public TextInputEditText textInputEditText;
+ public Button roundedButton;
+ public CheckBox checkBox;
+
+ public ContactActionView contactActionView;
+
+
+ public ViewHolder(@NonNull View itemView, ContactActionView listerner) {
+ super(itemView);
+ textView = itemView.findViewById(R.id.textView);
+ textInputLayout = itemView.findViewById(R.id.editTextLayout);
+ textInputEditText = itemView.findViewById(R.id.editTextInput);
+ roundedButton = itemView.findViewById(R.id.buttonRound);
+ checkBox = itemView.findViewById(R.id.checkBox);
+
+ contactActionView = listerner;
+ itemView.setOnClickListener(this);
+ }
+
+
+ @Override
+ public void onClick(View v) {
+ contactActionView.click(itemView, getAdapterPosition());
+ }
+
+ }
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactContract.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactContract.java
new file mode 100644
index 00000000..620e5d2e
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactContract.java
@@ -0,0 +1,19 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.contact;
+
+import com.example.alessandrofsouza.santanderapp.domain.model.Cell;
+import com.example.alessandrofsouza.santanderapp.presentation.pages.base.BasePresenter;
+import com.example.alessandrofsouza.santanderapp.presentation.pages.base.BaseView;
+
+import java.util.ArrayList;
+
+public interface ContactContract {
+
+ interface View extends BaseView {
+ void showContactCells(ArrayList cellList);
+ }
+
+ interface Presenter extends BasePresenter {
+ void getContactCells();
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactFragment.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactFragment.java
new file mode 100644
index 00000000..dea13857
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactFragment.java
@@ -0,0 +1,111 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.contact;
+
+import android.annotation.SuppressLint;
+import android.os.Bundle;
+import android.support.constraint.ConstraintLayout;
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+
+import com.example.alessandrofsouza.santanderapp.R;
+import com.example.alessandrofsouza.santanderapp.domain.model.Cell;
+
+import java.util.ArrayList;
+
+@SuppressLint("ValidFragment")
+public class ContactFragment extends Fragment implements ContactContract.View {
+
+ private static final String TAG = "Santander ";
+ private ContactContract.Presenter presenter;
+ private ContactAdapter contactAdapter;
+ private RecyclerView recyclerView;
+ private ContactListPresenter listPresenter0;
+ private ContactActionView rowView0;
+
+ private ConstraintLayout layout1;
+ private ConstraintLayout layout2;
+ private Button btnBack;
+
+
+ public static ContactFragment newInstance() {
+ return new ContactFragment();
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ super.onCreateView(inflater, container, savedInstanceState);
+ View view = inflater.inflate(R.layout.contact, container, false);
+
+ layout1 = view.findViewById(R.id.constLayout1);
+ layout2 = view.findViewById(R.id.constLayout2);
+ btnBack = view.findViewById(R.id.buttonBack);
+ recycleView(view);
+ returnContactLayout(view);
+
+ return view;
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+ presenter.init();
+ }
+
+ @Override
+ public void setPresenter(ContactContract.Presenter contractPresenter) {
+ presenter = contractPresenter;
+ }
+
+ @Override
+ public void showContactCells(ArrayList cellList) {
+ //Envia pro recycleView
+ contactAdapter.addListContact(cellList);
+ }
+
+ private void recycleView(View view) {
+ contractActionExtra();
+ recyclerView = view.findViewById(R.id.recycleViewContact);
+ recyclerView.setHasFixedSize(true);
+ LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
+ recyclerView.setLayoutManager(linearLayoutManager);
+ contactAdapter = new ContactAdapter(rowView0);
+ recyclerView.setAdapter(contactAdapter);
+ }
+
+
+
+ private void contractActionExtra() {
+ rowView0 = new ContactActionView() {
+ @Override
+ public void click(View itemView, int position) {
+// Log.i(TAG, "->: " + contactAdapter.getValidatorForm());
+ switch (position) {
+ case 5:
+ if (contactAdapter.getValidatorForm()) {
+ layout1.setVisibility(View.GONE);
+ layout2.setVisibility(View.VISIBLE);
+ }
+ break;
+ }
+ }
+ };
+ }
+
+ private void returnContactLayout(View view) {
+ btnBack = view.findViewById(R.id.buttonBack);
+ btnBack.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ contactAdapter.clearListContact();
+ layout1.setVisibility(View.VISIBLE);
+ layout2.setVisibility(View.GONE);
+ }
+ });
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactListPresenter.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactListPresenter.java
new file mode 100644
index 00000000..1d99ff1e
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactListPresenter.java
@@ -0,0 +1,304 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.contact;
+
+import android.content.res.Resources;
+import android.graphics.PorterDuff;
+import android.support.design.widget.TextInputEditText;
+import android.support.design.widget.TextInputLayout;
+import android.support.v4.content.res.ResourcesCompat;
+import android.text.Editable;
+import android.text.InputType;
+import android.text.TextWatcher;
+import android.util.TypedValue;
+import android.view.View;
+import android.widget.CheckBox;
+import android.widget.EditText;
+
+import com.example.alessandrofsouza.santanderapp.R;
+import com.example.alessandrofsouza.santanderapp.domain.model.Cell;
+import com.example.alessandrofsouza.santanderapp.presentation.utils.Constants;
+import com.example.alessandrofsouza.santanderapp.presentation.utils.EmailValidator;
+import com.example.alessandrofsouza.santanderapp.presentation.utils.NameValidator;
+import com.example.alessandrofsouza.santanderapp.presentation.utils.PhoneNumberFormat;
+import com.example.alessandrofsouza.santanderapp.presentation.utils.PhoneValidator;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+
+class ContactListPresenter {
+
+ private static final String TAG = "Santander ";
+ private final ArrayList dataCell;
+ private Resources resources;
+ private View view;
+ private Cell cell;
+
+ private ContactListPresenter listPresenter0;
+ private ContactActionView rowView0;
+ private ContactAdapter contactAdapter;
+
+ private boolean checkCheckbox = false;
+ private CheckBox checkBox;
+
+ private TextInputLayout editLayout;
+ private TextInputEditText editTextName;
+ private TextInputEditText editTextMail;
+ private TextInputEditText editTextPhone;
+
+ private PhoneNumberFormat phoneformat;
+
+
+
+ public ContactListPresenter(ArrayList dataCell) {
+ this.dataCell = dataCell;
+ }
+
+
+ public void onBindRepositoryRowViewAtPosition(int i, final ContactAdapter.ViewHolder viewHolder) {
+ cell = dataCell.get(i);
+ resources = viewHolder.itemView.getContext().getResources();
+ contactAdapter = new ContactAdapter(rowView0);
+
+// viewHolder.setTitle(cell.getMessage());
+
+ switch (cell.getType()) {
+
+ case Constants.TYPE_FIELD:
+ viewHolder.textInputLayout.setHint(cell.getMessage());
+ viewHolder.textInputLayout.setHint(cell.getMessage());
+ viewHolder.textInputLayout.setVisibility(cell.isHidden() ? View.GONE : View.VISIBLE);
+ viewHolder.textInputLayout.setId(cell.getId());
+ viewHolder.textInputLayout.setPadding(0, cell.getTopSpacing(), 0, 0);
+ viewHolder.textInputLayout.clearFocus();
+
+ switch (cell.getTypefield()) {
+
+ case Constants.TYPEFIELD_TEXT_T:
+ viewHolder.textInputEditText.setInputType(InputType.TYPE_CLASS_TEXT);
+ viewHolder.textInputEditText.setText(cell.getEditTextValue());
+ editTextName = viewHolder.textInputEditText;
+
+ editTextName.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+ NameValidator.validateName(editable);
+ styleNameField();
+ }
+
+ public boolean styleNameField() {
+ String nameInput = editTextName.getText().toString().trim();
+
+ if (nameInput.isEmpty()) {
+ editTextName.setError("Está vázio");
+ editTextName.getBackground().mutate().setColorFilter(resources.getColor(R.color.santanderRed), PorterDuff.Mode.SRC_ATOP);
+ return false;
+
+ } else if (!NameValidator.NAME_PATTERN.matcher(nameInput).matches()) {
+ editTextName.setError("Está incorreto");
+ editTextName.getBackground().mutate().setColorFilter(resources.getColor(R.color.santanderRed), PorterDuff.Mode.SRC_ATOP);
+ return false;
+
+ } else {
+ editTextName.setError(null);
+ editTextName.getBackground().mutate().setColorFilter(resources.getColor(R.color.santanderCorrect), PorterDuff.Mode.SRC_ATOP);
+ return true;
+ }
+ }
+ });
+ break;
+
+ case Constants.TYPEFIELD_TELNUMBER_T:
+ viewHolder.textInputEditText.setInputType(InputType.TYPE_CLASS_PHONE);
+ editTextPhone = viewHolder.textInputEditText;
+
+ phoneformat = new PhoneNumberFormat(new WeakReference(editTextPhone));
+ editTextPhone.addTextChangedListener(phoneformat);
+ editTextPhone.setSelection(editTextPhone.getText().length());
+
+ editTextPhone.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) { }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ stylePhoneField();
+ }
+ });
+
+ break;
+
+ case Constants.TYPEFIELD_EMAIL_T:
+ viewHolder.textInputEditText.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
+ editLayout = viewHolder.textInputLayout;
+ editTextMail = viewHolder.textInputEditText;
+
+
+ editTextMail.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+ EmailValidator.validateEmail(editable);
+ styleEmailField();
+ }
+
+ private boolean styleEmailField() {
+ String emailInput = editTextMail.getText().toString().trim();
+ if (emailInput.isEmpty()) {
+ editTextMail.setError("Está vázio");
+ editTextMail.getBackground().mutate().setColorFilter(resources.getColor(R.color.santanderRed), PorterDuff.Mode.SRC_ATOP);
+ return false;
+
+ } else if (!EmailValidator.EMAIL_PATTERN.matcher(emailInput).matches()) {
+ editTextMail.setError("Está incorreto");
+ editTextMail.getBackground().mutate().setColorFilter(resources.getColor(R.color.santanderRed), PorterDuff.Mode.SRC_ATOP);
+ return false;
+
+ } else {
+ editTextMail.setError(null);
+ editTextMail.getBackground().mutate().setColorFilter(resources.getColor(R.color.santanderCorrect), PorterDuff.Mode.SRC_ATOP);
+ return true;
+ }
+ }
+ });
+ break;
+
+ default:
+ viewHolder.textInputEditText.setInputType(InputType.TYPE_CLASS_TEXT);
+ break;
+ }
+
+ break;
+
+ case Constants.TYPE_TEXT:
+ viewHolder.textView.setText(cell.getMessage());
+ viewHolder.textView.setVisibility(cell.isHidden() ? View.GONE : View.VISIBLE);
+ viewHolder.textView.setId(cell.getId());
+ viewHolder.textView.setPadding(0, cell.getTopSpacing(), 0, cell.getTopSpacing());
+ viewHolder.textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension(R.dimen.txtRegular));
+ break;
+
+ case Constants.TYPE_CHECKBOX:
+ viewHolder.checkBox.setText(cell.getMessage());
+ viewHolder.checkBox.setVisibility(cell.isHidden() ? View.GONE : View.VISIBLE);
+ viewHolder.checkBox.setId(cell.getId());
+ viewHolder.checkBox.setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension(R.dimen.txtRegular));
+ viewHolder.checkBox.setTypeface(ResourcesCompat.getFont(viewHolder.itemView.getContext(), R.font.dinpro_medium));
+ viewHolder.checkBox.setPadding(0, cell.getTopSpacing(), 0, cell.getTopSpacing());
+ viewHolder.checkBox.setChecked(cell.isHidden());
+ viewHolder.checkBox.setOnCheckedChangeListener(null);
+
+ checkBox = viewHolder.checkBox;
+
+ viewHolder.checkBox.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View v) {
+ if(checkBox.isChecked()) {
+ checkCheckbox = true;
+ editLayout.setVisibility(View.VISIBLE);
+ } else {
+ checkCheckbox = false;
+ editLayout.setVisibility(View.GONE);
+ }
+ }
+ });
+ break;
+
+ case Constants.TYPE_SEND:
+ viewHolder.roundedButton.setText(cell.getMessage());
+ viewHolder.roundedButton.setVisibility(cell.isHidden() ? View.GONE : View.VISIBLE);
+ viewHolder.roundedButton.setId(cell.getId());
+ viewHolder.roundedButton.setPadding(0, cell.getTopSpacing(), 0, cell.getTopSpacing());
+ viewHolder.roundedButton.setOnClickListener(viewHolder);
+ break;
+
+ default:
+ //@TODO: change to ImageView or create 1 more field to
+ viewHolder.textView.setText(cell.getMessage());
+ viewHolder.textView.setVisibility(cell.isHidden() ? View.GONE : View.VISIBLE);
+ viewHolder.textView.setId(cell.getId());
+ viewHolder.textView.setPadding(0, cell.getTopSpacing(), 0, cell.getTopSpacing());
+ viewHolder.textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension(R.dimen.txtRegular));
+ break;
+ }
+ }
+
+
+ private void stylePhoneField() {
+
+ switch (phoneformat.STATE_PHONE_VALIDATOR) {
+ case "0":
+ editTextPhone.setError("Está vázio");
+ editTextPhone.getBackground().mutate().setColorFilter(resources.getColor(R.color.santanderRed), PorterDuff.Mode.SRC_ATOP);
+ break;
+ case "1":
+ editTextPhone.setError("Está incorreto");
+ editTextPhone.getBackground().mutate().setColorFilter(resources.getColor(R.color.santanderRed), PorterDuff.Mode.SRC_ATOP);
+ break;
+ case "2":
+ editTextPhone.setError(null);
+ editTextPhone.getBackground().mutate().setColorFilter(resources.getColor(R.color.santanderCorrect), PorterDuff.Mode.SRC_ATOP);
+ break;
+ default:
+ editTextPhone.setError("Está incorreto");
+ editTextPhone.getBackground().mutate().setColorFilter(resources.getColor(R.color.santanderRed), PorterDuff.Mode.SRC_ATOP);
+ break;
+ }
+ }
+
+
+ public int getRepositoriesRowsCount() {
+ return dataCell.size();
+ }
+
+
+ public boolean getValidForm() {
+ if (!checkCheckbox) {
+ if (NameValidator.NAME_PATTERN.matcher(editTextName.getText().toString().trim()).matches() && PhoneValidator.PHONE8_PATTERN.matcher(phoneformat.phoneNumbers.trim()).matches() ||
+ NameValidator.NAME_PATTERN.matcher(editTextName.getText().toString().trim()).matches() && PhoneValidator.PHONE9_PATTERN.matcher(phoneformat.phoneNumbers.trim()).matches()) {
+ return true;
+ } else {
+ return false;
+ }
+
+ } else {
+ if (NameValidator.NAME_PATTERN.matcher(editTextName.getText().toString().trim()).matches() && EmailValidator.EMAIL_PATTERN.matcher(editTextMail.getText().toString().trim()).matches() && PhoneValidator.PHONE8_PATTERN.matcher(phoneformat.phoneNumbers.trim()).matches() ||
+ NameValidator.NAME_PATTERN.matcher(editTextName.getText().toString().trim()).matches() && EmailValidator.EMAIL_PATTERN.matcher(editTextMail.getText().toString().trim()).matches() && PhoneValidator.PHONE9_PATTERN.matcher(phoneformat.phoneNumbers.trim()).matches()) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+
+
+ public void clearForm() {
+ editTextName.setText(null);
+ editTextName.setError("", null);
+ editTextName.getBackground().mutate().setColorFilter(resources.getColor(R.color.santanderLtGray), PorterDuff.Mode.SRC_ATOP);
+
+ editTextPhone.setText(null);
+ editTextPhone.setError("", null);
+ editTextPhone.getBackground().mutate().setColorFilter(resources.getColor(R.color.santanderLtGray), PorterDuff.Mode.SRC_ATOP);
+
+ checkBox.setChecked(false);
+
+ editLayout.setVisibility(View.GONE);
+ editTextMail.setText(null);
+ editTextMail.setError("", null);
+ editTextMail.getBackground().mutate().setColorFilter(resources.getColor(R.color.santanderLtGray), PorterDuff.Mode.SRC_ATOP);
+ }
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactPresenter.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactPresenter.java
new file mode 100644
index 00000000..837a4a16
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/contact/ContactPresenter.java
@@ -0,0 +1,53 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.contact;
+
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import com.example.alessandrofsouza.santanderapp.data.service.ApiService;
+import com.example.alessandrofsouza.santanderapp.domain.model.ContactModel;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class ContactPresenter implements ContactContract.Presenter{
+
+ private static final String TAG = "Santander ";
+ private ContactContract.View view;
+ private ApiService service;
+
+ public ContactPresenter(@NonNull ContactContract.View contractView) {
+ view = contractView;
+ view.setPresenter(this);
+ service = new ApiService();
+ }
+
+ @Override
+ public void init() {
+ getContactCells();
+ }
+
+ public void getContactCells() {
+ service.getApi().listCells().enqueue(new Callback() {
+ @NonNull
+ @Override
+ public void onResponse(Call call, Response response) {
+ if (response.isSuccessful()) {
+ ContactModel contactModel = response.body();
+ view.showContactCells(contactModel.getCells());
+
+ } else {
+ Log.e(TAG, "Error Unsuccessful " + response.errorBody());
+ }
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t) {
+ Log.e(TAG, "Error Failure " + t.getMessage());
+ }
+ });
+ }
+
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentAdapter.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentAdapter.java
new file mode 100644
index 00000000..e8319b5d
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentAdapter.java
@@ -0,0 +1,114 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.investment;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.support.annotation.NonNull;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.example.alessandrofsouza.santanderapp.R;
+import com.example.alessandrofsouza.santanderapp.domain.model.Screen;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+
+public class InvestmentAdapter extends RecyclerView.Adapter {
+
+ public ArrayList dataScreenSet;
+ private View view;
+ private Context context;
+ private Resources resources;
+ private Screen screen;
+ private final InvestmentListPresenter presenter;
+
+ public InvestmentAdapter() {
+ dataScreenSet = new ArrayList<>();
+ presenter = new InvestmentListPresenter(dataScreenSet);
+ }
+
+ @NonNull
+ @Override
+ public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+ view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.frame_layout_invest, viewGroup, false);
+ context = view.getContext();
+
+// recycleInfo(view, context);//chama o recycleView
+// recycleDownInfo(view, context);//chama o recycleView
+
+ return new ViewHolder(view);
+ }
+
+
+ @Override
+ public void onBindViewHolder(@NonNull InvestmentAdapter.ViewHolder viewHolder, int i) {
+ presenter.onBindRepositoryRowViewAtPosition(i, viewHolder);
+ }
+
+
+ @Override
+ public int getItemViewType(int position) {
+ return position;
+ }
+
+ @Override
+ public int getItemCount() {
+ return presenter.getRepositoriesRowsCount();
+ }
+
+ public void addListInvestment(Screen screen) {
+ dataScreenSet.clear();
+ dataScreenSet.addAll(Collections.singleton(screen));
+ notifyDataSetChanged();
+ }
+
+
+ public class ViewHolder extends RecyclerView.ViewHolder {
+
+ public TextView investTitle;
+ public TextView investFundName;
+ public TextView whatIs;
+ public TextView definition;
+ public TextView riskTitle;
+
+ public ImageView arrowRisk;
+ private View viewColors1;
+ private View viewColors2;
+ private View viewColors3;
+ private View viewColors4;
+ private View viewColors5;
+ public ArrayList viewRisk;
+
+ public TextView infoTitle;
+ public Button btnInvestment;
+
+
+ public ViewHolder(@NonNull View itemView) {
+ super(itemView);
+
+ investTitle = itemView.findViewById(R.id.investTitle);
+ investFundName = itemView.findViewById(R.id.investFundName);
+ whatIs = itemView.findViewById(R.id.whatIs);
+ definition = itemView.findViewById(R.id.definition);
+ riskTitle = itemView.findViewById(R.id.riskTitle);
+
+ arrowRisk = itemView.findViewById(R.id.arrowRisk);
+ viewColors1 = itemView.findViewById(R.id.viewColors1);
+ viewColors2 = itemView.findViewById(R.id.viewColors2);
+ viewColors3 = itemView.findViewById(R.id.viewColors3);
+ viewColors4 = itemView.findViewById(R.id.viewColors4);
+ viewColors5 = itemView.findViewById(R.id.viewColors5);
+ viewRisk = new ArrayList<>(Arrays.asList(null, viewColors1, viewColors2, viewColors3, viewColors4, viewColors5));
+
+ infoTitle = itemView.findViewById(R.id.infoTitle);
+
+ btnInvestment = itemView.findViewById(R.id.buttonRound);
+
+ }
+ }
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentContract.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentContract.java
new file mode 100644
index 00000000..2994a290
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentContract.java
@@ -0,0 +1,17 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.investment;
+
+import com.example.alessandrofsouza.santanderapp.domain.model.Screen;
+import com.example.alessandrofsouza.santanderapp.presentation.pages.base.BasePresenter;
+import com.example.alessandrofsouza.santanderapp.presentation.pages.base.BaseView;
+
+public interface InvestmentContract {
+
+ interface View extends BaseView {
+ void showInvestmentScreen(Screen screen);
+ }
+
+ interface Presenter extends BasePresenter {
+ void getInvestmentScreen();
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentFragment.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentFragment.java
new file mode 100644
index 00000000..e8af920d
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentFragment.java
@@ -0,0 +1,73 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.investment;
+
+import android.annotation.SuppressLint;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.Toast;
+
+import com.example.alessandrofsouza.santanderapp.R;
+import com.example.alessandrofsouza.santanderapp.domain.model.Screen;
+
+@SuppressLint("ValidFragment")
+public class InvestmentFragment extends Fragment implements InvestmentContract.View {
+
+ private InvestmentContract.Presenter presenter;
+ private InvestmentAdapter investmentAdapter;
+ private RecyclerView recyclerView;
+ public Button btnPrint;
+
+ public static InvestmentFragment newInstance() {
+ return new InvestmentFragment();
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ super.onCreateView(inflater, container, savedInstanceState);
+ View view = inflater.inflate(R.layout.investment, container, false);
+
+ recycleView(view);
+
+ btnPrint = view.findViewById(R.id.buttonPrint);
+ btnPrint.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Toast.makeText(getContext(), R.string.disable, Toast.LENGTH_SHORT).show();
+ }
+ });
+
+ return view;
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+ presenter.init();
+ }
+
+ @Override
+ public void setPresenter(InvestmentContract.Presenter investmentPresenter) {
+ presenter = investmentPresenter;
+ }
+
+
+ @Override
+ public void showInvestmentScreen(Screen screen) {
+ investmentAdapter.addListInvestment(screen);
+ }
+
+ private void recycleView(View view) {
+ recyclerView = view.findViewById(R.id.recycleViewInvestment);
+ recyclerView.setHasFixedSize(true);
+ LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
+ recyclerView.setLayoutManager(linearLayoutManager);
+ investmentAdapter = new InvestmentAdapter();
+ recyclerView.setAdapter(investmentAdapter);
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentInfoAdapter.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentInfoAdapter.java
new file mode 100644
index 00000000..9c9b769c
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentInfoAdapter.java
@@ -0,0 +1,89 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.investment;
+
+import android.content.res.Resources;
+import android.support.annotation.NonNull;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.example.alessandrofsouza.santanderapp.R;
+import com.example.alessandrofsouza.santanderapp.domain.model.Infos;
+
+import java.util.ArrayList;
+
+class InvestmentInfoAdapter extends RecyclerView.Adapter {
+
+
+ private static final String TAG = "Santander ";
+ private ArrayList dataSet;
+
+ public InvestmentInfoAdapter() {
+ dataSet = new ArrayList<>();
+ }
+
+ @NonNull
+ @Override
+ public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+ View viewText = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.invest_info, viewGroup, false);
+ return new ViewHolder(viewText);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull final InvestmentInfoAdapter.ViewHolder viewHolder, int i) {
+ //TODO: create holderPresenter
+
+ Infos info = dataSet.get(i);
+ Resources resources = viewHolder.itemView.getContext().getResources();
+
+ viewHolder.info_title.setText(info.getName());
+
+ if(info.getData() != null) {
+ viewHolder.buttonDown.setAlpha(0);
+ viewHolder.buttonDown.setClickable(false);
+ viewHolder.info_content.setText(info.getData());
+ } else {
+ viewHolder.info_content.setAlpha(0);
+ viewHolder.buttonDown.setText(resources.getText(R.string.baixar));
+ viewHolder.buttonDown.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Toast.makeText(viewHolder.itemView.getContext(), R.string.disable, Toast.LENGTH_SHORT).show();
+ }
+ });
+ }
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ return position;
+ }
+
+ @Override
+ public int getItemCount() {
+ return dataSet.size();
+ }
+
+ public void addListInfo(ArrayList listInfo) {
+ dataSet.addAll(listInfo);
+ notifyDataSetChanged();
+ }
+
+ public class ViewHolder extends RecyclerView.ViewHolder {
+
+ private TextView info_title;
+ private TextView info_content;
+ private Button buttonDown;
+
+ public ViewHolder(@NonNull View itemView) {
+ super(itemView);
+
+ info_title = itemView.findViewById(R.id.info_title);
+ info_content = itemView.findViewById(R.id.info_content);
+ buttonDown = itemView.findViewById(R.id.buttonDown);
+ }
+ }
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentListPresenter.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentListPresenter.java
new file mode 100644
index 00000000..311bece9
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentListPresenter.java
@@ -0,0 +1,141 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.investment;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.util.Log;
+import android.view.View;
+import android.view.ViewTreeObserver;
+import android.widget.Toast;
+
+import com.example.alessandrofsouza.santanderapp.R;
+import com.example.alessandrofsouza.santanderapp.domain.model.Infos;
+import com.example.alessandrofsouza.santanderapp.domain.model.MoreInfo;
+import com.example.alessandrofsouza.santanderapp.domain.model.Screen;
+
+import java.util.ArrayList;
+
+class InvestmentListPresenter {
+
+ private final ArrayList dataScreenSet;
+ private Resources resources;
+ private Screen screen;
+ private ViewTreeObserver observer;
+ private RecyclerView recyclerView;
+ private InvestmentInfoAdapter investmentInfoAdapter;
+ private InvestmentMoreInfoAdapter investmentmoreInfoAdapter;
+ private View view;
+ private Context context;
+
+
+ public InvestmentListPresenter(ArrayList dataScreen) {
+ this.dataScreenSet = dataScreen;
+ }
+
+ public void onBindRepositoryRowViewAtPosition(int i, final InvestmentAdapter.ViewHolder viewHolder) {
+ resources = viewHolder.itemView.getContext().getResources();
+ screen = dataScreenSet.get(i);
+
+ viewHolder.investTitle.setText(screen.getTitle());
+ viewHolder.investTitle.setPadding(0, ((int) resources.getDimension(R.dimen.lMargin)), 0, 0);
+
+ viewHolder.investFundName.setText(screen.getFundName());
+ viewHolder.investFundName.setPadding(0, ((int) resources.getDimension(R.dimen.mMargin)), 0, 0);
+
+ viewHolder.whatIs.setText(screen.getWhatIs());
+ viewHolder.whatIs.setPadding(0, ((int) resources.getDimension(R.dimen.sMargin)), 0, 0);
+
+ viewHolder.definition.setText(screen.getDefinition());
+ viewHolder.definition.setPadding(0, ((int) resources.getDimension(R.dimen.sMargin) / 2), 0, 0);
+
+ viewHolder.riskTitle.setText(screen.getRiskTitle());
+ viewHolder.riskTitle.setPadding(0, ((int) resources.getDimension(R.dimen.sMargin)), 0, 0);
+
+
+ observer = viewHolder.arrowRisk.getViewTreeObserver();
+ observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
+ @Override
+ public void onGlobalLayout() {
+ for (int j = 0; j < viewHolder.viewRisk.size(); j++) {
+ viewHolder.viewRisk.get(screen.getRisk()).setScaleY(2);
+ viewHolder.arrowRisk.setX(viewHolder.viewRisk.get(screen.getRisk()).getX() + viewHolder.viewRisk.get(screen.getRisk()).getPivotX() - viewHolder.arrowRisk.getWidth() / 3);
+ }
+ }
+ });
+
+
+ viewHolder.infoTitle.setText(screen.getInfoTitle());
+ viewHolder.infoTitle.setPadding(0, ((int) resources.getDimension(R.dimen.sMargin)), 0, 0);
+
+
+ viewHolder.btnInvestment.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Toast.makeText(viewHolder.itemView.getContext(), R.string.disable, Toast.LENGTH_SHORT).show();
+ }
+ });
+
+
+
+
+ recycleMoreInfo(viewHolder.itemView, context);//chama o recycleView
+ ArrayList moreInfo = addListInvestmentMoreInfo(screen.getMoreInfo());
+ investmentmoreInfoAdapter.addListMoreInfo(moreInfo);
+
+ recycleInfo(viewHolder.itemView, context);//chama o recycleView
+ ArrayList listInfo = screen.getInfo();
+ investmentInfoAdapter.addListInfo(listInfo);
+
+ recycleDownInfo(viewHolder.itemView, context);//chama o recycleView
+ ArrayList listDownInfo = screen.getDownInfo();
+ investmentInfoAdapter.addListInfo(listDownInfo);
+
+ }
+
+
+ private ArrayList addListInvestmentMoreInfo(MoreInfo moreInfo) {
+ ArrayList moreInfoList = new ArrayList<>();
+ moreInfoList.add(new Infos("", "Fundo", "CDI"));
+ moreInfoList.add(new Infos("No mês", moreInfo.getMonth().getFund().toString().concat("%"), moreInfo.getMonth().getCDI().toString().concat("%")));
+ moreInfoList.add(new Infos("No ano", moreInfo.getYear().getFund().toString().concat("%"), moreInfo.getYear().getCDI().toString().concat("%")));
+ moreInfoList.add(new Infos("12 meses", moreInfo.getMonths12().getFund().toString().concat("%"), moreInfo.getMonths12().getCDI().toString().concat("%")));
+
+ //Log.i("TAGX", ""+moreInfoList.size());
+ return moreInfoList;
+ }
+
+
+ public int getRepositoriesRowsCount() {
+ return dataScreenSet.size();
+ }
+
+
+ private void recycleMoreInfo(View view, Context context) {
+ recyclerView = view.findViewById(R.id.recycleViewMoreInfo);
+ investmentmoreInfoAdapter = new InvestmentMoreInfoAdapter();
+ recyclerView.setAdapter(investmentmoreInfoAdapter);
+ recyclerView.setHasFixedSize(true);
+ LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+ recyclerView.setLayoutManager(linearLayoutManager);
+ }
+
+
+ private void recycleInfo(View view, Context context) {
+ recyclerView = view.findViewById(R.id.recycleViewInfo);
+ investmentInfoAdapter = new InvestmentInfoAdapter();
+ recyclerView.setAdapter(investmentInfoAdapter);
+ recyclerView.setHasFixedSize(true);
+ LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+ recyclerView.setLayoutManager(linearLayoutManager);
+ }
+
+ private void recycleDownInfo(View view, Context context) {
+ recyclerView = view.findViewById(R.id.recycleViewDownInfo);
+ investmentInfoAdapter = new InvestmentInfoAdapter();
+ recyclerView.setAdapter(investmentInfoAdapter);
+ recyclerView.setHasFixedSize(true);
+ LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+ recyclerView.setLayoutManager(linearLayoutManager);
+ }
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentMoreInfoAdapter.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentMoreInfoAdapter.java
new file mode 100644
index 00000000..cc652b5f
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentMoreInfoAdapter.java
@@ -0,0 +1,75 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.investment;
+
+import android.content.res.Resources;
+import android.support.annotation.NonNull;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.example.alessandrofsouza.santanderapp.R;
+import com.example.alessandrofsouza.santanderapp.domain.model.Infos;
+
+import java.util.ArrayList;
+
+class InvestmentMoreInfoAdapter extends RecyclerView.Adapter {
+
+ private static final String TAG = "Santander ";
+ private ArrayList dataSet;
+
+ public InvestmentMoreInfoAdapter() {
+ dataSet = new ArrayList<>();
+ }
+
+ @NonNull
+ @Override
+ public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+ View viewText = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.invest_more_info, viewGroup, false);
+ return new InvestmentMoreInfoAdapter.ViewHolder(viewText);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i) {
+ //TODO: create holderPresenter
+ Infos info = dataSet.get(i);
+ Resources resources = viewHolder.itemView.getContext().getResources();
+
+ viewHolder.info_title.setText(info.getTitle());
+ viewHolder.info_fundo.setText(info.getName());
+ viewHolder.info_Cdi.setText(info.getData());
+
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ return position;
+ }
+
+ @Override
+ public int getItemCount() {
+ return dataSet.size();
+ }
+
+ public void addListMoreInfo(ArrayList moreInfo) {
+ dataSet.addAll(moreInfo);
+ notifyDataSetChanged();
+ }
+
+
+ public class ViewHolder extends RecyclerView.ViewHolder {
+
+ private TextView info_title;
+ private TextView info_fundo;
+ private TextView info_Cdi;
+
+
+ public ViewHolder(@NonNull View itemView) {
+ super(itemView);
+
+ info_title = itemView.findViewById(R.id.moreInfo_title);
+ info_fundo = itemView.findViewById(R.id.moreInfo_fundo);
+ info_Cdi = itemView.findViewById(R.id.moreInfo_cdi);
+ }
+ }
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentPresenter.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentPresenter.java
new file mode 100644
index 00000000..6a15571b
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/pages/investment/InvestmentPresenter.java
@@ -0,0 +1,52 @@
+package com.example.alessandrofsouza.santanderapp.presentation.pages.investment;
+
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import com.example.alessandrofsouza.santanderapp.data.service.ApiService;
+import com.example.alessandrofsouza.santanderapp.domain.model.InvestmentModel;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class InvestmentPresenter implements InvestmentContract.Presenter{
+
+ private static final String TAG = "Santander ";
+ private InvestmentContract.View view;
+ private ApiService service;
+
+ public InvestmentPresenter(@NonNull InvestmentContract.View investmentView) {
+ view = investmentView;
+ view.setPresenter(this);
+ service = new ApiService();
+ }
+
+ @Override
+ public void init() {
+ getInvestmentScreen();
+ }
+
+ @Override
+ public void getInvestmentScreen() {
+ service.getApi().listInvestment().enqueue(new Callback() {
+ @NonNull
+ @Override
+ public void onResponse(Call call, Response response) {
+ if (response.isSuccessful()) {
+ InvestmentModel investmentModel = response.body();
+
+ view.showInvestmentScreen(investmentModel.getScreen());
+ } else {
+ Log.e(TAG, "Error Unsuccessful " + response.errorBody());
+ }
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t) {
+ Log.e(TAG, "Error Failure " + t.getMessage());
+ }
+ });
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/Constants.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/Constants.java
new file mode 100644
index 00000000..871ff99e
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/Constants.java
@@ -0,0 +1,15 @@
+package com.example.alessandrofsouza.santanderapp.presentation.utils;
+
+public class Constants {
+
+ public static final int TYPE_FIELD = 1;
+ public static final int TYPE_TEXT = 2;
+ public static final int TYPE_IMAGE = 3;
+ public static final int TYPE_CHECKBOX = 4;
+ public static final int TYPE_SEND = 5;
+
+ public static final String TYPEFIELD_TEXT_T = "1";
+ public static final String TYPEFIELD_TELNUMBER_T = "telnumber";
+ public static final String TYPEFIELD_EMAIL_T = "3";
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/EmailValidator.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/EmailValidator.java
new file mode 100644
index 00000000..3626f435
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/EmailValidator.java
@@ -0,0 +1,20 @@
+package com.example.alessandrofsouza.santanderapp.presentation.utils;
+
+import java.util.regex.Pattern;
+
+public class EmailValidator {
+
+ public static final Pattern EMAIL_PATTERN = Pattern.compile(
+ ("[a-zA-Z0-9\\+\\.\\_\\%\\-\\+]{1,256}" +
+ "\\@" +
+ "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}" +
+ "(" +
+ "\\." +
+ "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25}" +
+ "){1,2}")
+ );
+
+ public static boolean validateEmail(CharSequence email) {
+ return email != null && EMAIL_PATTERN.matcher(email).matches();
+ }
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/NameValidator.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/NameValidator.java
new file mode 100644
index 00000000..d45da3d2
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/NameValidator.java
@@ -0,0 +1,15 @@
+package com.example.alessandrofsouza.santanderapp.presentation.utils;
+
+import java.util.regex.Pattern;
+
+public class NameValidator {
+
+ public static final Pattern NAME_PATTERN = Pattern.compile(
+ ("^[a-zA-ZáàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+(?:[\\s.]+[a-zA-ZáàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+)*${1,6}")
+ );
+
+ public static boolean validateName(CharSequence name) {
+ return name != null && NAME_PATTERN.matcher(name).matches();
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/PhoneNumberFormat.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/PhoneNumberFormat.java
new file mode 100644
index 00000000..492c4109
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/PhoneNumberFormat.java
@@ -0,0 +1,159 @@
+package com.example.alessandrofsouza.santanderapp.presentation.utils;
+
+import android.support.annotation.NonNull;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.widget.EditText;
+
+import java.lang.ref.WeakReference;
+
+public class PhoneNumberFormat implements TextWatcher {
+
+ private boolean mFormatting; // this is a flag which prevents the stack(onTextChanged)
+ private boolean clearFlag;
+ private int mLastStartLocation;
+ private String mLastBeforeText;
+ private WeakReference mWeakEditText;
+ private int MAX_SIZE = 10;
+ public String phoneNumbers;
+
+ public String STATE_PHONE_VALIDATOR = "0";
+
+
+ public PhoneNumberFormat(WeakReference editTextPhone) {
+ this.mWeakEditText = editTextPhone;
+ }
+
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ if (after == 0 && s.toString().equals("(")) {
+ clearFlag = true;
+ }
+ mLastStartLocation = start;
+ mLastBeforeText = s.toString();
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {}
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ // Make sure to ignore calls to afterTextChanged caused by the work done below
+ if (!mFormatting) {
+ mFormatting = true;
+ int curPos = mLastStartLocation;
+ String beforeValue = mLastBeforeText;
+ String currentValue = s.toString();
+ String formattedValue = formatPhone(s);
+ if (currentValue.length() > beforeValue.length()) {
+ int setCusorPos = formattedValue.length()
+ - (beforeValue.length() - curPos);
+ mWeakEditText.get().setSelection(setCusorPos < 0 ? 0 : setCusorPos);
+ } else {
+ int setCusorPos = formattedValue.length()
+ - (currentValue.length() - curPos);
+ if(setCusorPos > 0 && !Character.isDigit(formattedValue.charAt(setCusorPos -1))){
+ setCusorPos--;
+ }
+ mWeakEditText.get().setSelection(setCusorPos < 0 ? 0 : setCusorPos);
+ }
+ mFormatting = false;
+ stylePhoneField();
+ }
+ }
+
+ public String formatPhone(@NonNull Editable text) {
+ StringBuilder formattedString = new StringBuilder();
+
+ // Remove everything except digits
+ int p = 0;
+ while (p < text.length()) {
+ char ch = text.charAt(p);
+ if (!Character.isDigit(ch)) {
+ text.delete(p, p + 1);
+ } else {
+ p++;
+ }
+ }
+
+ // Now only digits are remaining
+ String allDigitString = text.toString();
+
+ int totalDigitCount = allDigitString.length();
+
+ //clean if dont have numbers
+ if (totalDigitCount == 0) {
+ text.clear();
+ text.append(allDigitString);
+ return allDigitString;
+ }
+
+ int alreadyPlacedDigitCount = 0;
+
+ // The first 2 numbers must be enclosed in brackets "()"
+ if (totalDigitCount - alreadyPlacedDigitCount > 2) {
+ formattedString.append("("
+ + allDigitString.substring(alreadyPlacedDigitCount,
+ alreadyPlacedDigitCount + 2) + ") ");
+ alreadyPlacedDigitCount += 2;
+ }
+
+ //dash"-" (valid BR 9 for mobile phones)
+ if (totalDigitCount - alreadyPlacedDigitCount > 5) {
+ int validDigit = 2;
+
+ if (String.valueOf(allDigitString.charAt(validDigit)).equals("9")) {
+ MAX_SIZE = 11;
+ formattedString.append(allDigitString.substring(alreadyPlacedDigitCount, alreadyPlacedDigitCount + 5) + "-");
+ alreadyPlacedDigitCount += 5;
+
+ } else {
+ MAX_SIZE = 10;
+ formattedString.append(allDigitString.substring(alreadyPlacedDigitCount, alreadyPlacedDigitCount + 4) + "-");
+ alreadyPlacedDigitCount += 4;
+ }
+ }
+
+
+ // All the required formatting is done so we'll just copy the remaining digits.
+ if (totalDigitCount > alreadyPlacedDigitCount) {
+ formattedString.append(allDigitString
+ .substring(alreadyPlacedDigitCount));
+ }
+
+ //delete number after max size
+ if(totalDigitCount > MAX_SIZE) {
+ formattedString.delete(text.length() - 1, text.length()).toString();
+ }
+
+
+ text.clear();
+ text.append(formattedString.toString());
+
+ PhoneValidator.validatePhone(formattedString.toString());
+ phoneNumbers = formattedString.toString().replaceAll("[^\\d]", "");
+
+ return formattedString.toString();
+ //REF: https://stackoverflow.com/a/23659268
+ }
+
+
+ public String stylePhoneField() {
+
+ if (phoneNumbers.isEmpty()) {
+ STATE_PHONE_VALIDATOR = "0";
+
+ } else if (MAX_SIZE == 10 && PhoneValidator.PHONE8_PATTERN.matcher(phoneNumbers).matches()) {
+ STATE_PHONE_VALIDATOR = "2";
+
+ } else if (MAX_SIZE == 11 && PhoneValidator.PHONE9_PATTERN.matcher(phoneNumbers).matches()) {
+ STATE_PHONE_VALIDATOR = "2";
+
+ } else {
+ STATE_PHONE_VALIDATOR = "1";
+ }
+
+ return STATE_PHONE_VALIDATOR;
+ }
+}
diff --git a/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/PhoneValidator.java b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/PhoneValidator.java
new file mode 100644
index 00000000..08051019
--- /dev/null
+++ b/SantanderTeste/app/src/main/java/com/example/alessandrofsouza/santanderapp/presentation/utils/PhoneValidator.java
@@ -0,0 +1,23 @@
+package com.example.alessandrofsouza.santanderapp.presentation.utils;
+
+
+import java.util.regex.Pattern;
+
+public class PhoneValidator {
+
+ private static final String TAG = "Santander ";
+
+ public static final Pattern PHONE8_PATTERN = Pattern.compile(
+ ("^[+]?[0-9]{10}$")
+ );
+
+ public static final Pattern PHONE9_PATTERN = Pattern.compile(
+ ("^[+]?[0-9]{11}$")
+ );
+
+
+ public static boolean validatePhone(CharSequence phone) {
+ return phone != null && PHONE8_PATTERN.matcher(phone).matches() || phone != null && PHONE9_PATTERN.matcher(phone).matches();
+ }
+
+}
diff --git a/SantanderTeste/app/src/main/res/drawable-v21/separator.xml b/SantanderTeste/app/src/main/res/drawable-v21/separator.xml
new file mode 100644
index 00000000..1d53b957
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/drawable-v21/separator.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/SantanderTeste/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 00000000..1f6bb290
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SantanderTeste/app/src/main/res/drawable/arrow.xml b/SantanderTeste/app/src/main/res/drawable/arrow.xml
new file mode 100644
index 00000000..1d94a211
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/drawable/arrow.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/drawable/bg_tab.xml b/SantanderTeste/app/src/main/res/drawable/bg_tab.xml
new file mode 100644
index 00000000..ea8ce322
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/drawable/bg_tab.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/drawable/download.xml b/SantanderTeste/app/src/main/res/drawable/download.xml
new file mode 100644
index 00000000..debff14f
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/drawable/download.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/drawable/ic_launcher_background.xml b/SantanderTeste/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 00000000..e1572508
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SantanderTeste/app/src/main/res/drawable/roundedbutton.xml b/SantanderTeste/app/src/main/res/drawable/roundedbutton.xml
new file mode 100644
index 00000000..9aa14d2b
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/drawable/roundedbutton.xml
@@ -0,0 +1,16 @@
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/drawable/separator.xml b/SantanderTeste/app/src/main/res/drawable/separator.xml
new file mode 100644
index 00000000..1d53b957
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/drawable/separator.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/drawable/shape.png b/SantanderTeste/app/src/main/res/drawable/shape.png
new file mode 100644
index 00000000..b94e990c
Binary files /dev/null and b/SantanderTeste/app/src/main/res/drawable/shape.png differ
diff --git a/SantanderTeste/app/src/main/res/drawable/share.png b/SantanderTeste/app/src/main/res/drawable/share.png
new file mode 100644
index 00000000..3a5d1765
Binary files /dev/null and b/SantanderTeste/app/src/main/res/drawable/share.png differ
diff --git a/SantanderTeste/app/src/main/res/font/dinengschriftstd.otf b/SantanderTeste/app/src/main/res/font/dinengschriftstd.otf
new file mode 100755
index 00000000..ae85f8ee
Binary files /dev/null and b/SantanderTeste/app/src/main/res/font/dinengschriftstd.otf differ
diff --git a/SantanderTeste/app/src/main/res/font/dinmttelschriftstd.otf b/SantanderTeste/app/src/main/res/font/dinmttelschriftstd.otf
new file mode 100755
index 00000000..9a6e0d4f
Binary files /dev/null and b/SantanderTeste/app/src/main/res/font/dinmttelschriftstd.otf differ
diff --git a/SantanderTeste/app/src/main/res/font/dinneuzeitgroteskstd_bdcond.otf b/SantanderTeste/app/src/main/res/font/dinneuzeitgroteskstd_bdcond.otf
new file mode 100755
index 00000000..1da42b06
Binary files /dev/null and b/SantanderTeste/app/src/main/res/font/dinneuzeitgroteskstd_bdcond.otf differ
diff --git a/SantanderTeste/app/src/main/res/font/dinneuzeitgroteskstd_light.otf b/SantanderTeste/app/src/main/res/font/dinneuzeitgroteskstd_light.otf
new file mode 100755
index 00000000..0cda2e5b
Binary files /dev/null and b/SantanderTeste/app/src/main/res/font/dinneuzeitgroteskstd_light.otf differ
diff --git a/SantanderTeste/app/src/main/res/font/dinpro_black.otf b/SantanderTeste/app/src/main/res/font/dinpro_black.otf
new file mode 100755
index 00000000..2092a7bb
Binary files /dev/null and b/SantanderTeste/app/src/main/res/font/dinpro_black.otf differ
diff --git a/SantanderTeste/app/src/main/res/font/dinpro_bold.otf b/SantanderTeste/app/src/main/res/font/dinpro_bold.otf
new file mode 100755
index 00000000..7c839536
Binary files /dev/null and b/SantanderTeste/app/src/main/res/font/dinpro_bold.otf differ
diff --git a/SantanderTeste/app/src/main/res/font/dinpro_light.otf b/SantanderTeste/app/src/main/res/font/dinpro_light.otf
new file mode 100755
index 00000000..8a7f085a
Binary files /dev/null and b/SantanderTeste/app/src/main/res/font/dinpro_light.otf differ
diff --git a/SantanderTeste/app/src/main/res/font/dinpro_medium.otf b/SantanderTeste/app/src/main/res/font/dinpro_medium.otf
new file mode 100755
index 00000000..b4608d06
Binary files /dev/null and b/SantanderTeste/app/src/main/res/font/dinpro_medium.otf differ
diff --git a/SantanderTeste/app/src/main/res/font/dinpro_regular.otf b/SantanderTeste/app/src/main/res/font/dinpro_regular.otf
new file mode 100755
index 00000000..84d57abb
Binary files /dev/null and b/SantanderTeste/app/src/main/res/font/dinpro_regular.otf differ
diff --git a/SantanderTeste/app/src/main/res/layout/activity_main.xml b/SantanderTeste/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 00000000..893d9f24
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/layout/contact.xml b/SantanderTeste/app/src/main/res/layout/contact.xml
new file mode 100644
index 00000000..e494b362
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/layout/contact.xml
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/layout/frame_layout_invest.xml b/SantanderTeste/app/src/main/res/layout/frame_layout_invest.xml
new file mode 100644
index 00000000..f2e96504
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/layout/frame_layout_invest.xml
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/layout/invest_description.xml b/SantanderTeste/app/src/main/res/layout/invest_description.xml
new file mode 100644
index 00000000..111f4e65
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/layout/invest_description.xml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/layout/invest_info.xml b/SantanderTeste/app/src/main/res/layout/invest_info.xml
new file mode 100644
index 00000000..014643b0
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/layout/invest_info.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/layout/invest_more_info.xml b/SantanderTeste/app/src/main/res/layout/invest_more_info.xml
new file mode 100644
index 00000000..c1e923f1
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/layout/invest_more_info.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/layout/investment.xml b/SantanderTeste/app/src/main/res/layout/investment.xml
new file mode 100644
index 00000000..1831bc3f
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/layout/investment.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/layout/investment_risk.xml b/SantanderTeste/app/src/main/res/layout/investment_risk.xml
new file mode 100644
index 00000000..ec5d2986
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/layout/investment_risk.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/layout/item_button_round.xml b/SantanderTeste/app/src/main/res/layout/item_button_round.xml
new file mode 100644
index 00000000..b5846510
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/layout/item_button_round.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/layout/item_checkbox.xml b/SantanderTeste/app/src/main/res/layout/item_checkbox.xml
new file mode 100644
index 00000000..d61cac9d
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/layout/item_checkbox.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/layout/item_edit_text.xml b/SantanderTeste/app/src/main/res/layout/item_edit_text.xml
new file mode 100644
index 00000000..f894a68f
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/layout/item_edit_text.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/layout/item_text.xml b/SantanderTeste/app/src/main/res/layout/item_text.xml
new file mode 100644
index 00000000..f8caed3c
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/layout/item_text.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/SantanderTeste/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 00000000..eca70cfe
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/SantanderTeste/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 00000000..eca70cfe
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/mipmap-hdpi/ic_launcher.png b/SantanderTeste/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 00000000..898f3ed5
Binary files /dev/null and b/SantanderTeste/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/SantanderTeste/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/SantanderTeste/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 00000000..dffca360
Binary files /dev/null and b/SantanderTeste/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/SantanderTeste/app/src/main/res/mipmap-mdpi/ic_launcher.png b/SantanderTeste/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 00000000..64ba76f7
Binary files /dev/null and b/SantanderTeste/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/SantanderTeste/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/SantanderTeste/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 00000000..dae5e082
Binary files /dev/null and b/SantanderTeste/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/SantanderTeste/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/SantanderTeste/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..e5ed4659
Binary files /dev/null and b/SantanderTeste/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/SantanderTeste/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/SantanderTeste/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..14ed0af3
Binary files /dev/null and b/SantanderTeste/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/SantanderTeste/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/SantanderTeste/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 00000000..b0907cac
Binary files /dev/null and b/SantanderTeste/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/SantanderTeste/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/SantanderTeste/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..d8ae0315
Binary files /dev/null and b/SantanderTeste/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/SantanderTeste/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/SantanderTeste/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 00000000..2c18de9e
Binary files /dev/null and b/SantanderTeste/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/SantanderTeste/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/SantanderTeste/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..beed3cdd
Binary files /dev/null and b/SantanderTeste/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/SantanderTeste/app/src/main/res/values/colors.xml b/SantanderTeste/app/src/main/res/values/colors.xml
new file mode 100644
index 00000000..6168c7bf
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/values/colors.xml
@@ -0,0 +1,31 @@
+
+
+ #008577
+ #00574B
+ #D81B60
+
+
+
+ #FFFFFF
+ #333333
+ #ACACAC
+ #EFEEED
+ #DA0101
+ #EB7676
+ #C90505
+ #7E7E7E
+
+
+ #979797
+ #65BE30
+ #FF1F1F
+ #F6F6F6
+ #AFA9A3
+
+
+ #74DA61
+ #4AC16C
+ #FFC011
+ #FF742C
+ #FF3634
+
diff --git a/SantanderTeste/app/src/main/res/values/dimens.xml b/SantanderTeste/app/src/main/res/values/dimens.xml
new file mode 100644
index 00000000..672f0190
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/values/dimens.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ 11sp
+ 14sp
+ 16sp
+ 18sp
+ 32sp
+
+
+ 32dp
+ 16dp
+ 12dp
+ 8dp
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/main/res/values/strings.xml b/SantanderTeste/app/src/main/res/values/strings.xml
new file mode 100644
index 00000000..b6ee9ba7
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/values/strings.xml
@@ -0,0 +1,21 @@
+
+ SantanderApp
+ Contato
+ Investimento
+
+ No mês
+ No Ano
+ 12 meses
+
+ Fundo
+ CDI
+
+ Investir
+ Baixar
+
+ Mensagem enviada com sucesso :)
+ Obrigado!
+ Enviar nova mensagem
+
+ Ainda em criaçao
+
diff --git a/SantanderTeste/app/src/main/res/values/styles.xml b/SantanderTeste/app/src/main/res/values/styles.xml
new file mode 100644
index 00000000..5da1d71e
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/values/styles.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SantanderTeste/app/src/main/res/xml/file_provider_paths.xml b/SantanderTeste/app/src/main/res/xml/file_provider_paths.xml
new file mode 100644
index 00000000..a9d2d316
--- /dev/null
+++ b/SantanderTeste/app/src/main/res/xml/file_provider_paths.xml
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/ExampleUnitTest.java b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/ExampleUnitTest.java
new file mode 100644
index 00000000..149c3dba
--- /dev/null
+++ b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.alessandrofsouza.santanderapp;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/data/service/ApiServiceTest.java b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/data/service/ApiServiceTest.java
new file mode 100644
index 00000000..fc6aea51
--- /dev/null
+++ b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/data/service/ApiServiceTest.java
@@ -0,0 +1,20 @@
+package com.example.alessandrofsouza.santanderapp.data.service;
+
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.*;
+
+public class ApiServiceTest {
+
+ String str = "https://floating-mountain-50292.herokuapp.com";
+
+
+
+ @Test
+ public void correct_api_received() {
+// assertTrue(ApiService.ServiceApi.BASE_URL.contentEquals(str));
+// assertSame(ApiService.ServiceApi.BASE_URL, str);
+ assertThat(ApiService.ServiceApi.BASE_URL, is("https://floating-mountain-50292.herokuapp.com"));
+ }
+}
\ No newline at end of file
diff --git a/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/domain/model/CellTest.java b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/domain/model/CellTest.java
new file mode 100644
index 00000000..3c634c00
--- /dev/null
+++ b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/domain/model/CellTest.java
@@ -0,0 +1,87 @@
+package com.example.alessandrofsouza.santanderapp.domain.model;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+
+public class CellTest {
+
+ Cell cell;
+
+ @Before
+ public void init() {
+ cell = new Cell();
+ cell.setId(1);
+ cell.setType(1);
+ cell.setMessage("string");
+ cell.setTypefield("string");
+ cell.setHidden(true);
+ cell.setTopSpacing(1);
+ cell.setShow(1);
+ cell.setRequired(true);
+ cell.setEditTextValue("string");
+ }
+
+ @Test
+ public void id_ReturnsTrue() {
+ assertThat(cell.getId(), is(1));
+ }
+
+ @Test
+ public void type_ReturnsTrue() {
+ assertThat(cell.getType(), is(1));
+ }
+
+ @Test
+ public void message_ReturnsTrue() {
+ assertThat(cell.getMessage(), is("string"));
+ }
+
+ @Test
+ public void message_ReturnsFalse() {
+ assertEquals(cell.getMessage() == "", false);
+ }
+
+ @Test
+ public void typeField_ReturnsTrue() {
+ assertThat(cell.getTypefield(), is("string"));
+ }
+
+ @Test
+ public void typeField_ReturnsFalse() {
+ assertEquals(cell.getTypefield() == "", false);
+ }
+
+ @Test
+ public void hidden_ReturnsTrue() {
+ assertThat(cell.isHidden(), is(true));
+ }
+
+ @Test
+ public void topSpacing_ReturnsTrue() {
+ assertThat(cell.getTopSpacing(), is(1));
+ }
+
+ @Test
+ public void show_ReturnsTrue() {
+ assertThat(cell.getShow(), is(1));
+ }
+
+ @Test
+ public void required_ReturnsTrue() {
+ assertThat(cell.isRequired(), is(true));
+ }
+
+ @Test
+ public void getEditTextValue_ReturnsTrue() {
+ assertThat(cell.getEditTextValue(), is("string"));
+ }
+
+ @Test
+ public void getEditTextValue_ReturnsFalse() {
+ assertEquals(cell.getEditTextValue() == "", false);
+ }
+}
\ No newline at end of file
diff --git a/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/domain/model/InfosTest.java b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/domain/model/InfosTest.java
new file mode 100644
index 00000000..44a47318
--- /dev/null
+++ b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/domain/model/InfosTest.java
@@ -0,0 +1,36 @@
+package com.example.alessandrofsouza.santanderapp.domain.model;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class InfosTest {
+
+ Infos info;
+
+ @Before
+ public void init() {
+ info = new Infos("string", "string", "string");
+ }
+
+ @Test
+ public void title_ReturnsTrue() {
+ assertThat(info.getTitle(), is("string"));
+ }
+
+
+ @Test
+ public void name_ReturnsTrue() {
+ assertThat(info.getName(), is("string"));
+ }
+
+
+ @Test
+ public void data_ReturnsTrue() {
+ assertThat(info.getData(), is("string"));
+ }
+
+
+}
\ No newline at end of file
diff --git a/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/domain/model/MoreInfoValuesTest.java b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/domain/model/MoreInfoValuesTest.java
new file mode 100644
index 00000000..edc9eca0
--- /dev/null
+++ b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/domain/model/MoreInfoValuesTest.java
@@ -0,0 +1,32 @@
+package com.example.alessandrofsouza.santanderapp.domain.model;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class MoreInfoValuesTest {
+
+ MoreInfoValues moreinfo;
+
+ @Before
+ public void init() {
+ moreinfo = new MoreInfoValues();
+ moreinfo.setFund(0.1);
+ moreinfo.setCDI(0.1);
+ }
+
+ @Test
+ public void fund_ReturnsTrue() {
+ assertThat(moreinfo.getFund(), is(0.1));
+ }
+
+
+ @Test
+ public void cdi_ReturnsTrue() {
+ assertThat(moreinfo.getCDI(), is(0.1));
+ }
+
+
+}
\ No newline at end of file
diff --git a/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/presentation/utils/EmailValidatorTest.java b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/presentation/utils/EmailValidatorTest.java
new file mode 100644
index 00000000..bccf5d20
--- /dev/null
+++ b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/presentation/utils/EmailValidatorTest.java
@@ -0,0 +1,42 @@
+package com.example.alessandrofsouza.santanderapp.presentation.utils;
+
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+
+public class EmailValidatorTest {
+
+ //RIGHTS
+ @Test
+ public void emailValidator_CorrectEmailSimple_ReturnsTrue() {
+ assertThat(EmailValidator.validateEmail("name@email.com"), is(true));
+ }
+
+ @Test
+ public void emailValidator_CorrectEmailSubDomain_ReturnsTrue() {
+ assertThat(EmailValidator.validateEmail("name@email.com.br"), is(true));
+ }
+
+ //WRONGS
+ @Test
+ public void emailValidator_NullEmail_ReturnsFalse() {
+ assertEquals(EmailValidator.validateEmail(null), false);
+ }
+
+ @Test
+ public void emailValidator_NullEmpty_ReturnsFalse() {
+ assertEquals(EmailValidator.validateEmail(""), false);
+ }
+
+ @Test
+ public void emailValidator_IncorrectEmailNoAt_ReturnsFalse() {
+ assertEquals(EmailValidator.validateEmail("email.com.br"), false);
+ }
+
+ @Test
+ public void emailValidator_IncorrectEmailDoubleAt_ReturnsFalse() {
+ assertEquals(EmailValidator.validateEmail("email@@.com.br"), false);
+ }
+}
\ No newline at end of file
diff --git a/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/presentation/utils/NameValidatorTest.java b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/presentation/utils/NameValidatorTest.java
new file mode 100644
index 00000000..1958f849
--- /dev/null
+++ b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/presentation/utils/NameValidatorTest.java
@@ -0,0 +1,41 @@
+package com.example.alessandrofsouza.santanderapp.presentation.utils;
+
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.*;
+
+public class NameValidatorTest {
+
+ //NAME
+ @Test
+ public void nameValidator_CorrectNameSimple_ReturnsTrue() {
+ assertThat(NameValidator.validateName("name"), is(true));
+ }
+
+ @Test
+ public void nameValidator_CorrectNameDouble_ReturnsTrue() {
+ assertThat(NameValidator.validateName("name name"), is(true));
+ }
+
+ @Test
+ public void thirdValidator_CorrectNameThird_ReturnsTrue() {
+ assertThat(NameValidator.validateName("name name name"), is(true));
+ }
+
+ @Test
+ public void nameValidator_InvalidName_ReturnsFalse() {
+ assertThat(NameValidator.validateName("2@mali&"), is(false));
+ }
+
+ @Test
+ public void nameValidator_EmptyString_ReturnsFalse() {
+ assertEquals(NameValidator.validateName(""), false);
+ }
+
+ @Test
+ public void nameValidator_NullName_ReturnsFalse() {
+ assertEquals(NameValidator.validateName(null), false);
+ }
+
+}
\ No newline at end of file
diff --git a/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/presentation/utils/PhoneValidatorTest.java b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/presentation/utils/PhoneValidatorTest.java
new file mode 100644
index 00000000..6778e59b
--- /dev/null
+++ b/SantanderTeste/app/src/test/java/com/example/alessandrofsouza/santanderapp/presentation/utils/PhoneValidatorTest.java
@@ -0,0 +1,44 @@
+package com.example.alessandrofsouza.santanderapp.presentation.utils;
+
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.*;
+
+public class PhoneValidatorTest {
+ //PHONE
+ @Test
+ public void phoneValidator_Correct9Digits_ReturnsTrue() {
+ assertThat(PhoneValidator.validatePhone("00912345678"), is(true));
+ }
+
+ @Test
+ public void phoneValidator_Correct8Digits_ReturnsTrue() {
+ assertThat(PhoneValidator.validatePhone("0012345678"), is(true));
+ }
+
+ @Test
+ public void phoneValidator_WrongMoreThen9Digits_ReturnsFalse() {
+ assertThat(PhoneValidator.validatePhone("009123456789"), is(false));
+ }
+
+ @Test
+ public void phoneValidator_WrongLessThen8Digits_ReturnsFalse() {
+ assertThat(PhoneValidator.validatePhone("12345678"), is(false));
+ }
+
+ @Test
+ public void phoneValidator_EmptyString_ReturnsFalse() {
+ assertEquals(PhoneValidator.validatePhone(""), false);
+ }
+
+ @Test
+ public void phoneValidator_NullPhone_ReturnsFalse() {
+ assertEquals(PhoneValidator.validatePhone(null), false);
+ }
+
+ @Test
+ public void phoneValidator_OddDigitPhone_ReturnsFalse() {
+ assertThat(PhoneValidator.validatePhone("01#2222222"), is(false));
+ }
+}
\ No newline at end of file
diff --git a/SantanderTeste/build.gradle b/SantanderTeste/build.gradle
new file mode 100644
index 00000000..8d3ef8e5
--- /dev/null
+++ b/SantanderTeste/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.2.1'
+
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/SantanderTeste/gradle.properties b/SantanderTeste/gradle.properties
new file mode 100644
index 00000000..82618cec
--- /dev/null
+++ b/SantanderTeste/gradle.properties
@@ -0,0 +1,15 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+
+
diff --git a/SantanderTeste/gradle/wrapper/gradle-wrapper.jar b/SantanderTeste/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..f6b961fd
Binary files /dev/null and b/SantanderTeste/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/SantanderTeste/gradle/wrapper/gradle-wrapper.properties b/SantanderTeste/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..9a4163a4
--- /dev/null
+++ b/SantanderTeste/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/SantanderTeste/gradlew b/SantanderTeste/gradlew
new file mode 100755
index 00000000..cccdd3d5
--- /dev/null
+++ b/SantanderTeste/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/SantanderTeste/gradlew.bat b/SantanderTeste/gradlew.bat
new file mode 100644
index 00000000..e95643d6
--- /dev/null
+++ b/SantanderTeste/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/SantanderTeste/settings.gradle b/SantanderTeste/settings.gradle
new file mode 100644
index 00000000..e7b4def4
--- /dev/null
+++ b/SantanderTeste/settings.gradle
@@ -0,0 +1 @@
+include ':app'
| | | | | | | | |