Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
refactor: remove widgetView inheritance from PageIndicator component (#…
Browse files Browse the repository at this point in the history
…1592)

* remove widgetView inheritance from PageIndicator component

* remove unused import

* changed RegisterWidget annotation to BeagleJson
  • Loading branch information
luisoliveirazup authored Jun 1, 2021
1 parent edf83aa commit e5ecb2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import br.com.zup.beagle.android.utils.toAndroidColor
import br.com.zup.beagle.android.view.ViewFactory
import br.com.zup.beagle.android.view.custom.BeaglePageIndicatorView
import br.com.zup.beagle.android.widget.RootView
import br.com.zup.beagle.android.widget.WidgetView
import br.com.zup.beagle.annotation.RegisterWidget
import br.com.zup.beagle.core.BeagleJson

/**
* The PageView component is a specialized container to hold pages (views) that will be displayed horizontally.
Expand All @@ -34,13 +33,13 @@ import br.com.zup.beagle.annotation.RegisterWidget
* @param numberOfPages Numbers of pages that will contain.
* @param currentPage Integer number that identifies that selected
*/
@RegisterWidget("pageIndicator")
@BeagleJson(name = "pageIndicator")
class PageIndicator(
val selectedColor: String,
val unselectedColor: String,
var numberOfPages: Int? = null,
var currentPage: Bind<Int>? = null,
) : WidgetView(), PageIndicatorComponent {
) : PageIndicatorComponent {

constructor(
selectedColor: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import br.com.zup.beagle.android.components.Touchable
import br.com.zup.beagle.android.components.form.FormInput
import br.com.zup.beagle.android.components.form.FormSubmit
import br.com.zup.beagle.android.components.form.InputWidget
import br.com.zup.beagle.android.components.page.PageIndicator
import br.com.zup.beagle.android.components.page.PageIndicatorComponent
import br.com.zup.beagle.android.components.page.PageView
import br.com.zup.beagle.android.data.serializer.PolymorphicJsonAdapterFactory
Expand Down Expand Up @@ -66,7 +67,8 @@ internal object ComponentJsonAdapterFactory {
.withSubtype(Touchable::class.java, createNameSpaceToDefaultWidget<Touchable>("touchable"))
.withSubtype(FormInput::class.java, createNameSpaceToDefaultWidget<FormInput>("formInput"))
.withSubtype(FormSubmit::class.java, createNameSpaceToDefaultWidget<FormSubmit>("formSubmit"))
.withSubtype(PageView::class.java, createNameSpaceToDefaultWidget<FormSubmit>("pageView"))
.withSubtype(PageView::class.java, createNameSpaceToDefaultWidget<PageView>("pageView"))
.withSubtype(PageIndicator::class.java, createNameSpaceToDefaultWidget<PageIndicator>("pageIndicator"))
}

private fun registerWidgets(
Expand Down

0 comments on commit e5ecb2c

Please sign in to comment.