// Path: database/app/src/main/java/com/google/firebase/quickstart/database/java/models/Post.java
// @IgnoreExtraProperties
// public class Post {
// 
//     public String uid;
//     public String author;
//     public String title;
//     public String body;
//     public int starCount = 0;
//     public Map<String, Boolean> stars = new HashMap<>();
// 
//     public Post() {
//         // Default constructor required for calls to DataSnapshot.getValue(Post.class)
//     }
// 
//     public Post(String uid, String author, String title, String body) {
//         this.uid = uid;
//         this.author = author;
//         this.title = title;
//         this.body = body;
//     }
// 
//     @Exclude
//     public Map<String, Object> toMap() {
//         HashMap<String, Object> result = new HashMap<>();
//         result.put("uid", uid);
//         result.put("author", author);
//         result.put("title", title);
//         result.put("body", body);
//         result.put("starCount", starCount);
//         result.put("stars", stars);
// 
//         return result;
//     }
// 
// }


import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.firebase.quickstart.database.R;
import com.google.firebase.quickstart.database.java.models.Post;
package com.google.firebase.quickstart.database.java.viewholder;



public class PostViewHolder extends RecyclerView.ViewHolder {

    public TextView titleView;
    public TextView authorView;
    public ImageView starView;
    public TextView numStarsView;
    public TextView bodyView;

    public PostViewHolder(View itemView) {
        super(itemView);

        titleView = itemView.findViewById(R.id.postTitle);
        authorView = itemView.findViewById(R.id.postAuthor);
        starView = itemView.findViewById(R.id.star);
        numStarsView = itemView.findViewById(R.id.postNumStars);
        bodyView = itemView.findViewById(R.id.postBody);
    }

// Path: database/app/src/main/java/com/google/firebase/quickstart/database/java/models/Post.java
// @IgnoreExtraProperties
// public class Post {
// 
//     public String uid;
//     public String author;
//     public String title;
//     public String body;
//     public int starCount = 0;
//     public Map<String, Boolean> stars = new HashMap<>();
// 
//     public Post() {
//         // Default constructor required for calls to DataSnapshot.getValue(Post.class)
//     }
// 
//     public Post(String uid, String author, String title, String body) {
//         this.uid = uid;
//         this.author = author;
//         this.title = title;
//         this.body = body;
//     }
// 
//     @Exclude
//     public Map<String, Object> toMap() {
//         HashMap<String, Object> result = new HashMap<>();
//         result.put("uid", uid);
//         result.put("author", author);
//         result.put("title", title);
//         result.put("body", body);
//         result.put("starCount", starCount);
//         result.put("stars", stars);
// 
//         return result;
//     }
// 
// }


// Path: database/app/src/main/java/com/google/firebase/quickstart/database/java/viewholder/PostViewHolder.java
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.firebase.quickstart.database.R;
import com.google.firebase.quickstart.database.java.models.Post;

package com.google.firebase.quickstart.database.java.viewholder;



public class PostViewHolder extends RecyclerView.ViewHolder {

    public TextView titleView;
    public TextView authorView;
    public ImageView starView;
    public TextView numStarsView;
    public TextView bodyView;

    public PostViewHolder(View itemView) {
        super(itemView);

        titleView = itemView.findViewById(R.id.postTitle);
        authorView = itemView.findViewById(R.id.postAuthor);
        starView = itemView.findViewById(R.id.star);
        numStarsView = itemView.findViewById(R.id.postNumStars);
        bodyView = itemView.findViewById(R.id.postBody);
    }

    public void bindToPost(Post post, View.OnClickListener starClickListener) {