Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdcd141f23 | ||
|
|
5f5269ceb8 | ||
|
|
d7b2e54306 | ||
|
|
8ea692c5a8 | ||
|
|
d4bfe0206b | ||
|
|
d61b058d0e | ||
|
|
979f1aab9a |
@@ -246,9 +246,15 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
|||||||
* Switch between front facing camera and the back camera.
|
* Switch between front facing camera and the back camera.
|
||||||
*/
|
*/
|
||||||
public void switchFacing() {
|
public void switchFacing() {
|
||||||
facing = facing == Camera.CameraInfo.CAMERA_FACING_FRONT ?
|
if (facing == Camera.CameraInfo.CAMERA_FACING_FRONT)
|
||||||
Camera.CameraInfo.CAMERA_FACING_BACK :
|
facing = Camera.CameraInfo.CAMERA_FACING_BACK;
|
||||||
Camera.CameraInfo.CAMERA_FACING_FRONT;
|
else
|
||||||
|
facing = Camera.CameraInfo.CAMERA_FACING_FRONT;
|
||||||
|
// TODO
|
||||||
|
// facing =
|
||||||
|
// facing == Camera.CameraInfo.CAMERA_FACING_FRONT ?
|
||||||
|
// Camera.CameraInfo.CAMERA_FACING_BACK :
|
||||||
|
// Camera.CameraInfo.CAMERA_FACING_FRONT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,11 +15,10 @@ import android.view.SurfaceHolder;
|
|||||||
import android.view.SurfaceView;
|
import android.view.SurfaceView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by felix on 23/06/2017.
|
* Draws the picture taken and applies filters, which can be switched.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class PicturePreview extends SurfaceView implements SurfaceHolder.Callback {
|
public class PicturePreview extends SurfaceView implements SurfaceHolder.Callback {
|
||||||
private static final String TAG = "PicturePreveiew";
|
private static final String TAG = "PicturePreview";
|
||||||
private static final int FILTER_NONE = 0;
|
private static final int FILTER_NONE = 0;
|
||||||
private static final int FILTER_SEPIA = 1;
|
private static final int FILTER_SEPIA = 1;
|
||||||
private static final int FILTER_BW = 2;
|
private static final int FILTER_BW = 2;
|
||||||
@@ -27,11 +26,17 @@ public class PicturePreview extends SurfaceView implements SurfaceHolder.Callbac
|
|||||||
|
|
||||||
private static int currentFilter = FILTER_NONE;
|
private static int currentFilter = FILTER_NONE;
|
||||||
|
|
||||||
int facing;
|
private int facing;
|
||||||
int rotate;
|
private int rotate;
|
||||||
Bitmap picture;
|
private Bitmap picture;
|
||||||
Bitmap filterPicture;
|
private Bitmap filterPicture;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor: changes image based on current direction the camera is facing.
|
||||||
|
* @param context
|
||||||
|
* @param bmp Image to be previewed.
|
||||||
|
* @param facing Direction camera is facing.
|
||||||
|
*/
|
||||||
public PicturePreview(Context context, Bitmap bmp, int facing) {
|
public PicturePreview(Context context, Bitmap bmp, int facing) {
|
||||||
super(context);
|
super(context);
|
||||||
setWillNotDraw(false);
|
setWillNotDraw(false);
|
||||||
@@ -45,9 +50,12 @@ public class PicturePreview extends SurfaceView implements SurfaceHolder.Callbac
|
|||||||
picture = Bitmap.createScaledBitmap(bmp, bmp.getWidth() / 2, bmp.getHeight() / 2, false);
|
picture = Bitmap.createScaledBitmap(bmp, bmp.getWidth() / 2, bmp.getHeight() / 2, false);
|
||||||
rotate = 90;
|
rotate = 90;
|
||||||
}
|
}
|
||||||
Log.d(TAG, "PicturePreview: " + bmp.getWidth() + " " + bmp.getHeight());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks the current filter and draws and saves the image with altered colours.
|
||||||
|
* @param canvas
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void onDraw(Canvas canvas) {
|
protected void onDraw(Canvas canvas) {
|
||||||
super.onDraw(canvas);
|
super.onDraw(canvas);
|
||||||
@@ -107,6 +115,9 @@ public class PicturePreview extends SurfaceView implements SurfaceHolder.Callbac
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Switches filter to the left.
|
||||||
|
*/
|
||||||
public static void filterPrev() {
|
public static void filterPrev() {
|
||||||
switch (currentFilter) {
|
switch (currentFilter) {
|
||||||
case FILTER_NONE:
|
case FILTER_NONE:
|
||||||
@@ -124,6 +135,9 @@ public class PicturePreview extends SurfaceView implements SurfaceHolder.Callbac
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Switches filter to the right.
|
||||||
|
*/
|
||||||
public static void filterNext() {
|
public static void filterNext() {
|
||||||
switch (currentFilter) {
|
switch (currentFilter) {
|
||||||
case FILTER_NONE:
|
case FILTER_NONE:
|
||||||
@@ -141,6 +155,12 @@ public class PicturePreview extends SurfaceView implements SurfaceHolder.Callbac
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rotates an image by a specified amount of degrees by matrix.
|
||||||
|
* @param bmp Image to be rotated.
|
||||||
|
* @param degree Amount of degrees to rotate
|
||||||
|
* @return Rotated image.
|
||||||
|
*/
|
||||||
public static Bitmap rotate(Bitmap bmp, int degree) {
|
public static Bitmap rotate(Bitmap bmp, int degree) {
|
||||||
Matrix mtx = new Matrix();
|
Matrix mtx = new Matrix();
|
||||||
mtx.postRotate(degree);
|
mtx.postRotate(degree);
|
||||||
@@ -161,9 +181,12 @@ public class PicturePreview extends SurfaceView implements SurfaceHolder.Callbac
|
|||||||
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recycles pictures to free memory.
|
||||||
|
* @param holder
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||||
Log.d(TAG, "surfaceDestroyed: PICTURE DESTROYED");
|
|
||||||
picture.recycle();
|
picture.recycle();
|
||||||
filterPicture.recycle();
|
filterPicture.recycle();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.animation.DecelerateInterpolator;
|
import android.view.animation.DecelerateInterpolator;
|
||||||
import android.widget.BaseAdapter;
|
import android.widget.BaseAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
@@ -25,21 +28,20 @@ import java.util.ArrayList;
|
|||||||
import nl.myhyvesbookplus.tagram.model.UriPost;
|
import nl.myhyvesbookplus.tagram.model.UriPost;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class which creates views for the profile-page timeline. This is done with a ListView.
|
* Created by niels on 27-6-17.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ProfileAdapter extends BaseAdapter {
|
public class ProfileAdapter extends BaseAdapter {
|
||||||
|
|
||||||
|
private static final String TAG = "ProfileAdapter";
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private ArrayList<UriPost> mData;
|
private ArrayList<UriPost> mData;
|
||||||
private TextView comment;
|
private TextView comment;
|
||||||
private TextView nietSlechts;
|
private TextView nietSlechts;
|
||||||
private ImageView photo;
|
private ImageView photo;
|
||||||
|
|
||||||
/* Hold a reference to the current animator, so that it can be canceled mid-way. */
|
|
||||||
private Animator mCurrentAnimator;
|
private Animator mCurrentAnimator;
|
||||||
|
|
||||||
/* ProfileAdapter constructor */
|
|
||||||
ProfileAdapter(Context context, ArrayList<UriPost> data) {
|
ProfileAdapter(Context context, ArrayList<UriPost> data) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
@@ -61,13 +63,6 @@ public class ProfileAdapter extends BaseAdapter {
|
|||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Initiate a new view to be part of the ListView.
|
|
||||||
* @param position The position at which the view should start.
|
|
||||||
* @param convertView The viewconverter.
|
|
||||||
* @param parent The parent of the view.
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
View rowView = mInflater.inflate(R.layout.list_item_timeline_profile, parent, false);
|
View rowView = mInflater.inflate(R.layout.list_item_timeline_profile, parent, false);
|
||||||
@@ -90,11 +85,6 @@ public class ProfileAdapter extends BaseAdapter {
|
|||||||
return newRowView;
|
return newRowView;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Find all views from within the row.
|
|
||||||
* @param rowView The row from which views must be found.
|
|
||||||
* @return The rowView which contains the necessary views.
|
|
||||||
*/
|
|
||||||
private View findViews(View rowView) {
|
private View findViews(View rowView) {
|
||||||
comment = (TextView) rowView.findViewById(R.id.comment_timeline_profile);
|
comment = (TextView) rowView.findViewById(R.id.comment_timeline_profile);
|
||||||
nietSlechts = (TextView) rowView.findViewById(R.id.niet_slecht_count_profile);
|
nietSlechts = (TextView) rowView.findViewById(R.id.niet_slecht_count_profile);
|
||||||
|
|||||||
@@ -36,11 +36,6 @@ import nl.myhyvesbookplus.tagram.controller.ProfilePictureUploader;
|
|||||||
|
|
||||||
import static android.app.Activity.RESULT_OK;
|
import static android.app.Activity.RESULT_OK;
|
||||||
|
|
||||||
/**
|
|
||||||
* Profilefragment which holds the personal info of the user.
|
|
||||||
* Makes use of ProfileAdapter in order to load in the items for ListView.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class ProfileFragment extends Fragment implements View.OnClickListener {
|
public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||||
static final int REQUEST_TAKE_PHOTO = 1;
|
static final int REQUEST_TAKE_PHOTO = 1;
|
||||||
ProgressDialog progressDialog;
|
ProgressDialog progressDialog;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import java.util.ArrayList;
|
|||||||
import nl.myhyvesbookplus.tagram.model.UriPost;
|
import nl.myhyvesbookplus.tagram.model.UriPost;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class which creates views for the home-page timeline. This is done with a ListView.
|
* Created by marijnjansen on 26/06/2017.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class TimeLineAdapter extends BaseAdapter implements AdapterView.OnItemClickListener {
|
public class TimeLineAdapter extends BaseAdapter implements AdapterView.OnItemClickListener {
|
||||||
@@ -42,11 +42,8 @@ public class TimeLineAdapter extends BaseAdapter implements AdapterView.OnItemCl
|
|||||||
private Context mContext;
|
private Context mContext;
|
||||||
private ArrayList<UriPost> mData;
|
private ArrayList<UriPost> mData;
|
||||||
private DatabaseReference mRef;
|
private DatabaseReference mRef;
|
||||||
|
|
||||||
/* Hold a reference to the current animator, so that it can be canceled mid-way. */
|
|
||||||
private Animator mCurrentAnimator;
|
private Animator mCurrentAnimator;
|
||||||
|
|
||||||
/* TimeLineAdapter constructor */
|
|
||||||
TimeLineAdapter(Context context, ArrayList<UriPost> data) {
|
TimeLineAdapter(Context context, ArrayList<UriPost> data) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
@@ -69,17 +66,11 @@ public class TimeLineAdapter extends BaseAdapter implements AdapterView.OnItemCl
|
|||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Initiate a new view to be part of the ListView.
|
|
||||||
* @param position The position at which the view should start.
|
|
||||||
* @param convertView The viewconverter.
|
|
||||||
* @param parent The parent of the view.
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||||
View rowView = mInflater.inflate(R.layout.list_item_timeline, parent, false);
|
View rowView = mInflater.inflate(R.layout.list_item_timeline, parent, false);
|
||||||
|
|
||||||
|
TextView userName = (TextView) rowView.findViewById(R.id.username_timeline);
|
||||||
TextView comment = (TextView) rowView.findViewById(R.id.comment_timeline);
|
TextView comment = (TextView) rowView.findViewById(R.id.comment_timeline);
|
||||||
final TextView nietSlechts = (TextView) rowView.findViewById(R.id.niet_slecht_count);
|
final TextView nietSlechts = (TextView) rowView.findViewById(R.id.niet_slecht_count);
|
||||||
TextView dateTime = (TextView) rowView.findViewById(R.id.timeline_date);
|
TextView dateTime = (TextView) rowView.findViewById(R.id.timeline_date);
|
||||||
|
|||||||
@@ -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.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
|
|||||||
98
logboek/logboek_felix_atsma.tex
Normal file
98
logboek/logboek_felix_atsma.tex
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
% 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}
|
||||||
|
\usepackage[dutch]{babel}
|
||||||
|
\usepackage{booktabs}
|
||||||
|
%-------------------------------------------------------------------------------
|
||||||
|
% GEGEVENS VOOR IN DE TITEL, HEADER EN FOOTER
|
||||||
|
%-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% Vul de naam van de opdracht in.
|
||||||
|
\assignment{MyHyvesBookPlusTagram}
|
||||||
|
% Vul het soort opdracht in.
|
||||||
|
\assignmenttype{Samenvatting}
|
||||||
|
% Vul de titel van de eindopdracht in.
|
||||||
|
\title{Logboek}
|
||||||
|
|
||||||
|
% Vul de volledige namen van alle auteurs in.
|
||||||
|
\authors{Felix Atsma}
|
||||||
|
% Vul de corresponderende UvAnetID's in.
|
||||||
|
\uvanetids{11035064}
|
||||||
|
|
||||||
|
% Vul altijd de naam in van diegene die het nakijkt, tutor of docent.
|
||||||
|
\tutor{Youri Voet}
|
||||||
|
% Vul indien nodig de naam van de begeleider in.
|
||||||
|
\mentor{}
|
||||||
|
% Vul eventueel ook de naam van de docent of vakcoordinator toe.
|
||||||
|
\docent{}
|
||||||
|
% Vul hier de naam van de PAV-groep in.
|
||||||
|
\group{The Return Of MyHyvesBook+}
|
||||||
|
% Vul de naam van de cursus in.
|
||||||
|
\course{Multimedia}
|
||||||
|
% Te vinden op onder andere Datanose.
|
||||||
|
\courseid{}
|
||||||
|
\date{\today}
|
||||||
|
|
||||||
|
% Dit is de datum die op het document komt te staan. Standaard is dat vandaag.
|
||||||
|
|
||||||
|
%-------------------------------------------------------------------------------
|
||||||
|
% VOORPAGINA EN EVENTUEEL INHOUDSOPGAVE EN ABSTRACT
|
||||||
|
%-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
\maketitle
|
||||||
|
|
||||||
|
%-------------------------------------------------------------------------------
|
||||||
|
% INHOUD
|
||||||
|
%-------------------------------------------------------------------------------
|
||||||
|
\section{Algemeen}
|
||||||
|
\subsection{19-6-2017}
|
||||||
|
Deze dag begon met het maken van een kleine presentatie van het projectplan
|
||||||
|
voor de TA, Youri. Het plan werdt goedgekeurd. Daarna zijn we aan de slag
|
||||||
|
gegaan met programmeren tot ongeveer 3 uur. Ik ben begonnen aan het maken van
|
||||||
|
een preview voor de camera en heb daar thuis verder aan gewerkt.
|
||||||
|
\subsection{20-6-2017}
|
||||||
|
Na de opdrachten om 9 uur laten nakijken ben ik verder gegaan met de camera
|
||||||
|
view, hiermee was ik de hele dag bezig. 's Avonds was ik klaar met een simpele
|
||||||
|
preview, nog zonder de functionaliteit van foto's maken.
|
||||||
|
\subsection{21-6-2017}
|
||||||
|
Deze dag was ik niet aanwezig op het Science Park, dit komt doordat ik de
|
||||||
|
nacht ervoor laat door heb gewerkt, en ik had werk. Ondanks dit heb ik thuis
|
||||||
|
doorgewerkt. Het wisselen van voor- en achtercamera is afgemaakt, daarnaast is
|
||||||
|
er gewerkt aan bugfixes.
|
||||||
|
\subsection{22-6-2017}
|
||||||
|
Op deze dag heb ik het nemen van foto's geïmplementeerd en gewerkt aan de
|
||||||
|
layout van de camera view. Thuis heb ik ook nog het uploaden van foto's
|
||||||
|
werkend gekregen.
|
||||||
|
Naast het programmeren hebben ik en Marijn een eerste versie van de poster
|
||||||
|
gemaakt voor PAV.
|
||||||
|
\subsection{23-6-2017}
|
||||||
|
Ik heb me vooral bezig gehouden met het implementeren van de filters.
|
||||||
|
\subsection{24/25-6-2017}
|
||||||
|
Tijdens het weekend gewerkt aan wisselen tussen filters en het uploaden van de
|
||||||
|
gefilterde foto's.
|
||||||
|
\subsection{26-6-2017}
|
||||||
|
Gewerkt aan een comment functie, en er voor gezorgd dat de camera het hele
|
||||||
|
beeld opvult.
|
||||||
|
\subsection{27-6-2017}
|
||||||
|
Deze dag veel gewerkt aan problemen oplossen, met name het roteren van het
|
||||||
|
genomen plaatje, daarnaast een probleem met de comment box opgelost. Ook heb
|
||||||
|
ik nog snel nog een filter toegevoegd.
|
||||||
|
\subsection{28-6-2017}
|
||||||
|
Wederom weer problemen opgelost, nu de layout van posts op de timeline
|
||||||
|
aangepast en een bug met de front facing camera gefixt.
|
||||||
|
\subsection{29-6-2017}
|
||||||
|
Deze dag hebben we de laatste puntjes gezet, met de timeline layout
|
||||||
|
verbeteren, een crash verhelpen en comments aan de code toevoegen.
|
||||||
|
\subsection{30-6-2017}
|
||||||
|
Lorem Ipsum Dolor sit amet.
|
||||||
|
|
||||||
|
\end{document}
|
||||||
23
logboek/logboek_marijn.md
Normal file
23
logboek/logboek_marijn.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Logboek Marijn
|
||||||
|
## Week 1
|
||||||
|
### Maandag
|
||||||
|
Vandaag heb gewerkt aan aan de Firebase implementatie, de login en registratie pagina's werken. Ook heb ik een begin gemaakt aan de Fragments.
|
||||||
|
### Dinsdag
|
||||||
|
Login verbeterd, er worden checks uitgevoerd en er komt een dialog die de gebruiker laat weten dat er op de achtergrond iets gebeurt.
|
||||||
|
### Woensdag
|
||||||
|
Vandaag hebben we aan profielpagina gewerkt.
|
||||||
|
### Donderdag
|
||||||
|
Fixed onClick methods.
|
||||||
|
### Vrijdag
|
||||||
|
Klasses gemaakt voor posts, deze zijn abstract gemaakt. Profielfoto's werken sinds vandaag.
|
||||||
|
## Week 2
|
||||||
|
### Maandag
|
||||||
|
Profielfotoupload listners gemaakt.
|
||||||
|
### Dinsdag
|
||||||
|
Timeline gemaakt.
|
||||||
|
### Woensdag
|
||||||
|
Poster en flyer in elkaar gezet.
|
||||||
|
### Donderdag
|
||||||
|
Laatste dingen aan de app gedaan.
|
||||||
|
### Vrijdag
|
||||||
|
Posterpresentatie
|
||||||
Reference in New Issue
Block a user