Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi selection listview #10

Merged
merged 8 commits into from
May 15, 2024
Merged

Conversation

MalaRuparel2023
Copy link
Collaborator

**- Allows selection of multiple items from a list of options.

  • Customizable text color, check mark, and orientation.
  • Supports both vertical and horizontal orientations.**

@MalaRuparel2023 MalaRuparel2023 force-pushed the multi_selection_listview branch from 0c38a02 to 4c15eec Compare May 9, 2024 11:08
@@ -57,5 +57,10 @@
<attr name="cg_sl_orientation" format="integer" />
</declare-styleable>


<declare-styleable name="SingleSelectionView">
<attr name="ss_textselector" format="reference" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name should be "ss_text_selector"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

<declare-styleable name="SingleSelectionView">
<attr name="ss_textselector" format="reference" />
<attr name="ss_orientation" format="reference" />
<attr name="ss_checkdrawableselector" format="dimension" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ss_check_drawable_selector

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

<attr name="ss_textselector" format="reference" />
<attr name="ss_orientation" format="reference" />
<attr name="ss_checkdrawableselector" format="dimension" />
<attr name="ss_listitem" format="reference" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ss_list_item

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done
Can i make a common style for all custom view ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by common style?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

total thare are 5 to 6 styleable in attrs file for all custom view and half are almost same . and I have instructed for only bgSelector and tetSelector for version 1

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it separate as of now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File name: BaseSelection
Class name: BaseClass

It should be consistent. and make sure the class name is proper. You are extending recyclerview. It should be like "BaseRecyclerView". From the name, the user should know about the class itself.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a change of the default value set at initialization.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate the class of adapter.

Same as other files if its there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


inner class SingleSelectionListViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {

val cardView: MaterialCardView by lazy { MaterialCardView(itemView.context) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we are creating a new object when we already have a view inside the XML file of the adapter class?

And make sure we use viewbinding when needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Collaborator

@sagarsmartsense sagarsmartsense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check my comments

/**
* created by Mala Ruparel ON 10/05/24
*/
abstract class BaseLinearLayout<T> : LinearLayout {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any usage of generic T?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

/**
* created by Mala Ruparel ON 08/05/24
*/
abstract class BaseRecycleView<T> : RecyclerView {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the usage of generic T?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Copy link
Collaborator

@sagarsmartsense sagarsmartsense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the comments

@sagarsmartsense sagarsmartsense merged commit 1b2d846 into development May 15, 2024
2 checks passed
@sagarsmartsense sagarsmartsense deleted the multi_selection_listview branch May 17, 2024 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants