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
Custom Component #9
Comments
I guess why I need is be able to cast the inflation to a my custom component EasyAdapter.java:119: convertView = What you think? |
I've never tried this but you should be able to use a custom component in the same way as a normal layout file. Your <com.example.testapp.components.CommentItem
android:id="@+id/comment"
android:layout_width="fill_parent"
android:layout_height="fill_parent" /> The CommentItem customView = (CommentItem) getView(); |
Ok I will try this. Let's say I have a method on the CommentItem class that sets the UI:
Is it possible to call this method like this?
Sorry i'm new to Android. |
public void onSetValues(Debate item, PositionInfo positionInfo) {
CommentItem commentView = (CommentItem) getView();
commentView.setUI(item);
} |
Excellent! It works like a charm. :) |
I know it was a little bit off topic. Thanks for all. |
I have this:
What if I have a custom component that extends LinearLayout and is in charge of inflating and populating the R.layout.item_comment?
I use this to place a "comment" into a layout:
Is there a way to use a custom component with a view holder?
Hope I explained my situation in a way you can understand.
Here's an explanation of what I'm trying to do I think: http://blog.xebia.com/2013/07/22/viewholder-considered-harmful/
The text was updated successfully, but these errors were encountered: