Feature module

The Form selection feature module includes all the presentation logic required to present the form pickers and handle their selection, as well as the base logic to create your own form pickers. The platform module includes the Form selection feature module but, if you need to include this module, add it to your build.gradle:

implementation ("com.poqstudio:catalogue.formselection:$VERSION_NAME")

Views breakdown

ViewXMLAlias
PoqFormPickerImageViewform_picker_image.xmlformPickerImageViewLayout
FormSectionTextViewform_section_text.xmlformSectionTextViewLayout
FormPickerTextBottomSheetFragmentpoq_text_picker_bottom_sheet_fragment.xml-
PoqFormPickerListTextViewform_picker_bottom_sheet_text.xmlformPickerBottomSheetTextLayout
PoqAddToCartWithQuantityPickerViewadd_to_cart_with_quantity_picker.xmladdToCartWithQuantityPickerViewLayout

FormSectionTextView

FormSectionTextView
FormSectionTextView

FormSectionTextView allows the user to see all the form values as text list.

You can use it in the layout:

<com.poqstudio.platform.view.formselection.form.text.ui.PoqFormSectionTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:formList="@{formsViewModel.yourForm}"
app:title="@{title}" />

PoqFormPickerListTextView

PoqFormPickerListTextView
PoqFormPickerListTextView

PoqFormPickerListTextView allows the user to select a form from a text list. It shows the prices only when they are different.

You can use it in the layout:

<com.poqstudio.platform.view.formselection.form.picker.view.listtext.ui.PoqFormPickerListTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:formList="@{formsViewModel.yourForm}"
app:selectionHandler="@{viewModel.selectionHandler}"
app:title="@{title}" />

FormPickerTextBottomSheetFragment

FormPickerTextBottomSheetFragment allows the user to select a form with a PoqFormPickerListTextView inside a bottom sheet fragment.

To use it, add form_picker_text_bottom_sheet_nav_graph.xml to your navigation graph and add the corresponding action:

<include app:graph="@navigation/form_picker_text_bottom_sheet_nav_graph" />
<fragment
android:id="@+id/YourFragment"
android:name="com.yourpackage.YourFragment"
android:label="YourFragment">
<action
android:id="@+id/action_to_formPickerTextBottomSheetFragment"
app:destination="@id/form_picker_text_bottom_sheet_nav_graph"/>
</fragment>

PoqFormPickerGridView

PoqFormPickerGridView
PoqFormPickerGridView

PoqFormPickerGridView allows the user to select a form from a text grid.

You can use it in the layout:

<com.poqstudio.platform.view.formselection.form.picker.view.gridtext.ui.PoqFormPickerGridView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:formList="@{formsViewModel.yourForm}"
app:selectionHandler="@{viewModel.selectionHandler}"
app:title="@{title}" />

PoqFormPickerImageView

PoqFormPickerImageView
PoqFormPickerImageView

PoqFormPickerImageView allows the user to select a form from an image list.

You can use it in the layout:

<com.poqstudio.platform.view.formselection.form.picker.view.image.ui.PoqFormPickerImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:formList="@{formsViewModel.yourForm}"
app:selectionHandler="@{viewModel.selectionHandler}"
app:title="@{title}" />

PoqFormPickerSmallImageView

PoqFormPickerSmallImageView
PoqFormPickerSmallImageView

Similar to PoqFormPickerImageView, PoqFormPickerSmallImageView allows the user to select a form from an image list but using less space.

You can use it in the layout:

<com.poqstudio.platform.view.formselection.form.picker.view.image.ui.PoqFormPickerSmallImageView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
And then call its setUp method.

You can also use its Compose version directly FormPickerSmallImage.