From 84353046a5a6b812a93af34faf2517e660220215 Mon Sep 17 00:00:00 2001 From: Niels Zwemmer Date: Tue, 27 Jun 2017 11:11:29 +0200 Subject: [PATCH 1/2] Fixed implement runtime error for Felix. Made some minor changes to both strings.xml and ProfilePictureUploader (error when old picture not present). --- .../main/java/nl/myhyvesbookplus/tagram/MainActivity.java | 7 ++++++- .../tagram/controller/ProfilePictureUploader.java | 4 +++- .../app/src/main/res/values-nl/strings.xml | 3 +-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/MainActivity.java b/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/MainActivity.java index 9d4e938..7c98ae4 100644 --- a/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/MainActivity.java +++ b/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/MainActivity.java @@ -21,7 +21,7 @@ import nl.myhyvesbookplus.tagram.controller.ProfilePictureUploader; public class MainActivity extends AppCompatActivity implements CameraFragment.OnFragmentInteractionListener, ProfilePictureUploader.ProfilePictureUpdatedListener, - DownloadClass.PostDownloadListener { + DownloadClass.PostDownloadListener, PostUploader.PostUploadListener { final static private String TAG = "MainScreen"; FirebaseAuth mAuth; @@ -130,4 +130,9 @@ public class MainActivity extends AppCompatActivity implements frag.startList(); } + + @Override + public void PostUploadComplete(Boolean success) { + + } } diff --git a/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/controller/ProfilePictureUploader.java b/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/controller/ProfilePictureUploader.java index 3264976..65e1de9 100644 --- a/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/controller/ProfilePictureUploader.java +++ b/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/controller/ProfilePictureUploader.java @@ -75,7 +75,9 @@ public class ProfilePictureUploader extends UploadClass { public void onComplete(@NonNull Task task) { Log.d(TAG, "onComplete: Updated profile picture"); mListener.ProfilePictureUpdated(true); - removeOldPicture(); + if (oldPicture != null) { + removeOldPicture(); + } } }); } diff --git a/app/MyHyvesBookPlusStagram/app/src/main/res/values-nl/strings.xml b/app/MyHyvesBookPlusStagram/app/src/main/res/values-nl/strings.xml index 79c3196..e38d9a7 100644 --- a/app/MyHyvesBookPlusStagram/app/src/main/res/values-nl/strings.xml +++ b/app/MyHyvesBookPlusStagram/app/src/main/res/values-nl/strings.xml @@ -29,7 +29,6 @@ Uploaden Foto opslaan mislukt. Zorg a.u.b. dat er genoeg ruimte op uw telefoon beschikbaar is. Het updaten van de profielfoto is mislukt. Controleer uw internetverbinding. - Profielfoto aan het uploaden... - Wacht a.u.b. + Profielfoto aan het uploaden… \"Niet slecht.\"s \ No newline at end of file From 9322840d10e9febfb55aa2f285b052724c59c562 Mon Sep 17 00:00:00 2001 From: Niels Zwemmer Date: Tue, 27 Jun 2017 11:29:48 +0200 Subject: [PATCH 2/2] Minor changes to picture. --- .../main/java/nl/myhyvesbookplus/tagram/PicturePreview.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/PicturePreview.java b/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/PicturePreview.java index 80c2dee..736e1b6 100644 --- a/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/PicturePreview.java +++ b/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/PicturePreview.java @@ -27,7 +27,7 @@ public class PicturePreview extends SurfaceView implements SurfaceHolder.Callbac public PicturePreview(Context context, Bitmap bmp) { super(context); - picture = Bitmap.createScaledBitmap(bmp, 1920, 1440, false); + picture = Bitmap.createScaledBitmap(bmp, bmp.getWidth() / 2, bmp.getHeight() / 2, false); // picture = Bitmap.createBitmap(bmp); setWillNotDraw(false); } @@ -52,8 +52,8 @@ public class PicturePreview extends SurfaceView implements SurfaceHolder.Callbac break; case FILTER_BW: Canvas bw = new Canvas(); - filterPicture = Bitmap.createBitmap(1920, 1440, null); -// filterPicture = Bitmap.createBitmap(picture.getWidth(), picture.getHeight(), null); +// filterPicture = Bitmap.createBitmap(1920, 1440, null); + filterPicture = Bitmap.createBitmap(picture.getWidth() / 2, picture.getHeight() / 2, Bitmap.Config.ARGB_8888); cm.setSaturation(0); filter = new ColorMatrixColorFilter(cm); paint.setColorFilter(filter);