default picture if no profile photo in firebase

This commit is contained in:
Paul Lagerweij
2017-06-21 13:07:29 +02:00
parent e787204ce7
commit 6db7ca20ae

View File

@@ -13,7 +13,6 @@ import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import android.widget.ImageView; import android.widget.ImageView;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.firebase.ui.storage.images.FirebaseImageLoader; import com.firebase.ui.storage.images.FirebaseImageLoader;
import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseAuth;
@@ -22,8 +21,6 @@ import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference; import com.google.firebase.storage.StorageReference;
import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseAuth;
/** /**
* A simple {@link Fragment} subclass. * A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the * Activities that contain this fragment must implement the
@@ -104,13 +101,17 @@ public class ProfileFragment extends Fragment implements View.OnClickListener{
// Inflate the layout for this fragment // Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_profile, container, false); View view = inflater.inflate(R.layout.fragment_profile, container, false);
findViews(view); findViews(view);
if (httpsReference != null) {
Glide.with(this).using(new FirebaseImageLoader()).load(httpsReference).into(profilePicture); Glide.with(this).using(new FirebaseImageLoader()).load(httpsReference).into(profilePicture);
}
return view; return view;
} }
// TODO: Rename method, update argument and hook method into UI event // TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) { public void onButtonPressed(Uri uri) {
if (mListener != null) { - if (mListener != null) {
mListener.onFragmentInteraction(uri); mListener.onFragmentInteraction(uri);
} }
} }