-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
0c38a02
to
4c15eec
Compare
@@ -57,5 +57,10 @@ | |||
<attr name="cg_sl_orientation" format="integer" /> | |||
</declare-styleable> | |||
|
|||
|
|||
<declare-styleable name="SingleSelectionView"> | |||
<attr name="ss_textselector" format="reference" /> |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ss_check_drawable_selector
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ss_list_item
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the comments
**- Allows selection of multiple items from a list of options.