Besitzer wird nun angezeigt

This commit is contained in:
Georg Reisinger 2019-02-20 22:44:10 +01:00
parent e08c6fb8d5
commit f719fe1326

View File

@ -17,6 +17,9 @@ import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser; import com.google.firebase.auth.FirebaseUser;
import com.squareup.picasso.Picasso; import com.squareup.picasso.Picasso;
import org.json.JSONException;
import java.sql.SQLException;
import java.util.List; import java.util.List;
import at.smartshopper.smartshopper.R; import at.smartshopper.smartshopper.R;
@ -107,23 +110,20 @@ public class ShoppinglistSharedAdapter extends RecyclerView.Adapter<Shoppinglist
holder.shoppinglistColor.setBackgroundColor(cardcolor); holder.shoppinglistColor.setBackgroundColor(cardcolor);
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); try {
if (user != null) { Member admin = db.getAdmin(shoppinglist.getSlId());
// Name, email address, and profile photo Url Picasso.get().load(admin.getPic()).resize(250, 250).transform(new RoundCornersTransformation(30, 30, true, true)).into(holder.imageView);
String name = user.getDisplayName(); holder.ownerName.setText(admin.getName());
Uri photoUrl = user.getPhotoUrl(); } catch (SQLException e) {
holder.ownerName.setText(name); e.printStackTrace();
Picasso.get().load(photoUrl).resize(250, 250).transform(new RoundCornersTransformation(30, 30, true, true)).into(holder.imageView); } catch (JSONException e) {
// holder.imageView.setImageDrawable(Drawable.createFromPath("@drawable/common_google_signin_btn_icon_dark")); e.printStackTrace();
// Check if user's email is verified
// The user's ID, unique to the Firebase project. Do NOT use this value to
// authenticate with your backend server, if you have one. Use
// FirebaseUser.getIdToken() instead.
} }
} }