0

I want to create a view such that at the top is a profile bio and below are blog posts, both of which are scrollable as one view, similar to Twitter user profile view. First i tried, having a layout with textview at top (for profile bio) and listview below (for blog posts), the problem was blog posts could scroll but not profile bio. Now I am trying to insert a item (profile bio) in a listview and item will be at the top position, but now I am stuck not knowing what to do.

Here is what I have

public class TimelineAdapter  extends FirebaseListAdapter<Post> {

public TimelineAdapter(Activity activity, Class<Post> modelClass, int modelLayout, DatabaseReference ref) {
    super(activity, modelClass, modelLayout, ref);
}

@Override
protected void populateView(View v, Post model, int position) {

    TextView textViewPost = (TextView)v.findViewById(R.id.post_content);
    textViewPost.setText(model.getPost());

}

//reordering adapter so newest post is at top
@Override
public Post getItem(int position) {
    return super.getItem(getCount() - position -1);
}

}

I have 2 different item layouts that I want inserted i.e if position is 0 insert layoutA for profile bio and else insert layoutB for blog posts

Ndheti
  • 266
  • 3
  • 18

0 Answers0