Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
eddmash committed Nov 21, 2017
1 parent 388445f commit e77e4dd
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ using Gradle.
Usage
*****

Create a validator object
- Create a validator object

.. code-block:: java
// validator takes Context(Activity) object as argument
Validator validator = new Validator(this);
add validation checks to the validator
- add validation checks to the validator

.. code-block:: java
Expand All @@ -48,14 +48,15 @@ add validation checks to the validator
:doc:`Learn more about available checks <com/eddmash/validation/checks/package-index>`
Handle the errors
Validate and Handle the errors
******************************
.. code-block:: java
errorSpace = (LinearLayout) findViewById(R.id.error_base);
errorSpace.removeAllViews();// clear space first
if (getValidator().validate()) {
if (validator.validate()) {
// .. code to perform if validation passes
} else {
Expand All @@ -65,9 +66,3 @@ Handle the errors
errorRenderer.render(errorSpace);
toggleShowErrors.setVisibility(View.VISIBLE);
}
.. toctree::
:titlesonly:
:maxdepth: 1
packages

0 comments on commit e77e4dd

Please sign in to comment.