Skip to content

Releases: RobertApikyan/ViewComponent

1.0.3

20 Apr 10:36

Choose a tag to compare

release_1.0.3

Gradle update

20 Apr 10:24

Choose a tag to compare

1.0.2

release_1.0.2

Removed onDestroy() method from lifecycle

29 Nov 17:19

Choose a tag to compare

Removed onDestroy() method from lifecycle

29 Nov 16:17

Choose a tag to compare

ViewComponent

23 Aug 12:56

Choose a tag to compare

Create Android custom views with View Component pattern.

viewcomponent

  1. Create your custom view's layout file.

  2. Create class CustomViewComponent, extend it from ViewComponent class, make all findViewById's inside this class, or ButterKnife bindings. Hold all View objects inside this class (EditText, Button, ImageView ...).

  3. Create class CustomControllerComponent extend it from ControllerComponent class, inside onCreate() method receive non null CustomViewComponent. In this class implement your custom view's logic.

  4. At last Create your CustomView class, extend it from one of the ComponentLayout (ComponenetFrameLayout , ComponentLinearLayout ... or create your component layout using ComponentDelegateImpl class ).
    Implement createViewComponent(LayoutInflater inflater)
    and
    createControllerComponent() methods.

GRADLE

Add it in your root build.gradle at the end of repositories:

allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}

Step 2. Add the dependency

dependencies {
compile 'com.github.RobertApikyan:ViewComponent:0.0.2'
}

View Component

21 Aug 08:18

Choose a tag to compare

Create Android custom views with View Component pattern.

viewcomponent

  1. Create your custom view's layout file.

  2. Create class CustomViewComponent, extend it from ViewComponent class, make all findViewById's inside this class, or ButterKnife bindings. Hold all View objects inside this class (EditText, Button, ImageView ...).

  3. Create class CustomControllerComponent extend it from ControllerComponent class, inside onCreate() method receive non null CustomViewComponent. In this class implement your custom view's logic.

  4. At last Create your CustomView class, extend it from one of the ComponentLayout (ComponenetFrameLayout , ComponentLinearLayout ... or create your component layout using ComponentDelegateImpl class ).
    Implement createViewComponent(LayoutInflater inflater)
    and
    createControllerComponent() methods.

GRADLE

allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}

dependencies {
...
compile 'com.github.RobertApikyan:ViewComponent:0.0.1'
}