Skip to content

Commit

Permalink
Adiciondo arquivos do projeto
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Almeida committed Jun 16, 2016
0 parents commit b43aa28
Show file tree
Hide file tree
Showing 73 changed files with 2,153 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# Intellij
*.iml
.idea/workspace.xml
.idea/

# Keystore files
*.jks
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
26 changes: 26 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "com.rca.formvalidator"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
}
17 changes: 17 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/qranio/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# 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 *;
#}
12 changes: 12 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rca.formvalidator">

<application android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme">

</application>

</manifest>
Binary file added app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">FormValidator</string>
</resources>
11 changes: 11 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

</resources>
21 changes: 21 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
}
}

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
1 change: 1 addition & 0 deletions formvalidator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
28 changes: 28 additions & 0 deletions formvalidator/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

group='com.github.jitpack'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
}
17 changes: 17 additions & 0 deletions formvalidator/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/qranio/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# 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 *;
#}
12 changes: 12 additions & 0 deletions formvalidator/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rca.formvalidator">

<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true"
>

</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.rca.formvalidator;

import android.content.Context;
import android.support.annotation.StringRes;

/**
* Created by Rafael C. Almeida on 15/06/16.
*/
public abstract class BaseValidator {

private Context context;
private int errorRes;
private String errorMessage;

public BaseValidator(Context context, @StringRes int errorRes) {

this.context = context;
this.errorRes = errorRes;
this.errorMessage = context.getString(errorRes);
}

public BaseValidator(Context context, String errorMessage) {

this.context = context;
this.errorMessage = errorMessage;
}

public final Context getContext() {
return context;
}

public int getErrorRes() {
return errorRes;
}

public String getErrorMessage() {

return errorMessage;
}

public abstract boolean isValid(String value);

//==============================================================================================
// Métodos Privados
//==============================================================================================
}
70 changes: 70 additions & 0 deletions formvalidator/src/main/java/com/rca/formvalidator/Form.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package com.rca.formvalidator;

import android.support.design.widget.TextInputLayout;

import java.util.ArrayList;
import java.util.List;

/**
* Created by Rafael C. Almeida on 15/06/16.
*/
public class Form {

private List<Validate> validateList;

public Form() {

this.validateList = new ArrayList(0);
}

public void addValidate(Validate validate) {

if (validate != null) {

validateList.add(validate);
}
}

public boolean removeValidate(Validate validate) {

if (validate != null && !validateList.isEmpty()) {

return validateList.remove(validate);
}

return false;
}

public boolean validate() {

boolean isValid = true;

for (Validate validate : validateList) {

isValid = isValid & validate.isValid();
}

return isValid;
}

public void closeError(TextInputLayout textInputLayout) {

if (textInputLayout != null) {

textInputLayout.setErrorEnabled(false);
textInputLayout.setError(null);
}
}

public void closeAllErrors() {

for (Validate validate : validateList) {

validate.closeError();
}
}

//==============================================================================================
// Métodos Privados
//==============================================================================================
}
Loading

0 comments on commit b43aa28

Please sign in to comment.