Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
eddmash committed Nov 21, 2017
2 parents b373e2e + 0444856 commit 9c677d9
Show file tree
Hide file tree
Showing 33 changed files with 1,559 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
.DS_Store
/build
/captures
.externalNativeBuild
.externalNativeBuild
docs/build/
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
apply plugin: 'com.android.library'

ext {
versionCode = 13
bintrayRepo = 'maven'
bintrayName = 'validation'

publishedGroupId = 'com.eddmash'
libraryName = 'validation'
artifact = 'validation'

libraryDescription = 'A collection of classes that assist with data pagination.'
libraryDescription = 'Android validation library.'

siteUrl = 'https://github.com/eddmash/validation'
gitUrl = 'https://github.com/eddmash/validation.git'

libraryVersion = "1.0.12"
libraryVersion = "1.0.${versionCode}"

developerId = 'eddmash'
developerName = 'Eddilbert Macharia'
Expand All @@ -29,7 +30,7 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 25
versionCode 12
versionCode project.versionCode
versionName "${libraryVersion}"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -55,5 +56,5 @@ dependencies {
}
//Add these lines to publish library to bintray
//Place it at the end of the file
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
//apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
//apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
20 changes: 20 additions & 0 deletions docs/Makefile
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)
36 changes: 36 additions & 0 deletions docs/make.bat
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
46 changes: 46 additions & 0 deletions docs/source/com/eddmash/validation/ErrorRenderer.rst
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 docs/source/com/eddmash/validation/ValidationListener.rst
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

0 comments on commit 9c677d9

Please sign in to comment.