-
Notifications
You must be signed in to change notification settings - Fork 4
Arihant #4
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
base: master
Are you sure you want to change the base?
Arihant #4
Conversation
|
|
Also there is no need of the package |
| android:layout_height="match_parent" | ||
| android:background="#466" | ||
| tools:context="com.sdsmdg.hareshkh.lectureassignment.arihant.Activities.RecyclerViewActivity"> | ||
| <android.support.v7.widget.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.
RecyclerView is an extension of a viewgroup, and can be used as root layout in absence of other views, which is the case here.
| @@ -0,0 +1,46 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <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.
It is preferable to use a single Relative Layout instead of nested Linear Layouts
| @Override | ||
| public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) { | ||
| final MovieModel movieModel = movieModels.get(position); | ||
| ((Item)holder).itemName.setText(movieModel.getName()); |
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.
OnBindViewholder can have first parameter as the object of your custom viewHolder ie item so holder does not need to cast to “Item” for every object. Refer AndroidHive again.
|
Package names must be in lower case, haresh already told you to do that. |
No description provided.