Added ProgressDialog to upload.

This commit is contained in:
Marijn Jansen
2017-06-23 20:35:47 +02:00
parent 8ba9f7f8e3
commit a71fc80f59
2 changed files with 4 additions and 0 deletions

View File

@@ -114,6 +114,7 @@ public class MainActivity extends AppCompatActivity implements CameraFragment.On
FragmentManager man = getFragmentManager(); FragmentManager man = getFragmentManager();
ProfileFragment frag = (ProfileFragment) man.findFragmentById(R.id.content); ProfileFragment frag = (ProfileFragment) man.findFragmentById(R.id.content);
FragmentTransaction transaction = man.beginTransaction(); FragmentTransaction transaction = man.beginTransaction();
frag.progressDialog.dismiss();
transaction.detach(frag) transaction.detach(frag)
.attach(frag) .attach(frag)
.commit(); .commit();

View File

@@ -1,6 +1,7 @@
package nl.myhyvesbookplus.tagram; package nl.myhyvesbookplus.tagram;
import android.app.Fragment; import android.app.Fragment;
import android.app.ProgressDialog;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Bitmap; import android.graphics.Bitmap;
@@ -54,6 +55,7 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
protected TextView profileName; protected TextView profileName;
protected ImageView profilePicture; protected ImageView profilePicture;
protected FirebaseUser user; protected FirebaseUser user;
ProgressDialog progressDialog;
// TODO: Rename and change types of parameters // TODO: Rename and change types of parameters
private String mParam1; private String mParam1;
private String mParam2; private String mParam2;
@@ -189,6 +191,7 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) { if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {
Bundle extras = data.getExtras(); Bundle extras = data.getExtras();
Bitmap imageBitmap = (Bitmap) extras.get("data"); Bitmap imageBitmap = (Bitmap) extras.get("data");
progressDialog = ProgressDialog.show(getActivity(), getString(R.string.please_wait), "bezig met uploaden", false, false);
UploadClass uploadClass = new UploadClass(getActivity()); UploadClass uploadClass = new UploadClass(getActivity());
uploadClass.uploadProfilePicture(imageBitmap); uploadClass.uploadProfilePicture(imageBitmap);
} }