-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
1,559 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ | |
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.externalNativeBuild | ||
docs/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = sphinx-build | ||
SPHINXPROJ = Androidvalidationlibrary | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
set SPHINXPROJ=Androidvalidationlibrary | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.http://sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
.. java:import:: android.graphics Color | ||
.. java:import:: android.graphics Typeface | ||
.. java:import:: android.support.v7.app AppCompatActivity | ||
.. java:import:: android.view View | ||
.. java:import:: android.view ViewGroup | ||
.. java:import:: android.widget GridLayout | ||
.. java:import:: android.widget LinearLayout | ||
.. java:import:: android.widget TextView | ||
.. java:import:: java.util HashMap | ||
.. java:import:: java.util List | ||
ErrorRenderer | ||
============= | ||
|
||
.. java:package:: com.eddmash.validation | ||
:noindex: | ||
|
||
.. java:type:: public class ErrorRenderer | ||
Renders all errors found in the validator | ||
|
||
Constructors | ||
------------ | ||
ErrorRenderer | ||
^^^^^^^^^^^^^ | ||
|
||
.. java:constructor:: public ErrorRenderer(AppCompatActivity compatActivity, Validator validator) | ||
:outertype: ErrorRenderer | ||
|
||
Methods | ||
------- | ||
render | ||
^^^^^^ | ||
|
||
.. java:method:: public void render(LinearLayout errorSpace) | ||
:outertype: ErrorRenderer | ||
|
192 changes: 192 additions & 0 deletions
192
docs/source/com/eddmash/validation/ValidationListener.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
.. java:import:: android.view View | ||
.. java:import:: android.widget EditText | ||
.. java:import:: android.widget Spinner | ||
.. java:import:: com.eddmash.validation.checks ValidationCheck | ||
.. java:import:: com.google.common.collect Range | ||
ValidationListener | ||
================== | ||
|
||
.. java:package:: com.eddmash.validation | ||
:noindex: | ||
|
||
.. java:type:: public interface ValidationListener | ||
Enables validation of views in fragment find managed at the activity level see FarmerActivity and it fragments. | ||
|
||
Methods | ||
------- | ||
addCheck | ||
^^^^^^^^ | ||
|
||
.. java:method:: void addCheck(ValidationCheck validationCheck) | ||
:outertype: ValidationListener | ||
|
||
Adds validation checks to be enforced by a validator | ||
|
||
:param validationCheck: | ||
|
||
addValidator | ||
^^^^^^^^^^^^ | ||
|
||
.. java:method:: void addValidator(ValidationListener validationListener) | ||
:outertype: ValidationListener | ||
|
||
Add a validationListener object. | ||
|
||
:param validationListener: | ||
|
||
disableCheck | ||
^^^^^^^^^^^^ | ||
|
||
.. java:method:: void disableCheck(ValidationCheck validationCheck) | ||
:outertype: ValidationListener | ||
|
||
disable validation check | ||
|
||
:param validationCheck: the validation check to disable. | ||
|
||
disableSpinnerValidation | ||
^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. java:method:: void disableSpinnerValidation(View view) | ||
:outertype: ValidationListener | ||
|
||
Remove view from being validated. | ||
|
||
:param view: | ||
|
||
disableSpinnerValidation | ||
^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. java:method:: void disableSpinnerValidation(int id) | ||
:outertype: ValidationListener | ||
|
||
Remove view from being validated. | ||
|
||
:param id: | ||
|
||
disableValidation | ||
^^^^^^^^^^^^^^^^^ | ||
|
||
.. java:method:: void disableValidation(int id) | ||
:outertype: ValidationListener | ||
|
||
Remove view from being validated. | ||
|
||
:param id: | ||
|
||
disableValidation | ||
^^^^^^^^^^^^^^^^^ | ||
|
||
.. java:method:: void disableValidation(View view) | ||
:outertype: ValidationListener | ||
|
||
Remove view from being validated. | ||
|
||
:param view: | ||
|
||
setSpinnerValidation | ||
^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. java:method:: void setSpinnerValidation(int form_province, String pattern, int form_err_blank) | ||
:outertype: ValidationListener | ||
|
||
Validates Spinners | ||
|
||
:param form_province: | ||
:param pattern: | ||
:param form_err_blank: | ||
|
||
setSpinnerValidation | ||
^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. java:method:: void setSpinnerValidation(int form_province, String pattern, String form_err_blank) | ||
:outertype: ValidationListener | ||
|
||
Validates Spinners | ||
|
||
:param form_province: | ||
:param pattern: | ||
:param form_err_blank: | ||
|
||
setSpinnerValidation | ||
^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. java:method:: void setSpinnerValidation(Spinner spinner, String pattern, int form_err_blank) | ||
:outertype: ValidationListener | ||
|
||
Validates Spinners | ||
|
||
:param spinner: | ||
:param pattern: | ||
:param form_err_blank: | ||
|
||
setSpinnerValidation | ||
^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. java:method:: void setSpinnerValidation(Spinner spinner, String pattern, String form_err_blank) | ||
:outertype: ValidationListener | ||
|
||
setValidation | ||
^^^^^^^^^^^^^ | ||
|
||
.. java:method:: void setValidation(EditText view, String pattern, String errorMsg) | ||
:outertype: ValidationListener | ||
|
||
Validates and edit box. | ||
|
||
:param view: the view to validate | ||
:param pattern: the condition to validate on the view | ||
:param errorMsg: the error message to produce on validation fail | ||
|
||
setValidation | ||
^^^^^^^^^^^^^ | ||
|
||
.. java:method:: void setValidation(int view, String pattern, String errorMsg) | ||
:outertype: ValidationListener | ||
|
||
Validates and edit box. | ||
|
||
:param view: the view to validate | ||
:param pattern: the condition to validate on the view | ||
:param errorMsg: the error message to produce on validation fail | ||
|
||
setValidation | ||
^^^^^^^^^^^^^ | ||
|
||
.. java:method:: void setValidation(int view, String pattern, int errorMsg) | ||
:outertype: ValidationListener | ||
|
||
Validates a view againsts the given context | ||
|
||
:param view: | ||
:param pattern: | ||
:param errorMsg: | ||
|
||
setValidation | ||
^^^^^^^^^^^^^ | ||
|
||
.. java:method:: void setValidation(EditText view, Range pattern, String errorMsg, boolean strict) | ||
:outertype: ValidationListener | ||
|
||
setValidation | ||
^^^^^^^^^^^^^ | ||
|
||
.. java:method:: void setValidation(int view, Range pattern, String errorMsg, boolean strict) | ||
:outertype: ValidationListener | ||
|
||
validate | ||
^^^^^^^^ | ||
|
||
.. java:method:: boolean validate() | ||
:outertype: ValidationListener | ||
|
||
Does the actual validation. | ||
|
||
:return: boolean true of valid | ||
|
Oops, something went wrong.