2020-03-01 20:59:20
package com.xbsaykat.easy24admin.LekhokApprove;
 
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
 
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
 
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.squareup.picasso.Picasso;
import com.xbsaykat.easy24admin.R;
 
public class LekhokHistoryView extends RecyclerView.ViewHolder {
 
    public LekhokHistoryView(@NonNull View itemView) {
        super(itemView);
    }
 
    public void setDetails(final Context context, final String Date, final String Key, final String Position, final String prodetails, final String proimg, final String protype,final String proselname,final String proselphn) {
        TextView LekhokName = itemView.findViewById(R.id.types);
        TextView LekhokPlace = itemView.findViewById(R.id.shortdetails);
        TextView LekhokDate = itemView.findViewById(R.id.date);
        ImageView LekhokImage = itemView.findViewById(R.id.images);
        TextView Delete = itemView.findViewById(R.id.delete);
        TextView Approve = itemView.findViewById(R.id.approve);
 
        LekhokName.setText("লেখার ধরন : " + protype);
        LekhokPlace.setText( prodetails);
        LekhokDate.setText("প্রকাশের তারিখ : " + Date);
        Picasso.get().load(proimg).resize(720, 350).centerCrop().into(LekhokImage);
 
        Delete.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                try {
                    DatabaseReference Revew = FirebaseDatabase.getInstance().getReference().child("RevewLekhok").child(Key);
                    Revew.removeValue();
 
 
                } catch (Exception IO) {
 
                }
 
            }
        });
        Approve.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                DatabaseReference Lekhok= FirebaseDatabase.getInstance().getReference().child("Lekhok");
                Lekhok.child( Position).child(Key).child("proimg").setValue(proimg);
                Lekhok.child( Position).child(Key).child("prodetails").setValue(prodetails);
                Lekhok.child( Position).child(Key).child("date").setValue(Date);
                Lekhok.child( Position).child(Key).child("uname").setValue(proselname);
 
                DatabaseReference Revew = FirebaseDatabase.getInstance().getReference().child("RevewLekhok").child(Key);
                Revew.removeValue();
            }
        });
 
    }
}
 
Invalid Email or Password