diff --git a/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/CameraFragment.java b/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/CameraFragment.java
index 6228aac..7c523a3 100644
--- a/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/CameraFragment.java
+++ b/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/CameraFragment.java
@@ -1,5 +1,6 @@
package nl.myhyvesbookplus.tagram;
+import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -10,13 +11,17 @@ import android.net.Uri;
import android.os.Bundle;
import android.app.Fragment;
import android.support.design.widget.FloatingActionButton;
+import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
import android.widget.RelativeLayout;
import nl.myhyvesbookplus.tagram.controller.PostUploader;
+import nl.myhyvesbookplus.tagram.model.BitmapPost;
/**
* A simple {@link Fragment} subclass.
@@ -80,6 +85,9 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
+ ((AppCompatActivity)getActivity()).getSupportActionBar().hide();
+ getActivity().findViewById(R.id.content).setPadding(0,0,0,0);
+
final View view = inflater.inflate(R.layout.fragment_camera, container, false);
mCamera = getCameraInstance(facing);
@@ -108,6 +116,7 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
mCameraLayout.removeView(mPreview);
mCamera = getCameraInstance(facing);
+
mPreview = new CameraPreview(getActivity().getBaseContext(), mCamera);
mCameraLayout.addView(mPreview);
@@ -122,12 +131,12 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
mCamera.takePicture(null, null, new PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {
- Bitmap bmp = rotate(BitmapFactory.decodeByteArray(data, 0, data.length, null), 90);
- mPhoto = bmp;
+// Bitmap bmp = rotate(BitmapFactory.decodeByteArray(data, 0, data.length, null), 90);
+// mPhoto = bmp;
+ mPhoto = BitmapFactory.decodeByteArray(data, 0, data.length, null);
PicturePreview mPicPreview = new PicturePreview(getActivity().getBaseContext(), mPhoto);
mPicPreview.setId(R.id.pic_preview);
- Log.d(TAG, "onPictureTaken: PICTURE");
mCameraLayout.addView(mPicPreview);
@@ -144,6 +153,20 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
(view.findViewById(R.id.upload_button)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
+ view.findViewById(R.id.comment_box).bringToFront();
+ }
+ });
+
+ (view.findViewById(R.id.comment_submit)).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ EditText mComment = (EditText) view.findViewById(R.id.comment_text);
+
+ String comment = mComment.getText().toString();
+ mComment.setText("");
+
+ PostUploader upload = new PostUploader(getActivity());
+ upload.uploadPicture(new BitmapPost(((PicturePreview)view.findViewById(R.id.pic_preview)).getPicture(), comment));
mPhoto.recycle();
mPhoto = null;
@@ -155,7 +178,7 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
mCamera = getCameraInstance(facing);
Camera.Parameters params = mCamera.getParameters();
- params.setRotation(0);
+ params.setRotation(90);
mCamera.setParameters(params);
mPreview = new CameraPreview(getActivity().getBaseContext(), mCamera);
@@ -165,6 +188,7 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
view.findViewById(R.id.switch_camera_button).bringToFront();
mCameraLayout.removeView(view.findViewById(R.id.pic_preview));
+
}
});
@@ -204,9 +228,23 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
}
});
+ (view.findViewById(R.id.comment_text)).setOnFocusChangeListener(new View.OnFocusChangeListener() {
+ @Override
+ public void onFocusChange(View v, boolean hasFocus) {
+ if (!hasFocus) {
+ hideKeyboard(v);
+ }
+ }
+ });
+
return view;
}
+ public void hideKeyboard(View view) {
+ InputMethodManager inputMethodManager =(InputMethodManager) getActivity().getSystemService(Activity.INPUT_METHOD_SERVICE);
+ inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
+ }
+
// TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) {
if (mListener != null) {
@@ -231,14 +269,22 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
mListener = null;
}
- public static Bitmap rotate(Bitmap bitmap, int degree) {
- int w = bitmap.getWidth();
- int h = bitmap.getHeight();
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ int padding = 16; // 6 dps
+ float scale = getResources().getDisplayMetrics().density;
+ int dp = (int) (padding * scale + 0.5f);
+ ((AppCompatActivity)getActivity()).getSupportActionBar().show();
+ getActivity().findViewById(R.id.content).setPadding(dp,dp,dp,dp);
+ }
+
+ public static Bitmap rotate(Bitmap bmp, int degree) {
Matrix mtx = new Matrix();
- mtx.postRotate(degree);
+ mtx.setRotate(degree);
- return Bitmap.createBitmap(bitmap, 0, 0, w, h, mtx, true);
+ return Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), mtx, true);
}
public static Camera getCameraInstance(int facing) {
@@ -261,18 +307,18 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
public void switchButtons(View view) {
RelativeLayout pictureButtons = (RelativeLayout) view.findViewById(R.id.picture_taken_buttons);
FloatingActionButton upload = (FloatingActionButton) view.findViewById(R.id.upload_button);
- FloatingActionButton save = (FloatingActionButton) view.findViewById(R.id.save_button);
+// FloatingActionButton save = (FloatingActionButton) view.findViewById(R.id.save_button);
if (((Integer)upload.getVisibility()).equals(View.VISIBLE)) {
upload.hide();
- save.hide();
+// save.hide();
view.findViewById(R.id.picture_button).setVisibility(View.VISIBLE);
view.findViewById(R.id.switch_camera_button).setVisibility(View.VISIBLE);
} else {
pictureButtons.bringToFront();
upload.show();
- save.show();
+// save.show();
view.findViewById(R.id.picture_button).setVisibility(View.GONE);
view.findViewById(R.id.switch_camera_button).setVisibility(View.GONE);
diff --git a/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/CameraPreview.java b/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/CameraPreview.java
index 84fbe45..0f07ad2 100644
--- a/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/CameraPreview.java
+++ b/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/CameraPreview.java
@@ -11,7 +11,6 @@ public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback
private static String TAG = "CameraPreview";
private SurfaceHolder mHolder;
private Camera mCamera;
- private static int facing = Camera.CameraInfo.CAMERA_FACING_BACK;
public CameraPreview(Context context, Camera camera) {
super(context);
@@ -25,7 +24,6 @@ public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback
@Override
public void surfaceCreated(SurfaceHolder mHolder) {
try {
- Log.d(TAG, "surfaceCreated: CREATED");
mCamera.setPreviewDisplay(mHolder);
mCamera.startPreview();
} catch (IOException e) {
@@ -62,15 +60,7 @@ public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
- Log.d(TAG, "surfaceDestroyed: DESTROYED");
mCamera.stopPreview();
mCamera.release();
}
-
- public static void switchFacing() {
- if (facing == Camera.CameraInfo.CAMERA_FACING_FRONT)
- facing = Camera.CameraInfo.CAMERA_FACING_BACK;
- else
- facing = Camera.CameraInfo.CAMERA_FACING_FRONT;
- }
}
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 ab1768c..9d4e938 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
@@ -15,6 +15,7 @@ import android.view.View;
import com.google.firebase.auth.FirebaseAuth;
import nl.myhyvesbookplus.tagram.controller.DownloadClass;
+import nl.myhyvesbookplus.tagram.controller.PostUploader;
import nl.myhyvesbookplus.tagram.controller.ProfilePictureUploader;
public class MainActivity extends AppCompatActivity implements
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 4fe18a5..80c2dee 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
@@ -28,6 +28,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.createBitmap(bmp);
setWillNotDraw(false);
}
@@ -41,17 +42,26 @@ public class PicturePreview extends SurfaceView implements SurfaceHolder.Callbac
switch (currentFilter) {
case FILTER_NONE:
canvas.drawBitmap(picture, 0, 0, null);
+ canvas.rotate(90);
filterPicture = picture;
break;
case FILTER_SEPIA:
canvas.drawBitmap(toSepia(picture), 0, 0, null);
+ canvas.rotate(90);
filterPicture = toSepia(picture);
break;
case FILTER_BW:
+ Canvas bw = new Canvas();
+ filterPicture = Bitmap.createBitmap(1920, 1440, null);
+// filterPicture = Bitmap.createBitmap(picture.getWidth(), picture.getHeight(), null);
cm.setSaturation(0);
filter = new ColorMatrixColorFilter(cm);
paint.setColorFilter(filter);
+ bw.setBitmap(filterPicture);
+ bw.drawBitmap(picture, 0, 0, paint);
+ bw.rotate(90);
canvas.drawBitmap(picture, 0, 0, paint);
+ canvas.rotate(90);
break;
}
}
@@ -85,7 +95,7 @@ public class PicturePreview extends SurfaceView implements SurfaceHolder.Callbac
}
public Bitmap toSepia(Bitmap color) {
- int red, green, blue, pixel, gry;
+ int red, green, blue, pixel;
int height = color.getHeight();
int width = color.getWidth();
int depth = 20;
diff --git a/app/MyHyvesBookPlusStagram/app/src/main/res/layout/fragment_camera.xml b/app/MyHyvesBookPlusStagram/app/src/main/res/layout/fragment_camera.xml
index fca8b36..27b8601 100644
--- a/app/MyHyvesBookPlusStagram/app/src/main/res/layout/fragment_camera.xml
+++ b/app/MyHyvesBookPlusStagram/app/src/main/res/layout/fragment_camera.xml
@@ -70,6 +70,35 @@
android:src="@drawable/ic_arrow_forward_black_24dp"/>
+
+
+
+
+
+
+
+
+
-
+ android:src="@android:drawable/ic_menu_save"/>-->
diff --git a/notulen/notulen_3_2662017.tex b/notulen/notulen_3_2662017.tex
new file mode 100644
index 0000000..95be50b
--- /dev/null
+++ b/notulen/notulen_3_2662017.tex
@@ -0,0 +1,110 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% LATEX-TEMPLATE GENERIEK
+% Voor readme en meest recente versie, zie
+% https://gitlab-fnwi.uva.nl/informatica/LaTeX-template.git
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%-------------------------------------------------------------------------------
+% PACKAGES EN DOCUMENT CONFIGURATIE
+%-------------------------------------------------------------------------------
+
+\documentclass{uva-inf-article}
+\newcommand\tab[1][1cm]{\hspace*{#1}}
+\newcommand\tabb[1][1.4cm]{\hspace*{#1}}
+\usepackage[dutch]{babel}
+\usepackage{booktabs}
+%-------------------------------------------------------------------------------
+% GEGEVENS VOOR IN DE TITEL, HEADER EN FOOTER
+%-------------------------------------------------------------------------------
+
+
+
+% Vul de naam van de opdracht in.
+\assignment{Notulen: The Return Of The MyHyvesBook+}
+% Vul het soort opdracht in.
+\assignmenttype{Samenvatting}
+% Vul de titel van de eindopdracht in.
+\title{Entry 3: Afrondende fase}
+
+% Vul de volledige namen van alle auteurs in.
+\authors{Marijn Jansen; Felix Atsma; Paul Lagerweij; Niels Zwemmer}
+% Vul de corresponderende UvAnetID's in.
+\uvanetids{11166932; 11035064; 11306084; 11025980}
+
+% Vul altijd de naam in van diegene die het nakijkt, tutor of docent.
+\tutor{Robin Klusman}
+% Vul eventueel ook de naam van de docent of vakcoordinator toe.
+\docent{drs. A. van Inge}
+% Vul hier de naam van de PAV-groep in.
+\group{C1 (C++)}
+% Vul de naam van de cursus in.
+\course{Multimedia}
+% Te vinden op onder andere Datanose.
+\courseid{5062MULT6Y}
+
+% Dit is de datum die op het document komt te staan. Standaard is dat vandaag.
+\date{\today}
+
+%-------------------------------------------------------------------------------
+% VOORPAGINA EN EVENTUEEL INHOUDSOPGAVE EN ABSTRACT
+%-------------------------------------------------------------------------------
+
+\begin{document}
+\maketitle
+
+\noindent
+\textbf{Data Vergadering}\\\\
+Datum:\tab 26-6-2017
+\\
+Tijd:\tabb 11:00-12:00
+\\
+\\
+\noindent
+Aanwezig (fysiek):\tabb\space\space\space Marijn, Felix, Niels\\
+Aanwezig (telefonisch):\tab Paul\\
+Afwezig:\tabb\tabb\space\space\space\space-\\\\
+\noindent
+\textbf{Onderwerpen besproken}
+
+\begin{itemize}
+\item Implementatiekeuzes: Besluit genomen de profielfoto beter te maken door file te uploaden i.p.v. thumbnail-bitmap.
+\item Evaluatie: Hoe staan we ervoor? De app krijgt nu vorm. Eerste poging tot alles mergen zal morgen zijn.
+\item Evaluatie: Teksten van de poster en flyers zijn nu grotendeels bedacht. Marijn en Felix zullen gezamelijk de layout verder verzorgen.
+\end{itemize}
+\pagebreak
+
+\noindent
+\textbf{Positieve punten naar voren gekomen}\\\\
+Onze app krijgt nu vorm in de zin dat er steeds meer functionaliteit op elkaar afgestemd wordt en samenwerkt. De losse modules implementeren zoals wij hadden bedacht is een geslaagd idee. Niels heeft zijn lastige bug nu opgelost waardoor hogere resolutie foto's kunnen worden opgeslagen. Felix is bijna klaar met de filters. Marijn zal aan het einde van de middag de verschillende upload-classes en de download-class klaar hebben. Paul werkt als groepswerker op alle fronten mee aan de code.
+\\\\
+
+\noindent
+\textbf{Kort}
+\begin{itemize}
+\item Wederom goede vooruitgang, zowel poster als programma.
+\item File uploaden is nu geslaagd en profielfoto is niet meer lelijk.
+\item We liggen op schema; back-end bijna af.
+\end{itemize}
+
+\noindent
+\textbf{Negatieve punten naar voren gekomen}\\\\
+De bugs oplossen heeft meer tijd gekost dan gehoopt. Daardoor leken we wat van het schema af te zullen wijken. Gelukkig bleek dit mee te vallen. Echter zal er toch nog even hard doorgewerkt moeten worden de laatste paar dagen.\\
+Er bestaat nog steeds veel onduidelijkheid over het individuele verslag en de overige PAV onderdelen. Communicatie bij het vak laat wederom te wensen over. Niels zal een e-mail sturen naar Toto en hopelijk kan er morgen gesproken worden met Youri over een aantal zaken.
+\\\\
+
+\noindent
+\textbf{Kort}
+\begin{itemize}
+\item Bugs oplossen heeft meer tijd gekost dan gehoopt.
+\item Veel onduidelijkheid over het individuele verslag.
+\item Communicatie laat te wensen over.
+\item Er is nog wat werk aan de winkel, niet alles werkt nog naar behoren.
+\end{itemize}
+
+ \vfill \hfill \textit{“Ik sis 't mar gewoan: ik ha in hekel oan moandeitemoarn.”}
+
+%-------------------------------------------------------------------------------
+% INHOUD
+%-------------------------------------------------------------------------------
+
+\end{document}