Compare commits
60 Commits
paul-profi
...
felix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdcd141f23 | ||
|
|
5f5269ceb8 | ||
|
|
d7b2e54306 | ||
|
|
8ea692c5a8 | ||
|
|
d4bfe0206b | ||
|
|
d61b058d0e | ||
|
|
979f1aab9a | ||
|
|
69bbfeaacd | ||
|
|
1f4fa4c768 | ||
|
|
dc7690e183 | ||
|
|
a4108e9e19 | ||
|
|
dc3db134c0 | ||
|
|
32f39a35db | ||
|
|
98f986fc0a | ||
|
|
5a6abe85f1 | ||
|
|
ab54ffb9ec | ||
|
|
6258c2a91a | ||
|
|
0a7c49b3a3 | ||
|
|
63236c5895 | ||
|
|
d8c04c78ea | ||
|
|
9d016b8c65 | ||
|
|
7895054743 | ||
|
|
c38cc026fc | ||
|
|
bd4149ccb1 | ||
|
|
27b005930f | ||
|
|
7936350ede | ||
|
|
c517c2ef10 | ||
|
|
c9eb4b62a1 | ||
|
|
71d412beac | ||
|
|
af47900288 | ||
|
|
5ae1d1f964 | ||
|
|
4eed601b7d | ||
|
|
26a7239caa | ||
|
|
1fdd21440b | ||
|
|
2315d58598 | ||
|
|
ab79fa7d7c | ||
|
|
52d15a80ca | ||
|
|
c8f65c0dca | ||
|
|
0560e6a0fb | ||
|
|
93434a981f | ||
|
|
2621062c60 | ||
|
|
43a1fcd52c | ||
|
|
982d7d4279 | ||
|
|
a04866ba3f | ||
|
|
f1befdd21c | ||
|
|
cab6728a54 | ||
|
|
017b5890c2 | ||
|
|
fe15764d2b | ||
|
|
bfd018ad4a | ||
|
|
ba832682bf | ||
|
|
f0719c51f9 | ||
|
|
3aab463143 | ||
|
|
2db1254750 | ||
|
|
16c3b727fc | ||
|
|
d3395f3e9b | ||
|
|
7ed5c36884 | ||
|
|
744ab1a9c0 | ||
|
|
cebc1bd59b | ||
|
|
1d3537cdde | ||
|
|
08849521e1 |
@@ -3,9 +3,8 @@
|
|||||||
package="nl.myhyvesbookplus.tagram">
|
package="nl.myhyvesbookplus.tagram">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
android:maxSdkVersion="18"/>
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||||
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
@@ -27,6 +26,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name">
|
android:label="@string/app_name">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -35,7 +35,9 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".LoginActivity">
|
<activity
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:name=".LoginActivity">
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
package nl.myhyvesbookplus.tagram;
|
package nl.myhyvesbookplus.tagram;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.graphics.Matrix;
|
|
||||||
import android.hardware.Camera;
|
import android.hardware.Camera;
|
||||||
import android.hardware.Camera.PictureCallback;
|
import android.hardware.Camera.PictureCallback;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
@@ -18,98 +15,51 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
|
|
||||||
import nl.myhyvesbookplus.tagram.controller.PostUploader;
|
import nl.myhyvesbookplus.tagram.controller.PostUploader;
|
||||||
import nl.myhyvesbookplus.tagram.model.BitmapPost;
|
import nl.myhyvesbookplus.tagram.model.BitmapPost;
|
||||||
|
|
||||||
/**
|
|
||||||
* A simple {@link Fragment} subclass.
|
|
||||||
* Activities that contain this fragment must implement the
|
|
||||||
* {@link CameraFragment.OnFragmentInteractionListener} interface
|
|
||||||
* to handle interaction events.
|
|
||||||
* Use the {@link CameraFragment#newInstance} factory method to
|
|
||||||
* create an instance of this fragment.
|
|
||||||
*/
|
|
||||||
public class CameraFragment extends Fragment implements PostUploader.PostUploadListener{
|
public class CameraFragment extends Fragment implements PostUploader.PostUploadListener{
|
||||||
// TODO: Rename parameter arguments, choose names that match
|
|
||||||
private static final String TAG = "CameraFragment";
|
private static final String TAG = "CameraFragment";
|
||||||
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
|
||||||
private static final String ARG_PARAM1 = "param1";
|
|
||||||
private static final String ARG_PARAM2 = "param2";
|
|
||||||
|
|
||||||
// TODO: Rename and change types of parameters
|
|
||||||
private String mParam1;
|
|
||||||
private String mParam2;
|
|
||||||
|
|
||||||
private OnFragmentInteractionListener mListener;
|
|
||||||
|
|
||||||
private Camera mCamera;
|
private Camera mCamera;
|
||||||
private CameraPreview mPreview;
|
private CameraPreview mPreview;
|
||||||
private byte[] mPhotoRaw;
|
|
||||||
private Bitmap mPhoto;
|
private Bitmap mPhoto;
|
||||||
private int facing = Camera.CameraInfo.CAMERA_FACING_BACK;
|
private int facing = Camera.CameraInfo.CAMERA_FACING_BACK;
|
||||||
|
|
||||||
public CameraFragment() {
|
/* Required empty public constructor */
|
||||||
// Required empty public constructor
|
public CameraFragment() { }
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this factory method to create a new instance of
|
|
||||||
* this fragment using the provided parameters.
|
|
||||||
*
|
|
||||||
* @param param1 Parameter 1.
|
|
||||||
* @param param2 Parameter 2.
|
|
||||||
* @return A new instance of fragment CameraFragment.
|
|
||||||
*/
|
|
||||||
// TODO: Rename and change types and number of parameters
|
|
||||||
public static CameraFragment newInstance(String param1, String param2) {
|
|
||||||
CameraFragment fragment = new CameraFragment();
|
|
||||||
Bundle args = new Bundle();
|
|
||||||
args.putString(ARG_PARAM1, param1);
|
|
||||||
args.putString(ARG_PARAM2, param2);
|
|
||||||
fragment.setArguments(args);
|
|
||||||
return fragment;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
if (getArguments() != null) {
|
|
||||||
mParam1 = getArguments().getString(ARG_PARAM1);
|
|
||||||
mParam2 = getArguments().getString(ARG_PARAM2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
// Inflate the layout for this fragment
|
// 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);
|
final View view = inflater.inflate(R.layout.fragment_camera, container, false);
|
||||||
|
|
||||||
mCamera = getCameraInstance(facing);
|
|
||||||
Camera.Parameters params = mCamera.getParameters();
|
|
||||||
params.setRotation(0);
|
|
||||||
mCamera.setParameters(params);
|
|
||||||
|
|
||||||
mPreview = new CameraPreview(getActivity().getBaseContext(), mCamera);
|
|
||||||
final RelativeLayout pictureButtons = (RelativeLayout) view.findViewById(R.id.picture_taken_buttons);
|
|
||||||
final RelativeLayout filterButtons = (RelativeLayout) view.findViewById(R.id.filter_buttons);
|
final RelativeLayout filterButtons = (RelativeLayout) view.findViewById(R.id.filter_buttons);
|
||||||
final RelativeLayout mCameraLayout = (RelativeLayout) view.findViewById(R.id.camera_preview);
|
final RelativeLayout mCameraLayout = (RelativeLayout) view.findViewById(R.id.camera_preview);
|
||||||
// final RelativeLayout mImageTaken = (RelativeLayout) view.findViewById(R.id.picture_view);
|
final LinearLayout commentBox = (LinearLayout) view.findViewById(R.id.comment_box);
|
||||||
|
final ImageButton pictureButton = (ImageButton) view.findViewById(R.id.picture_button);
|
||||||
|
final ImageButton switchButton = (ImageButton) view.findViewById(R.id.switch_camera_button);
|
||||||
|
|
||||||
|
// Hide the action bar
|
||||||
|
((AppCompatActivity)getActivity()).getSupportActionBar().hide();
|
||||||
|
|
||||||
|
mCamera = getCameraInstance(facing);
|
||||||
|
|
||||||
|
mPreview = new CameraPreview(getActivity().getBaseContext(), mCamera);
|
||||||
|
|
||||||
mCameraLayout.addView(mPreview);
|
mCameraLayout.addView(mPreview);
|
||||||
|
|
||||||
// Draw buttons over preview
|
// Draw initial buttons over preview
|
||||||
view.findViewById(R.id.picture_button).bringToFront();
|
pictureButton.bringToFront();
|
||||||
view.findViewById(R.id.switch_camera_button).bringToFront();
|
switchButton.bringToFront();
|
||||||
pictureButtons.bringToFront();
|
|
||||||
filterButtons.bringToFront();
|
filterButtons.bringToFront();
|
||||||
|
|
||||||
(view.findViewById(R.id.switch_camera_button)).setOnClickListener(new View.OnClickListener() {
|
/* Upon pressing the switch camera facing button: */
|
||||||
|
switchButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switchFacing();
|
switchFacing();
|
||||||
@@ -120,22 +70,21 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
|||||||
mPreview = new CameraPreview(getActivity().getBaseContext(), mCamera);
|
mPreview = new CameraPreview(getActivity().getBaseContext(), mCamera);
|
||||||
mCameraLayout.addView(mPreview);
|
mCameraLayout.addView(mPreview);
|
||||||
|
|
||||||
view.findViewById(R.id.picture_button).bringToFront();
|
pictureButton.bringToFront();
|
||||||
view.findViewById(R.id.switch_camera_button).bringToFront();
|
switchButton.bringToFront();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
(view.findViewById(R.id.picture_button)).setOnClickListener(new View.OnClickListener() {
|
/* Upon pressing the take photo button: */
|
||||||
|
pictureButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
mCamera.takePicture(null, null, new PictureCallback() {
|
mCamera.takePicture(null, null, new PictureCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onPictureTaken(byte[] data, Camera camera) {
|
public void onPictureTaken(byte[] data, Camera camera) {
|
||||||
// Bitmap bmp = rotate(BitmapFactory.decodeByteArray(data, 0, data.length, null), 90);
|
|
||||||
// mPhoto = bmp;
|
|
||||||
mPhoto = BitmapFactory.decodeByteArray(data, 0, data.length, null);
|
mPhoto = BitmapFactory.decodeByteArray(data, 0, data.length, null);
|
||||||
|
|
||||||
PicturePreview mPicPreview = new PicturePreview(getActivity().getBaseContext(), mPhoto);
|
PicturePreview mPicPreview = new PicturePreview(getActivity().getBaseContext(), mPhoto, facing);
|
||||||
mPicPreview.setId(R.id.pic_preview);
|
mPicPreview.setId(R.id.pic_preview);
|
||||||
|
|
||||||
mCameraLayout.addView(mPicPreview);
|
mCameraLayout.addView(mPicPreview);
|
||||||
@@ -143,20 +92,25 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
|||||||
filterButtons.setVisibility(View.VISIBLE);
|
filterButtons.setVisibility(View.VISIBLE);
|
||||||
filterButtons.bringToFront();
|
filterButtons.bringToFront();
|
||||||
|
|
||||||
// mPicPreview.invalidate();
|
|
||||||
switchButtons(view);
|
switchButtons(view);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Upon pressing the upload button: */
|
||||||
(view.findViewById(R.id.upload_button)).setOnClickListener(new View.OnClickListener() {
|
(view.findViewById(R.id.upload_button)).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
view.findViewById(R.id.comment_box).bringToFront();
|
commentBox.setClickable(true);
|
||||||
|
commentBox.setVisibility(View.VISIBLE);
|
||||||
|
commentBox.bringToFront();
|
||||||
|
filterButtons.setVisibility(View.GONE);
|
||||||
|
((FloatingActionButton)view.findViewById(R.id.upload_button)).hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Upon pressing the enter button on the virtual keyboard: */
|
||||||
(view.findViewById(R.id.comment_submit)).setOnClickListener(new View.OnClickListener() {
|
(view.findViewById(R.id.comment_submit)).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -169,7 +123,6 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
|||||||
upload.uploadPicture(new BitmapPost(((PicturePreview)view.findViewById(R.id.pic_preview)).getPicture(), comment));
|
upload.uploadPicture(new BitmapPost(((PicturePreview)view.findViewById(R.id.pic_preview)).getPicture(), comment));
|
||||||
|
|
||||||
mPhoto.recycle();
|
mPhoto.recycle();
|
||||||
mPhoto = null;
|
|
||||||
|
|
||||||
filterButtons.setVisibility(View.GONE);
|
filterButtons.setVisibility(View.GONE);
|
||||||
switchButtons(view);
|
switchButtons(view);
|
||||||
@@ -177,21 +130,45 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
|||||||
mCameraLayout.removeView(mPreview);
|
mCameraLayout.removeView(mPreview);
|
||||||
|
|
||||||
mCamera = getCameraInstance(facing);
|
mCamera = getCameraInstance(facing);
|
||||||
Camera.Parameters params = mCamera.getParameters();
|
|
||||||
params.setRotation(90);
|
|
||||||
mCamera.setParameters(params);
|
|
||||||
|
|
||||||
mPreview = new CameraPreview(getActivity().getBaseContext(), mCamera);
|
mPreview = new CameraPreview(getActivity().getBaseContext(), mCamera);
|
||||||
mCameraLayout.addView(mPreview);
|
mCameraLayout.addView(mPreview);
|
||||||
|
|
||||||
view.findViewById(R.id.picture_button).bringToFront();
|
pictureButton.bringToFront();
|
||||||
view.findViewById(R.id.switch_camera_button).bringToFront();
|
switchButton.bringToFront();
|
||||||
|
|
||||||
mCameraLayout.removeView(view.findViewById(R.id.pic_preview));
|
mCameraLayout.removeView(view.findViewById(R.id.pic_preview));
|
||||||
|
hideKeyboard();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Upon pressing the cancel button: */
|
||||||
|
(view.findViewById(R.id.comment_cancel)).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
((EditText) view.findViewById(R.id.comment_text)).setText("");
|
||||||
|
|
||||||
|
mPhoto.recycle();
|
||||||
|
|
||||||
|
filterButtons.setVisibility(View.GONE);
|
||||||
|
switchButtons(view);
|
||||||
|
|
||||||
|
mCameraLayout.removeView(mPreview);
|
||||||
|
|
||||||
|
mCamera = getCameraInstance(facing);
|
||||||
|
|
||||||
|
mPreview = new CameraPreview(getActivity().getBaseContext(), mCamera);
|
||||||
|
mCameraLayout.addView(mPreview);
|
||||||
|
|
||||||
|
pictureButton.bringToFront();
|
||||||
|
switchButton.bringToFront();
|
||||||
|
|
||||||
|
mCameraLayout.removeView(view.findViewById(R.id.pic_preview));
|
||||||
|
hideKeyboard();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/* Upon pressing the left arrow filter change button: */
|
||||||
(view.findViewById(R.id.filter_left)).setOnClickListener(new View.OnClickListener() {
|
(view.findViewById(R.id.filter_left)).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -199,17 +176,18 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
|||||||
|
|
||||||
PicturePreview.filterPrev();
|
PicturePreview.filterPrev();
|
||||||
|
|
||||||
PicturePreview mPicPreview = new PicturePreview(getActivity().getBaseContext(), mPhoto);
|
PicturePreview mPicPreview = new PicturePreview(getActivity().getBaseContext(), mPhoto, facing);
|
||||||
mPicPreview.setId(R.id.pic_preview);
|
mPicPreview.setId(R.id.pic_preview);
|
||||||
|
|
||||||
mCameraLayout.addView(mPicPreview);
|
mCameraLayout.addView(mPicPreview);
|
||||||
|
|
||||||
view.findViewById(R.id.picture_taken_buttons).bringToFront();
|
view.findViewById(R.id.upload_button).bringToFront();
|
||||||
filterButtons.setVisibility(View.VISIBLE);
|
filterButtons.setVisibility(View.VISIBLE);
|
||||||
filterButtons.bringToFront();
|
filterButtons.bringToFront();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Upon pressing the right arrow filter change button: */
|
||||||
(view.findViewById(R.id.filter_right)).setOnClickListener(new View.OnClickListener() {
|
(view.findViewById(R.id.filter_right)).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -217,76 +195,42 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
|||||||
|
|
||||||
PicturePreview.filterNext();
|
PicturePreview.filterNext();
|
||||||
|
|
||||||
PicturePreview mPicPreview = new PicturePreview(getActivity().getBaseContext(), mPhoto);
|
PicturePreview mPicPreview = new PicturePreview(getActivity().getBaseContext(), mPhoto, facing);
|
||||||
mPicPreview.setId(R.id.pic_preview);
|
mPicPreview.setId(R.id.pic_preview);
|
||||||
|
|
||||||
mCameraLayout.addView(mPicPreview);
|
mCameraLayout.addView(mPicPreview);
|
||||||
|
|
||||||
view.findViewById(R.id.picture_taken_buttons).bringToFront();
|
view.findViewById(R.id.upload_button).bringToFront();
|
||||||
filterButtons.setVisibility(View.VISIBLE);
|
filterButtons.setVisibility(View.VISIBLE);
|
||||||
filterButtons.bringToFront();
|
filterButtons.bringToFront();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
(view.findViewById(R.id.comment_text)).setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onFocusChange(View v, boolean hasFocus) {
|
|
||||||
if (!hasFocus) {
|
|
||||||
hideKeyboard(v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hideKeyboard(View view) {
|
/**
|
||||||
InputMethodManager inputMethodManager =(InputMethodManager) getActivity().getSystemService(Activity.INPUT_METHOD_SERVICE);
|
* Hides keyboard after submit, upload or cancel button gets pressed.
|
||||||
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
*/
|
||||||
}
|
public void hideKeyboard() {
|
||||||
|
((InputMethodManager) getActivity().getSystemService(Activity.INPUT_METHOD_SERVICE))
|
||||||
// TODO: Rename method, update argument and hook method into UI event
|
.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0);
|
||||||
public void onButtonPressed(Uri uri) {
|
|
||||||
if (mListener != null) {
|
|
||||||
mListener.onFragmentInteraction(uri);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAttach(Context context) {
|
|
||||||
super.onAttach(context);
|
|
||||||
if (context instanceof OnFragmentInteractionListener) {
|
|
||||||
mListener = (OnFragmentInteractionListener) context;
|
|
||||||
} else {
|
|
||||||
throw new RuntimeException(context.toString()
|
|
||||||
+ " must implement OnFragmentInteractionListener");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDetach() {
|
|
||||||
super.onDetach();
|
|
||||||
mListener = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restores the action bar when exiting the fragment.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
|
|
||||||
int padding = 16; // 6 dps
|
|
||||||
float scale = getResources().getDisplayMetrics().density;
|
|
||||||
int dp = (int) (padding * scale + 0.5f);
|
|
||||||
((AppCompatActivity)getActivity()).getSupportActionBar().show();
|
((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.setRotate(degree);
|
|
||||||
|
|
||||||
return Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), mtx, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start the camera.
|
||||||
|
* @param facing The direction in which the camera should be initialized (back by default).
|
||||||
|
* @return the result of the opened camera, if successful.
|
||||||
|
*/
|
||||||
public static Camera getCameraInstance(int facing) {
|
public static Camera getCameraInstance(int facing) {
|
||||||
Camera c = null;
|
Camera c = null;
|
||||||
try {
|
try {
|
||||||
@@ -297,62 +241,53 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Switch between front facing camera and the back camera.
|
||||||
|
*/
|
||||||
public void switchFacing() {
|
public void switchFacing() {
|
||||||
if (facing == Camera.CameraInfo.CAMERA_FACING_FRONT)
|
if (facing == Camera.CameraInfo.CAMERA_FACING_FRONT)
|
||||||
facing = Camera.CameraInfo.CAMERA_FACING_BACK;
|
facing = Camera.CameraInfo.CAMERA_FACING_BACK;
|
||||||
else
|
else
|
||||||
facing = Camera.CameraInfo.CAMERA_FACING_FRONT;
|
facing = Camera.CameraInfo.CAMERA_FACING_FRONT;
|
||||||
|
// TODO
|
||||||
|
// facing =
|
||||||
|
// facing == Camera.CameraInfo.CAMERA_FACING_FRONT ?
|
||||||
|
// Camera.CameraInfo.CAMERA_FACING_BACK :
|
||||||
|
// Camera.CameraInfo.CAMERA_FACING_FRONT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change which buttons are visible during the different stages on the camera fragment.
|
||||||
|
*
|
||||||
|
* @param view The current view upon which the buttons need to be placed or removed.
|
||||||
|
*/
|
||||||
public void switchButtons(View view) {
|
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 upload = (FloatingActionButton) view.findViewById(R.id.upload_button);
|
||||||
// FloatingActionButton save = (FloatingActionButton) view.findViewById(R.id.save_button);
|
ImageButton picButton = (ImageButton) view.findViewById(R.id.picture_button);
|
||||||
|
ImageButton switchButton = (ImageButton) view.findViewById(R.id.switch_camera_button);
|
||||||
|
|
||||||
if (((Integer)upload.getVisibility()).equals(View.VISIBLE)) {
|
if (((Integer)picButton.getVisibility()).equals(View.GONE)) {
|
||||||
|
Log.d(TAG, "switchButtons: GONE");
|
||||||
upload.hide();
|
upload.hide();
|
||||||
// save.hide();
|
|
||||||
|
|
||||||
view.findViewById(R.id.picture_button).setVisibility(View.VISIBLE);
|
picButton.setVisibility(View.VISIBLE);
|
||||||
view.findViewById(R.id.switch_camera_button).setVisibility(View.VISIBLE);
|
switchButton.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
picButton.bringToFront();
|
||||||
|
switchButton.bringToFront();
|
||||||
} else {
|
} else {
|
||||||
pictureButtons.bringToFront();
|
Log.d(TAG, "switchButtons: VISIBLE");
|
||||||
|
upload.bringToFront();
|
||||||
upload.show();
|
upload.show();
|
||||||
// save.show();
|
|
||||||
|
|
||||||
view.findViewById(R.id.picture_button).setVisibility(View.GONE);
|
picButton.setVisibility(View.GONE);
|
||||||
view.findViewById(R.id.switch_camera_button).setVisibility(View.GONE);
|
switchButton.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPause() {
|
|
||||||
super.onPause();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void PostUploadComplete(Boolean success) {
|
public void PostUploadComplete(Boolean success) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This interface must be implemented by activities that contain this
|
|
||||||
* fragment to allow an interaction in this fragment to be communicated
|
|
||||||
* to the activity and potentially other fragments contained in that
|
|
||||||
* activity.
|
|
||||||
* <p>
|
|
||||||
* See the Android Training lesson <a href=
|
|
||||||
* "http://developer.android.com/training/basics/fragments/communicating.html"
|
|
||||||
* >Communicating with Other Fragments</a> for more information.
|
|
||||||
*/
|
|
||||||
public interface OnFragmentInteractionListener {
|
|
||||||
// TODO: Update argument type and name
|
|
||||||
void onFragmentInteraction(Uri uri);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,21 +34,14 @@ public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback
|
|||||||
@Override
|
@Override
|
||||||
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
||||||
if (mHolder.getSurface() == null){
|
if (mHolder.getSurface() == null){
|
||||||
// preview surface does not exist
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// stop preview before making changes
|
|
||||||
try {
|
try {
|
||||||
mCamera.stopPreview();
|
mCamera.stopPreview();
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
// ignore: tried to stop a non-existent preview
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// set preview size and make any resize, rotate or
|
|
||||||
// reformatting changes here
|
|
||||||
|
|
||||||
// start preview with new settings
|
|
||||||
try {
|
try {
|
||||||
mCamera.setPreviewDisplay(mHolder);
|
mCamera.setPreviewDisplay(mHolder);
|
||||||
mCamera.startPreview();
|
mCamera.startPreview();
|
||||||
@@ -60,6 +53,7 @@ public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||||
|
Log.d(TAG, "surfaceDestroyed: CAMERA DESTROYED");
|
||||||
mCamera.stopPreview();
|
mCamera.stopPreview();
|
||||||
mCamera.release();
|
mCamera.release();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|||||||
* @param passwordString the entered password
|
* @param passwordString the entered password
|
||||||
*/
|
*/
|
||||||
protected void logIn(String emailString, String passwordString) {
|
protected void logIn(String emailString, String passwordString) {
|
||||||
progressDialog = ProgressDialog.show(LoginActivity.this, getString(R.string.please_wait), "Logging in", true, false);
|
progressDialog = ProgressDialog.show(LoginActivity.this, getString(R.string.please_wait), getString(R.string.logging_in), true, false);
|
||||||
|
|
||||||
mAuth.signInWithEmailAndPassword(emailString, passwordString)
|
mAuth.signInWithEmailAndPassword(emailString, passwordString)
|
||||||
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
|
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
|
||||||
@@ -211,7 +211,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
|||||||
* @param password the entered password
|
* @param password the entered password
|
||||||
*/
|
*/
|
||||||
protected void registerUser(String email, String password) {
|
protected void registerUser(String email, String password) {
|
||||||
this.progressDialog = ProgressDialog.show(LoginActivity.this, getString(R.string.please_wait), "Registering", true, false);
|
this.progressDialog = ProgressDialog.show(LoginActivity.this, getString(R.string.please_wait), getString(R.string.registering), true, false);
|
||||||
mAuth.createUserWithEmailAndPassword(email, password)
|
mAuth.createUserWithEmailAndPassword(email, password)
|
||||||
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
|
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -20,9 +20,10 @@ import nl.myhyvesbookplus.tagram.controller.PostUploader;
|
|||||||
import nl.myhyvesbookplus.tagram.controller.ProfilePictureUploader;
|
import nl.myhyvesbookplus.tagram.controller.ProfilePictureUploader;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity implements
|
public class MainActivity extends AppCompatActivity implements
|
||||||
CameraFragment.OnFragmentInteractionListener,
|
|
||||||
ProfilePictureUploader.ProfilePictureUpdatedListener,
|
ProfilePictureUploader.ProfilePictureUpdatedListener,
|
||||||
DownloadClass.PostDownloadListener, PostUploader.PostUploadListener {
|
DownloadClass.PostDownloadListener,
|
||||||
|
PostUploader.PostUploadListener {
|
||||||
|
|
||||||
final static private String TAG = "MainScreen";
|
final static private String TAG = "MainScreen";
|
||||||
|
|
||||||
FirebaseAuth mAuth;
|
FirebaseAuth mAuth;
|
||||||
@@ -89,11 +90,6 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFragmentInteraction(Uri uri) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void logOutOnClick(View view) {
|
public void logOutOnClick(View view) {
|
||||||
FirebaseAuth.getInstance().signOut();
|
FirebaseAuth.getInstance().signOut();
|
||||||
goToLogin();
|
goToLogin();
|
||||||
@@ -107,7 +103,6 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void ProfilePictureUpdated(Boolean success) {
|
public void ProfilePictureUpdated(Boolean success) {
|
||||||
Log.d(TAG, "ProfilePictureUpdated: Ja ik luister naar je!");
|
|
||||||
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();
|
||||||
@@ -123,7 +118,12 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
FragmentManager fragmentManager = getFragmentManager();
|
FragmentManager fragmentManager = getFragmentManager();
|
||||||
Fragment frag = fragmentManager.findFragmentById(R.id.content);
|
Fragment frag = fragmentManager.findFragmentById(R.id.content);
|
||||||
|
|
||||||
if (frag instanceof TimelineFragment) {
|
|
||||||
|
|
||||||
|
if (frag instanceof ProfileFragment) {
|
||||||
|
((ProfileFragment) frag).startList();
|
||||||
|
} else if (frag instanceof TimelineFragment) {
|
||||||
|
// ((TimelineFragment) frag).progressDialog.dismiss();
|
||||||
((TimelineFragment) frag).startList();
|
((TimelineFragment) frag).startList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,74 +2,126 @@ package nl.myhyvesbookplus.tagram;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.ColorFilter;
|
import android.graphics.ColorFilter;
|
||||||
import android.graphics.ColorMatrix;
|
import android.graphics.ColorMatrix;
|
||||||
import android.graphics.ColorMatrixColorFilter;
|
import android.graphics.ColorMatrixColorFilter;
|
||||||
|
import android.graphics.Matrix;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
|
import android.hardware.Camera;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.SurfaceHolder;
|
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 = "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;
|
||||||
|
private static final int FILTER_NEG = 3;
|
||||||
|
|
||||||
private static int currentFilter = FILTER_NONE;
|
private static int currentFilter = FILTER_NONE;
|
||||||
|
|
||||||
Bitmap picture;
|
private int facing;
|
||||||
Bitmap filterPicture;
|
private int rotate;
|
||||||
|
private Bitmap picture;
|
||||||
|
private Bitmap filterPicture;
|
||||||
|
|
||||||
public PicturePreview(Context context, Bitmap bmp) {
|
/**
|
||||||
|
* 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) {
|
||||||
super(context);
|
super(context);
|
||||||
picture = Bitmap.createScaledBitmap(bmp, bmp.getWidth() / 2, bmp.getHeight() / 2, false);
|
|
||||||
// picture = Bitmap.createBitmap(bmp);
|
|
||||||
setWillNotDraw(false);
|
setWillNotDraw(false);
|
||||||
|
|
||||||
|
this.facing = facing;
|
||||||
|
|
||||||
|
if (((Integer)facing).equals(Camera.CameraInfo.CAMERA_FACING_FRONT)) {
|
||||||
|
picture = Bitmap.createBitmap(bmp);
|
||||||
|
rotate = 270;
|
||||||
|
} else {
|
||||||
|
picture = Bitmap.createScaledBitmap(bmp, bmp.getWidth() / 2, bmp.getHeight() / 2, false);
|
||||||
|
rotate = 90;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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);
|
||||||
ColorMatrix cm = new ColorMatrix();
|
ColorMatrix cm = new ColorMatrix();
|
||||||
Paint paint = new Paint();
|
Paint paint = new Paint();
|
||||||
ColorMatrixColorFilter filter;
|
ColorMatrixColorFilter filter;
|
||||||
|
Canvas saveCanvas = new Canvas();
|
||||||
|
|
||||||
switch (currentFilter) {
|
switch (currentFilter) {
|
||||||
case FILTER_NONE:
|
case FILTER_NONE:
|
||||||
canvas.drawBitmap(picture, 0, 0, null);
|
canvas.drawBitmap(rotate(picture, rotate), 0, 0, null);
|
||||||
canvas.rotate(90);
|
filterPicture = rotate(picture, rotate);
|
||||||
filterPicture = picture;
|
|
||||||
break;
|
break;
|
||||||
case FILTER_SEPIA:
|
case FILTER_SEPIA:
|
||||||
canvas.drawBitmap(toSepia(picture), 0, 0, null);
|
filterPicture = Bitmap.createBitmap(canvas.getWidth(), canvas.getHeight(), Bitmap.Config.ARGB_8888);
|
||||||
canvas.rotate(90);
|
Log.d(TAG, "onDraw: " + Integer.toString(canvas.getWidth()));
|
||||||
filterPicture = toSepia(picture);
|
|
||||||
break;
|
float[] sepia = {0.393f,0.769f,0.189f,0f,0f,
|
||||||
case FILTER_BW:
|
0.349f,0.686f,0.168f,0f,0f,
|
||||||
Canvas bw = new Canvas();
|
0.272f,0.534f,0.131f,0f,0f,
|
||||||
// filterPicture = Bitmap.createBitmap(1920, 1440, null);
|
0f, 0f, 0f, 1f, 0f};
|
||||||
filterPicture = Bitmap.createBitmap(picture.getWidth() / 2, picture.getHeight() / 2, Bitmap.Config.ARGB_8888);
|
cm.set(sepia);
|
||||||
cm.setSaturation(0);
|
|
||||||
filter = new ColorMatrixColorFilter(cm);
|
filter = new ColorMatrixColorFilter(cm);
|
||||||
paint.setColorFilter(filter);
|
paint.setColorFilter(filter);
|
||||||
bw.setBitmap(filterPicture);
|
saveCanvas.setBitmap(filterPicture);
|
||||||
bw.drawBitmap(picture, 0, 0, paint);
|
saveCanvas.drawBitmap(rotate(picture, rotate), 0, 0, paint);
|
||||||
bw.rotate(90);
|
canvas.drawBitmap(rotate(picture, rotate), 0, 0, paint);
|
||||||
canvas.drawBitmap(picture, 0, 0, paint);
|
|
||||||
canvas.rotate(90);
|
|
||||||
break;
|
break;
|
||||||
|
case FILTER_BW:
|
||||||
|
filterPicture = Bitmap.createBitmap(canvas.getWidth(), canvas.getHeight(), Bitmap.Config.ARGB_8888);
|
||||||
|
|
||||||
|
cm.setSaturation(0);
|
||||||
|
|
||||||
|
filter = new ColorMatrixColorFilter(cm);
|
||||||
|
paint.setColorFilter(filter);
|
||||||
|
saveCanvas.setBitmap(filterPicture);
|
||||||
|
saveCanvas.drawBitmap(rotate(picture, rotate), 0, 0, paint);
|
||||||
|
canvas.drawBitmap(rotate(picture, rotate), 0, 0, paint);
|
||||||
|
break;
|
||||||
|
case FILTER_NEG:
|
||||||
|
filterPicture = Bitmap.createBitmap(canvas.getWidth(), canvas.getHeight(), Bitmap.Config.ARGB_8888);
|
||||||
|
|
||||||
|
float[] neg = {-1f,0f,0f,0f,255f,
|
||||||
|
0f,-1f,0f,0f,255f,
|
||||||
|
0f,0f,-1f,0f,255f,
|
||||||
|
0f,0f,0f,1f,0f};
|
||||||
|
cm.set(neg);
|
||||||
|
|
||||||
|
filter = new ColorMatrixColorFilter(cm);
|
||||||
|
paint.setColorFilter(filter);
|
||||||
|
saveCanvas.setBitmap(filterPicture);
|
||||||
|
saveCanvas.drawBitmap(rotate(picture, rotate), 0, 0, paint);
|
||||||
|
canvas.drawBitmap(rotate(picture, rotate), 0, 0, paint);
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Switches filter to the left.
|
||||||
|
*/
|
||||||
public static void filterPrev() {
|
public static void filterPrev() {
|
||||||
switch (currentFilter) {
|
switch (currentFilter) {
|
||||||
case FILTER_NONE:
|
case FILTER_NONE:
|
||||||
currentFilter = FILTER_BW;
|
currentFilter = FILTER_NEG;
|
||||||
break;
|
break;
|
||||||
case FILTER_SEPIA:
|
case FILTER_SEPIA:
|
||||||
currentFilter = FILTER_NONE;
|
currentFilter = FILTER_NONE;
|
||||||
@@ -77,9 +129,15 @@ public class PicturePreview extends SurfaceView implements SurfaceHolder.Callbac
|
|||||||
case FILTER_BW:
|
case FILTER_BW:
|
||||||
currentFilter = FILTER_SEPIA;
|
currentFilter = FILTER_SEPIA;
|
||||||
break;
|
break;
|
||||||
|
case FILTER_NEG:
|
||||||
|
currentFilter = FILTER_BW;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Switches filter to the right.
|
||||||
|
*/
|
||||||
public static void filterNext() {
|
public static void filterNext() {
|
||||||
switch (currentFilter) {
|
switch (currentFilter) {
|
||||||
case FILTER_NONE:
|
case FILTER_NONE:
|
||||||
@@ -89,44 +147,29 @@ public class PicturePreview extends SurfaceView implements SurfaceHolder.Callbac
|
|||||||
currentFilter = FILTER_BW;
|
currentFilter = FILTER_BW;
|
||||||
break;
|
break;
|
||||||
case FILTER_BW:
|
case FILTER_BW:
|
||||||
|
currentFilter = FILTER_NEG;
|
||||||
|
break;
|
||||||
|
case FILTER_NEG:
|
||||||
currentFilter = FILTER_NONE;
|
currentFilter = FILTER_NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bitmap toSepia(Bitmap color) {
|
/**
|
||||||
int red, green, blue, pixel;
|
* Rotates an image by a specified amount of degrees by matrix.
|
||||||
int height = color.getHeight();
|
* @param bmp Image to be rotated.
|
||||||
int width = color.getWidth();
|
* @param degree Amount of degrees to rotate
|
||||||
int depth = 20;
|
* @return Rotated image.
|
||||||
|
*/
|
||||||
|
public static Bitmap rotate(Bitmap bmp, int degree) {
|
||||||
|
Matrix mtx = new Matrix();
|
||||||
|
mtx.postRotate(degree);
|
||||||
|
|
||||||
Bitmap sepia = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
return Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), mtx, true);
|
||||||
|
|
||||||
int[] pixels = new int[width * height];
|
|
||||||
color.getPixels(pixels, 0, width, 0, 0, width, height);
|
|
||||||
for (int i = 0; i < pixels.length; i++) {
|
|
||||||
pixel = pixels[i];
|
|
||||||
|
|
||||||
red = (pixel >> 16) & 0xFF;
|
|
||||||
green = (pixel >> 8) & 0xFF;
|
|
||||||
blue = pixel & 0xFF;
|
|
||||||
|
|
||||||
red = green = blue = (red + green + blue) / 3;
|
|
||||||
|
|
||||||
red += (depth * 2);
|
|
||||||
green += depth;
|
|
||||||
|
|
||||||
if (red > 255)
|
|
||||||
red = 255;
|
|
||||||
if (green > 255)
|
|
||||||
green = 255;
|
|
||||||
pixels[i] = (0xFF << 24) | (red << 16) | (green << 8) | blue;
|
|
||||||
}
|
|
||||||
sepia.setPixels(pixels, 0, width, 0, 0, width, height);
|
|
||||||
return sepia;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bitmap getPicture() {
|
public Bitmap getPicture() {
|
||||||
|
picture.recycle();
|
||||||
return filterPicture;
|
return filterPicture;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +181,13 @@ 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) {
|
||||||
|
picture.recycle();
|
||||||
|
filterPicture.recycle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,231 @@
|
|||||||
|
package nl.myhyvesbookplus.tagram;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Point;
|
||||||
|
import android.graphics.Rect;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.animation.DecelerateInterpolator;
|
||||||
|
import android.widget.BaseAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.animation.Animator;
|
||||||
|
import android.animation.AnimatorListenerAdapter;
|
||||||
|
import android.animation.AnimatorSet;
|
||||||
|
import android.animation.ObjectAnimator;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.firebase.ui.storage.images.FirebaseImageLoader;
|
||||||
|
import com.google.firebase.storage.FirebaseStorage;
|
||||||
|
import com.google.firebase.storage.StorageReference;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import nl.myhyvesbookplus.tagram.model.UriPost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by niels on 27-6-17.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ProfileAdapter extends BaseAdapter {
|
||||||
|
|
||||||
|
private static final String TAG = "ProfileAdapter";
|
||||||
|
private LayoutInflater mInflater;
|
||||||
|
private Context mContext;
|
||||||
|
private ArrayList<UriPost> mData;
|
||||||
|
private TextView comment;
|
||||||
|
private TextView nietSlechts;
|
||||||
|
private ImageView photo;
|
||||||
|
private Animator mCurrentAnimator;
|
||||||
|
|
||||||
|
ProfileAdapter(Context context, ArrayList<UriPost> data) {
|
||||||
|
mContext = context;
|
||||||
|
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
mData = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return mData.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getItem(int position) {
|
||||||
|
return mData.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getItemId(int position) {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
View rowView = mInflater.inflate(R.layout.list_item_timeline_profile, parent, false);
|
||||||
|
View newRowView = findViews(rowView);
|
||||||
|
UriPost post = (UriPost) getItem(position);
|
||||||
|
comment.setText(post.getComment());
|
||||||
|
final StorageReference ref = FirebaseStorage.getInstance().getReferenceFromUrl(post.getUri());
|
||||||
|
Glide.with(mContext)
|
||||||
|
.using(new FirebaseImageLoader())
|
||||||
|
.load(ref)
|
||||||
|
.into(photo);
|
||||||
|
|
||||||
|
photo.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
zoomImageFromThumb(photo, ref);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return newRowView;
|
||||||
|
}
|
||||||
|
|
||||||
|
private View findViews(View rowView) {
|
||||||
|
comment = (TextView) rowView.findViewById(R.id.comment_timeline_profile);
|
||||||
|
nietSlechts = (TextView) rowView.findViewById(R.id.niet_slecht_count_profile);
|
||||||
|
photo = (ImageView) rowView.findViewById(R.id.timeline_image_profile);
|
||||||
|
return rowView;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https://developer.android.com/training/animation/zoom.html
|
||||||
|
* "Zooms" in a thumbnail view by assigning the high resolution image to a hidden "zoomed-in"
|
||||||
|
* image view and animating its bounds to fit the entire activity content area.
|
||||||
|
*
|
||||||
|
* @param thumbView The thumbnail view to zoom in.
|
||||||
|
* @param imageRef The high-resolution version of the image represented by the thumbnail.
|
||||||
|
*/
|
||||||
|
private void zoomImageFromThumb(final View thumbView, StorageReference imageRef) {
|
||||||
|
// If there's an animation in progress, cancel it immediately and proceed with this one.
|
||||||
|
if (mCurrentAnimator != null) {
|
||||||
|
mCurrentAnimator.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load the high-resolution "zoomed-in" image.
|
||||||
|
final ImageView hiddenView = (ImageView) ((MainActivity) mContext).findViewById(R.id.expanded_image_profile);
|
||||||
|
|
||||||
|
Glide.with(mContext)
|
||||||
|
.using(new FirebaseImageLoader())
|
||||||
|
.load(imageRef)
|
||||||
|
.into(hiddenView);
|
||||||
|
|
||||||
|
// Calculate the starting and ending bounds for the zoomed-in image. This step
|
||||||
|
// involves lots of math. Yay, math.
|
||||||
|
final Rect startBounds = new Rect();
|
||||||
|
final Rect finalBounds = new Rect();
|
||||||
|
final Point globalOffset = new Point();
|
||||||
|
|
||||||
|
// The start bounds are the global visible rectangle of the thumbnail, and the
|
||||||
|
// final bounds are the global visible rectangle of the container view. Also
|
||||||
|
// set the container view's offset as the origin for the bounds, since that's
|
||||||
|
// the origin for the positioning animation properties (X, Y).
|
||||||
|
thumbView.getGlobalVisibleRect(startBounds);
|
||||||
|
((MainActivity) mContext).findViewById(R.id.relative_layout_timeline_profile).getGlobalVisibleRect(finalBounds, globalOffset);
|
||||||
|
startBounds.offset(-globalOffset.x, -globalOffset.y);
|
||||||
|
finalBounds.offset(-globalOffset.x, -globalOffset.y);
|
||||||
|
|
||||||
|
// Adjust the start bounds to be the same aspect ratio as the final bounds using the
|
||||||
|
// "center crop" technique. This prevents undesirable stretching during the animation.
|
||||||
|
// Also calculate the start scaling factor (the end scaling factor is always 1.0).
|
||||||
|
float startScale;
|
||||||
|
if ((float) finalBounds.width() / finalBounds.height()
|
||||||
|
> (float) startBounds.width() / startBounds.height()) {
|
||||||
|
// Extend start bounds horizontally
|
||||||
|
startScale = (float) startBounds.height() / finalBounds.height();
|
||||||
|
float startWidth = startScale * finalBounds.width();
|
||||||
|
float deltaWidth = (startWidth - startBounds.width()) / 2;
|
||||||
|
startBounds.left -= deltaWidth;
|
||||||
|
startBounds.right += deltaWidth;
|
||||||
|
} else {
|
||||||
|
// Extend start bounds vertically
|
||||||
|
startScale = (float) startBounds.width() / finalBounds.width();
|
||||||
|
float startHeight = startScale * finalBounds.height();
|
||||||
|
float deltaHeight = (startHeight - startBounds.height()) / 2;
|
||||||
|
startBounds.top -= deltaHeight;
|
||||||
|
startBounds.bottom += deltaHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide the thumbnail and show the zoomed-in view. When the animation begins,
|
||||||
|
// it will position the zoomed-in view in the place of the thumbnail.
|
||||||
|
thumbView.setAlpha(0f);
|
||||||
|
hiddenView.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
// Set the pivot point for SCALE_X and SCALE_Y transformations to the top-left corner of
|
||||||
|
// the zoomed-in view (the default is the center of the view).
|
||||||
|
hiddenView.setPivotX(0f);
|
||||||
|
hiddenView.setPivotY(0f);
|
||||||
|
|
||||||
|
// Construct and run the parallel animation of the four translation and scale properties
|
||||||
|
// (X, Y, SCALE_X, and SCALE_Y).
|
||||||
|
AnimatorSet set = new AnimatorSet();
|
||||||
|
set
|
||||||
|
.play(ObjectAnimator.ofFloat(hiddenView, View.X, startBounds.left,
|
||||||
|
finalBounds.left))
|
||||||
|
.with(ObjectAnimator.ofFloat(hiddenView, View.Y, startBounds.top,
|
||||||
|
finalBounds.top))
|
||||||
|
.with(ObjectAnimator.ofFloat(hiddenView, View.SCALE_X, startScale, 1f))
|
||||||
|
.with(ObjectAnimator.ofFloat(hiddenView, View.SCALE_Y, startScale, 1f));
|
||||||
|
set.setDuration(200);
|
||||||
|
set.setInterpolator(new DecelerateInterpolator());
|
||||||
|
set.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
mCurrentAnimator = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationCancel(Animator animation) {
|
||||||
|
mCurrentAnimator = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
set.start();
|
||||||
|
mCurrentAnimator = set;
|
||||||
|
|
||||||
|
// Upon clicking the zoomed-in image, it should zoom back down to the original bounds
|
||||||
|
// and show the thumbnail instead of the expanded image.
|
||||||
|
final float startScaleFinal = startScale;
|
||||||
|
hiddenView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if (mCurrentAnimator != null) {
|
||||||
|
mCurrentAnimator.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Animate the four positioning/sizing properties in parallel, back to their
|
||||||
|
// original values.
|
||||||
|
AnimatorSet set = new AnimatorSet();
|
||||||
|
set
|
||||||
|
.play(ObjectAnimator.ofFloat(hiddenView, View.X, startBounds.left))
|
||||||
|
.with(ObjectAnimator.ofFloat(hiddenView, View.Y, startBounds.top))
|
||||||
|
.with(ObjectAnimator
|
||||||
|
.ofFloat(hiddenView, View.SCALE_X, startScaleFinal))
|
||||||
|
.with(ObjectAnimator
|
||||||
|
.ofFloat(hiddenView, View.SCALE_Y, startScaleFinal));
|
||||||
|
set.setDuration(200);
|
||||||
|
set.setInterpolator(new DecelerateInterpolator());
|
||||||
|
set.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
thumbView.setAlpha(1f);
|
||||||
|
hiddenView.setVisibility(View.GONE);
|
||||||
|
mCurrentAnimator = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationCancel(Animator animation) {
|
||||||
|
thumbView.setAlpha(1f);
|
||||||
|
hiddenView.setVisibility(View.GONE);
|
||||||
|
mCurrentAnimator = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
set.start();
|
||||||
|
mCurrentAnimator = set;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,6 +15,8 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
@@ -29,43 +31,61 @@ import com.google.firebase.storage.StorageReference;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import nl.myhyvesbookplus.tagram.controller.DownloadClass;
|
||||||
import nl.myhyvesbookplus.tagram.controller.ProfilePictureUploader;
|
import nl.myhyvesbookplus.tagram.controller.ProfilePictureUploader;
|
||||||
|
|
||||||
import static android.app.Activity.RESULT_OK;
|
import static android.app.Activity.RESULT_OK;
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
/// Views, buttons and other protected declarations ///
|
/* Views, buttons and other protected and private inits */
|
||||||
protected Button changePwdButton;
|
protected Button changePwdButton;
|
||||||
protected ImageButton profilePicButton;
|
protected ImageButton profilePicButton;
|
||||||
protected StorageReference httpsReference;
|
protected StorageReference httpsReference;
|
||||||
protected TextView profileName;
|
protected TextView profileName;
|
||||||
protected ImageView profilePicture;
|
protected ImageView profilePicture;
|
||||||
protected FirebaseUser user;
|
protected FirebaseUser user;
|
||||||
protected File photoFile = null;
|
protected File photoFile;
|
||||||
|
|
||||||
ProgressDialog progressDialog;
|
private ListView listView;
|
||||||
|
private DownloadClass downloadClass;
|
||||||
/// Required empty public constructor ///
|
private View headerInflater;
|
||||||
|
private View timeLineInflater;
|
||||||
|
private ProgressBar progressBar;
|
||||||
|
|
||||||
|
/* Required empty public constructor */
|
||||||
public ProfileFragment() {}
|
public ProfileFragment() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overridden onCreate which initializes a user and sets the default photoFile to null.
|
||||||
|
* @param savedInstanceState The standard return of the onCreate method.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
user = FirebaseAuth.getInstance().getCurrentUser();
|
user = FirebaseAuth.getInstance().getCurrentUser();
|
||||||
|
photoFile = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assigns all views and buttons for the header.
|
||||||
|
*/
|
||||||
|
protected void findHeaderViews() {
|
||||||
|
profilePicButton = (ImageButton) headerInflater.findViewById(R.id.profile_pic_button);
|
||||||
|
profilePicture = (ImageView) headerInflater.findViewById(R.id.imageView_profile_picture);
|
||||||
|
profileName = (TextView) headerInflater.findViewById(R.id.profile_name);
|
||||||
|
changePwdButton = (Button) headerInflater.findViewById(R.id.change_psw_button);
|
||||||
|
bindOnClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assigns all views and buttons.
|
* Assign the ListView and add the header to it.
|
||||||
*/
|
*/
|
||||||
protected void findViews(View view) {
|
protected void findTimelineViews() {
|
||||||
profilePicButton = (ImageButton) view.findViewById(R.id.profile_pic_button);
|
listView = (ListView) timeLineInflater.findViewById(R.id.list);
|
||||||
profilePicture = (ImageView) view.findViewById(R.id.imageView_profile_picture);
|
listView.addHeaderView(headerInflater);
|
||||||
profileName = (TextView) view.findViewById(R.id.profile_name);
|
|
||||||
changePwdButton = (Button) view.findViewById(R.id.change_psw_button);
|
|
||||||
bindOnClick();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,13 +96,27 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
|||||||
changePwdButton.setOnClickListener(this);
|
changePwdButton.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Page setup ///
|
/**
|
||||||
|
* Overridden onCreateView which serves as a fragment content creator.
|
||||||
|
* Checks for user data to be displayed.
|
||||||
|
*
|
||||||
|
* @param inflater The inflater used for the fragment.
|
||||||
|
* @param container The container which holds this fragment.
|
||||||
|
* @param savedInstanceState The state which was provided by onCreate.
|
||||||
|
* @return the timeLineInflater View which is required for the ListView to be updated.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.fragment_profile, container, false);
|
|
||||||
findViews(view);
|
timeLineInflater = inflater.inflate(R.layout.fragment_profile_timeline, container, false);
|
||||||
|
headerInflater = inflater.inflate(R.layout.fragment_profile_header, listView, false);
|
||||||
|
progressBar = (ProgressBar) timeLineInflater.findViewById(R.id.progressbar_timeline);
|
||||||
|
progressBar.setVisibility(View.VISIBLE);
|
||||||
|
findHeaderViews();
|
||||||
|
findTimelineViews();
|
||||||
|
|
||||||
|
profilePicture.invalidate();
|
||||||
|
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
if(user.getPhotoUrl() != null) {
|
if(user.getPhotoUrl() != null) {
|
||||||
@@ -98,19 +132,19 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
|||||||
Glide.with(this).using(new FirebaseImageLoader()).load(httpsReference).into(profilePicture);
|
Glide.with(this).using(new FirebaseImageLoader()).load(httpsReference).into(profilePicture);
|
||||||
}
|
}
|
||||||
|
|
||||||
profilePicture.invalidate();
|
downloadClass = new DownloadClass(getActivity());
|
||||||
|
downloadClass.getPostsFromServer();
|
||||||
return view;
|
return timeLineInflater;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a view has been clicked.
|
* Called when a view has been clicked.
|
||||||
*
|
*
|
||||||
* @param v The view that was clicked.
|
* @param view The view that was clicked.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View view) {
|
||||||
switch (v.getId()) {
|
switch (view.getId()) {
|
||||||
case R.id.profile_pic_button:
|
case R.id.profile_pic_button:
|
||||||
profilePicOnClick();
|
profilePicOnClick();
|
||||||
break;
|
break;
|
||||||
@@ -125,13 +159,13 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
|||||||
*/
|
*/
|
||||||
private void profilePicOnClick() {
|
private void profilePicOnClick() {
|
||||||
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
/* Ensure that there's a camera activity to handle the intent */
|
|
||||||
if (takePictureIntent.resolveActivity(getActivity().getPackageManager()) != null) {
|
if (takePictureIntent.resolveActivity(getActivity().getPackageManager()) != null) {
|
||||||
/* Create the File where the photo should go */
|
|
||||||
try {
|
try {
|
||||||
photoFile = createImageFile();
|
photoFile = createImageFile();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Toast.makeText(getActivity(), getString(R.string.image_save_error), Toast.LENGTH_LONG);
|
Toast.makeText(getActivity(), getString(R.string.image_save_error),
|
||||||
|
Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
if (photoFile != null) {
|
if (photoFile != null) {
|
||||||
Uri photoURI = FileProvider.getUriForFile(getActivity(),
|
Uri photoURI = FileProvider.getUriForFile(getActivity(),
|
||||||
@@ -143,8 +177,18 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start display of the list; uses an adapter and listener in the main activity.
|
||||||
|
*/
|
||||||
|
public void startList() {
|
||||||
|
ProfileAdapter adapter = new ProfileAdapter(getActivity(), downloadClass.getOwnPosts());
|
||||||
|
listView.setAdapter(adapter);
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grabs the image just taken by the built-in camera and pushes this image to the user account.
|
* Grabs the image just taken by the built-in camera and pushes this image to the user account.
|
||||||
|
*
|
||||||
* @param requestCode The code which corresponds to REQUEST_TAKE_PHOTO. Used as indicator.
|
* @param requestCode The code which corresponds to REQUEST_TAKE_PHOTO. Used as indicator.
|
||||||
* @param resultCode Code should be RESULT_OK to allow camera to proceed.
|
* @param resultCode Code should be RESULT_OK to allow camera to proceed.
|
||||||
* @param data The image data from the camera.
|
* @param data The image data from the camera.
|
||||||
@@ -154,25 +198,26 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
|||||||
if (requestCode == REQUEST_TAKE_PHOTO && resultCode == RESULT_OK) {
|
if (requestCode == REQUEST_TAKE_PHOTO && resultCode == RESULT_OK) {
|
||||||
progressDialog = ProgressDialog.show(getActivity(), getString(R.string.please_wait), getString(R.string.upload_profile_pic), false, false);
|
progressDialog = ProgressDialog.show(getActivity(), getString(R.string.please_wait), getString(R.string.upload_profile_pic), false, false);
|
||||||
ProfilePictureUploader profilePictureUploader = new ProfilePictureUploader(getActivity());
|
ProfilePictureUploader profilePictureUploader = new ProfilePictureUploader(getActivity());
|
||||||
profilePictureUploader.uploadProfilePicture(photoFile.getAbsoluteFile());
|
profilePictureUploader.uploadProfilePicture(photoFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the file which the camera requires to save a proper quality picture to.
|
||||||
|
*
|
||||||
|
* @return The new file.
|
||||||
|
* @throws IOException when insufficient permission or storage available.
|
||||||
|
*/
|
||||||
private File createImageFile() throws IOException {
|
private File createImageFile() throws IOException {
|
||||||
// Create an image file name
|
|
||||||
String imageFileName = "JPEG_" + user.getUid();
|
String imageFileName = "JPEG_" + user.getUid();
|
||||||
File storageDir = getActivity().getExternalFilesDir(Environment.DIRECTORY_PICTURES);
|
File storageDir = getActivity().getExternalFilesDir(Environment.DIRECTORY_PICTURES);
|
||||||
return File.createTempFile(
|
return File.createTempFile(
|
||||||
imageFileName, /* prefix */
|
imageFileName, /* prefix */
|
||||||
".jpg", /* suffix */
|
".jpg", /* suffix */
|
||||||
storageDir /* directory */
|
storageDir /* directory */
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TODO Make this function into its own class for modularity.
|
|
||||||
/**
|
/**
|
||||||
* Performs password reset action.
|
* Performs password reset action.
|
||||||
*/
|
*/
|
||||||
@@ -183,13 +228,13 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onComplete(@NonNull Task<Void> task) {
|
public void onComplete(@NonNull Task<Void> task) {
|
||||||
Toast.makeText(getActivity(), task.isSuccessful()
|
Toast.makeText(getActivity(), task.isSuccessful()
|
||||||
? "An e-mail was sent, please follow its instructions."
|
? getString(R.string.mail_successful)
|
||||||
: "An error occurred, please check internet connection.",
|
: getString(R.string.mail_failed),
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
// TODO Add code here for when there is no currently active user.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,30 @@
|
|||||||
package nl.myhyvesbookplus.tagram;
|
package nl.myhyvesbookplus.tagram;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.Point;
|
||||||
|
import android.graphics.Rect;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.animation.DecelerateInterpolator;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.BaseAdapter;
|
import android.widget.BaseAdapter;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.animation.Animator;
|
||||||
|
import android.animation.AnimatorListenerAdapter;
|
||||||
|
import android.animation.AnimatorSet;
|
||||||
|
import android.animation.ObjectAnimator;
|
||||||
|
|
||||||
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.android.gms.tasks.OnCompleteListener;
|
||||||
|
import com.google.android.gms.tasks.Task;
|
||||||
|
import com.google.firebase.database.DatabaseReference;
|
||||||
|
import com.google.firebase.database.FirebaseDatabase;
|
||||||
import com.google.firebase.storage.FirebaseStorage;
|
import com.google.firebase.storage.FirebaseStorage;
|
||||||
import com.google.firebase.storage.StorageReference;
|
import com.google.firebase.storage.StorageReference;
|
||||||
|
|
||||||
@@ -29,11 +41,14 @@ public class TimeLineAdapter extends BaseAdapter implements AdapterView.OnItemCl
|
|||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private ArrayList<UriPost> mData;
|
private ArrayList<UriPost> mData;
|
||||||
|
private DatabaseReference mRef;
|
||||||
|
private Animator mCurrentAnimator;
|
||||||
|
|
||||||
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);
|
||||||
mData = data;
|
mData = data;
|
||||||
|
mRef = FirebaseDatabase.getInstance().getReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -52,37 +67,54 @@ public class TimeLineAdapter extends BaseAdapter implements AdapterView.OnItemCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(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);
|
||||||
TextView nietSlechts = (TextView) rowView.findViewById(R.id.niet_slecht_count);
|
final TextView nietSlechts = (TextView) rowView.findViewById(R.id.niet_slecht_count);
|
||||||
ImageView photo = (ImageView) rowView.findViewById(R.id.timeline_image);
|
TextView dateTime = (TextView) rowView.findViewById(R.id.timeline_date);
|
||||||
ImageButton nietSlechtButton = (ImageButton) rowView.findViewById(R.id.niet_slecht_button);
|
final ImageView photo = (ImageView) rowView.findViewById(R.id.timeline_image);
|
||||||
|
final ImageButton nietSlechtButton = (ImageButton) rowView.findViewById(R.id.niet_slecht_button);
|
||||||
|
|
||||||
nietSlechtButton.setOnClickListener(new View.OnClickListener() {
|
final UriPost post = (UriPost) getItem(position);
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
UriPost post = (UriPost) getItem(position);
|
|
||||||
|
|
||||||
nietSlechts.setText(Integer.toString(post.getNietSlechts()));
|
nietSlechts.setText(Integer.toString(post.getNietSlechts()));
|
||||||
comment.setText(post.getComment());
|
comment.setText(post.getComment());
|
||||||
|
|
||||||
StorageReference ref = FirebaseStorage.getInstance().getReferenceFromUrl(post.getUri());
|
nietSlechtButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Log.d(TAG, "onClick: " + position);
|
||||||
|
mRef.child("posts").child(post.getDatabaseEntryName())
|
||||||
|
.child("nietSlechts").setValue(post.getNietSlechts() + 1)
|
||||||
|
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||||
|
@Override
|
||||||
|
public void onComplete(@NonNull Task<Void> task) {
|
||||||
|
nietSlechts.setText(Integer.toString(post.getNietSlechts() + 1));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dateTime.setText(post.getDate().toString());
|
||||||
|
|
||||||
|
final StorageReference ref = FirebaseStorage.getInstance().getReferenceFromUrl(post.getUri());
|
||||||
Glide.with(mContext)
|
Glide.with(mContext)
|
||||||
.using(new FirebaseImageLoader())
|
.using(new FirebaseImageLoader())
|
||||||
.load(ref)
|
.load(ref)
|
||||||
.into(photo);
|
.into(photo);
|
||||||
|
|
||||||
|
photo.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
zoomImageFromThumb(photo, ref);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return rowView;
|
return rowView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback method to be invoked when an item in this AdapterView has
|
* Callback method to be invoked when an item in this AdapterView has
|
||||||
* been clicked.
|
* been clicked.
|
||||||
@@ -101,4 +133,140 @@ public class TimeLineAdapter extends BaseAdapter implements AdapterView.OnItemCl
|
|||||||
Log.d(TAG, "onItemClick: rowNumber! "+ position);
|
Log.d(TAG, "onItemClick: rowNumber! "+ position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https://developer.android.com/training/animation/zoom.html
|
||||||
|
* "Zooms" in a thumbnail view by assigning the high resolution image to a hidden "zoomed-in"
|
||||||
|
* image view and animating its bounds to fit the entire activity content area.
|
||||||
|
*
|
||||||
|
* @param thumbView The thumbnail view to zoom in.
|
||||||
|
* @param imageRef The high-resolution version of the image represented by the thumbnail.
|
||||||
|
*/
|
||||||
|
private void zoomImageFromThumb(final View thumbView, StorageReference imageRef) {
|
||||||
|
// If there's an animation in progress, cancel it immediately and proceed with this one.
|
||||||
|
if (mCurrentAnimator != null) {
|
||||||
|
mCurrentAnimator.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load the high-resolution "zoomed-in" image.
|
||||||
|
final ImageView hiddenView = (ImageView) ((MainActivity) mContext).findViewById(R.id.expanded_image);
|
||||||
|
|
||||||
|
Glide.with(mContext)
|
||||||
|
.using(new FirebaseImageLoader())
|
||||||
|
.load(imageRef)
|
||||||
|
.into(hiddenView);
|
||||||
|
|
||||||
|
// Calculate the starting and ending bounds for the zoomed-in image. This step
|
||||||
|
// involves lots of math. Yay, math.
|
||||||
|
final Rect startBounds = new Rect();
|
||||||
|
final Rect finalBounds = new Rect();
|
||||||
|
final Point globalOffset = new Point();
|
||||||
|
|
||||||
|
// The start bounds are the global visible rectangle of the thumbnail, and the
|
||||||
|
// final bounds are the global visible rectangle of the container view. Also
|
||||||
|
// set the container view's offset as the origin for the bounds, since that's
|
||||||
|
// the origin for the positioning animation properties (X, Y).
|
||||||
|
thumbView.getGlobalVisibleRect(startBounds);
|
||||||
|
((MainActivity) mContext).findViewById(R.id.relative_layout_timeline).getGlobalVisibleRect(finalBounds, globalOffset);
|
||||||
|
startBounds.offset(-globalOffset.x, -globalOffset.y);
|
||||||
|
finalBounds.offset(-globalOffset.x, -globalOffset.y);
|
||||||
|
|
||||||
|
// Adjust the start bounds to be the same aspect ratio as the final bounds using the
|
||||||
|
// "center crop" technique. This prevents undesirable stretching during the animation.
|
||||||
|
// Also calculate the start scaling factor (the end scaling factor is always 1.0).
|
||||||
|
float startScale;
|
||||||
|
if ((float) finalBounds.width() / finalBounds.height()
|
||||||
|
> (float) startBounds.width() / startBounds.height()) {
|
||||||
|
// Extend start bounds horizontally
|
||||||
|
startScale = (float) startBounds.height() / finalBounds.height();
|
||||||
|
float startWidth = startScale * finalBounds.width();
|
||||||
|
float deltaWidth = (startWidth - startBounds.width()) / 2;
|
||||||
|
startBounds.left -= deltaWidth;
|
||||||
|
startBounds.right += deltaWidth;
|
||||||
|
} else {
|
||||||
|
// Extend start bounds vertically
|
||||||
|
startScale = (float) startBounds.width() / finalBounds.width();
|
||||||
|
float startHeight = startScale * finalBounds.height();
|
||||||
|
float deltaHeight = (startHeight - startBounds.height()) / 2;
|
||||||
|
startBounds.top -= deltaHeight;
|
||||||
|
startBounds.bottom += deltaHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide the thumbnail and show the zoomed-in view. When the animation begins,
|
||||||
|
// it will position the zoomed-in view in the place of the thumbnail.
|
||||||
|
thumbView.setAlpha(0f);
|
||||||
|
hiddenView.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
// Set the pivot point for SCALE_X and SCALE_Y transformations to the top-left corner of
|
||||||
|
// the zoomed-in view (the default is the center of the view).
|
||||||
|
hiddenView.setPivotX(0f);
|
||||||
|
hiddenView.setPivotY(0f);
|
||||||
|
|
||||||
|
// Construct and run the parallel animation of the four translation and scale properties
|
||||||
|
// (X, Y, SCALE_X, and SCALE_Y).
|
||||||
|
AnimatorSet set = new AnimatorSet();
|
||||||
|
set
|
||||||
|
.play(ObjectAnimator.ofFloat(hiddenView, View.X, startBounds.left,
|
||||||
|
finalBounds.left))
|
||||||
|
.with(ObjectAnimator.ofFloat(hiddenView, View.Y, startBounds.top,
|
||||||
|
finalBounds.top))
|
||||||
|
.with(ObjectAnimator.ofFloat(hiddenView, View.SCALE_X, startScale, 1f))
|
||||||
|
.with(ObjectAnimator.ofFloat(hiddenView, View.SCALE_Y, startScale, 1f));
|
||||||
|
set.setDuration(200);
|
||||||
|
set.setInterpolator(new DecelerateInterpolator());
|
||||||
|
set.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
mCurrentAnimator = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationCancel(Animator animation) {
|
||||||
|
mCurrentAnimator = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
set.start();
|
||||||
|
mCurrentAnimator = set;
|
||||||
|
|
||||||
|
// Upon clicking the zoomed-in image, it should zoom back down to the original bounds
|
||||||
|
// and show the thumbnail instead of the expanded image.
|
||||||
|
final float startScaleFinal = startScale;
|
||||||
|
hiddenView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if (mCurrentAnimator != null) {
|
||||||
|
mCurrentAnimator.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Animate the four positioning/sizing properties in parallel, back to their
|
||||||
|
// original values.
|
||||||
|
AnimatorSet set = new AnimatorSet();
|
||||||
|
set
|
||||||
|
.play(ObjectAnimator.ofFloat(hiddenView, View.X, startBounds.left))
|
||||||
|
.with(ObjectAnimator.ofFloat(hiddenView, View.Y, startBounds.top))
|
||||||
|
.with(ObjectAnimator
|
||||||
|
.ofFloat(hiddenView, View.SCALE_X, startScaleFinal))
|
||||||
|
.with(ObjectAnimator
|
||||||
|
.ofFloat(hiddenView, View.SCALE_Y, startScaleFinal));
|
||||||
|
set.setDuration(200);
|
||||||
|
set.setInterpolator(new DecelerateInterpolator());
|
||||||
|
set.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
thumbView.setAlpha(1f);
|
||||||
|
hiddenView.setVisibility(View.GONE);
|
||||||
|
mCurrentAnimator = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationCancel(Animator animation) {
|
||||||
|
thumbView.setAlpha(1f);
|
||||||
|
hiddenView.setVisibility(View.GONE);
|
||||||
|
mCurrentAnimator = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
set.start();
|
||||||
|
mCurrentAnimator = set;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,38 +1,101 @@
|
|||||||
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.support.v4.widget.SwipeRefreshLayout;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.AbsListView;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import nl.myhyvesbookplus.tagram.controller.DownloadClass;
|
import nl.myhyvesbookplus.tagram.controller.DownloadClass;
|
||||||
|
|
||||||
|
|
||||||
public class TimelineFragment extends Fragment {
|
public class TimelineFragment extends Fragment {
|
||||||
|
|
||||||
|
/* Some protected and private inits */
|
||||||
private ListView listView;
|
private ListView listView;
|
||||||
private DownloadClass downloadClass;
|
private DownloadClass downloadClass;
|
||||||
|
private ProgressBar progressBar;
|
||||||
|
|
||||||
public TimelineFragment() {
|
/* Required empty public constructor */
|
||||||
// Required empty public constructor
|
public TimelineFragment() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overridden onCreate which also starts a progress dialog for the posts being downloaded.
|
||||||
|
* @param savedInstanceState The standard return of the onCreate method.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
// progressDialog = ProgressDialog.show(getActivity(), getString(R.string.please_wait), getString(R.string.downloading_posts), false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overridden onCreateView method which creates the ListView and contains a possible refresh
|
||||||
|
* functionality (swipe down page for result).
|
||||||
|
*
|
||||||
|
* https://www.survivingwithandroid.com/2014/05/android-swiperefreshlayout-tutorial-2.html
|
||||||
|
* Above reference was largely copied from.
|
||||||
|
* @param inflater The inflater used for the fragment.
|
||||||
|
* @param container The container which holds this fragment.
|
||||||
|
* @param savedInstanceState The state which was provided by onCreate.
|
||||||
|
* @return the timeLineInflater View which is required for the ListView to be updated.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.fragment_timeline, container, false);
|
View timeLineInflater = inflater.inflate(R.layout.fragment_timeline, container, false);
|
||||||
listView = (ListView) view.findViewById(R.id.listview);
|
listView = (ListView) timeLineInflater.findViewById(R.id.list);
|
||||||
|
final SwipeRefreshLayout swipeView = (SwipeRefreshLayout) timeLineInflater.findViewById(R.id.swipe);
|
||||||
|
|
||||||
|
progressBar = (ProgressBar) timeLineInflater.findViewById(R.id.progressbar_timeline);
|
||||||
|
progressBar.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
swipeView.setEnabled(false);
|
||||||
downloadClass = new DownloadClass(getActivity());
|
downloadClass = new DownloadClass(getActivity());
|
||||||
downloadClass.getPostsFromServer();
|
downloadClass.getPostsFromServer();
|
||||||
|
|
||||||
return view;
|
swipeView.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
downloadClass.getPostsFromServer();
|
||||||
|
Toast.makeText(getActivity(), R.string.refreshing,
|
||||||
|
Toast.LENGTH_LONG).show();
|
||||||
|
swipeView.setRefreshing(true);
|
||||||
|
( new Handler()).postDelayed(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
swipeView.setRefreshing(false);
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
listView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||||
|
@Override
|
||||||
|
public void onScrollStateChanged(AbsListView absListView, int i) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onScroll(AbsListView absListView, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||||
|
swipeView.setEnabled(firstVisibleItem == 0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return timeLineInflater;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start display of the list; uses an adapter and listener in the main activity.
|
||||||
|
*/
|
||||||
public void startList() {
|
public void startList() {
|
||||||
TimeLineAdapter adapter = new TimeLineAdapter(getActivity(), downloadClass.getmList());
|
TimeLineAdapter adapter = new TimeLineAdapter(getActivity(), downloadClass.getmList());
|
||||||
listView.setAdapter(adapter);
|
listView.setAdapter(adapter);
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package nl.myhyvesbookplus.tagram.controller;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.google.firebase.auth.FirebaseAuth;
|
||||||
import com.google.firebase.database.DataSnapshot;
|
import com.google.firebase.database.DataSnapshot;
|
||||||
import com.google.firebase.database.DatabaseError;
|
import com.google.firebase.database.DatabaseError;
|
||||||
import com.google.firebase.database.DatabaseReference;
|
import com.google.firebase.database.DatabaseReference;
|
||||||
@@ -32,18 +33,22 @@ public class DownloadClass {
|
|||||||
+ " must implement PostDownloadListener");
|
+ " must implement PostDownloadListener");
|
||||||
}
|
}
|
||||||
mDataRef = FirebaseDatabase.getInstance().getReference();
|
mDataRef = FirebaseDatabase.getInstance().getReference();
|
||||||
mList = new ArrayList<>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getPostsFromServer() {
|
public void getPostsFromServer() {
|
||||||
Log.d(TAG, "getPostsFromServer: Begin of function");
|
mList = new ArrayList<>();
|
||||||
|
|
||||||
mDataRef.child("posts").addListenerForSingleValueEvent(new ValueEventListener() {
|
mDataRef.child("posts").addListenerForSingleValueEvent(new ValueEventListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onDataChange(DataSnapshot dataSnapshot) {
|
public void onDataChange(DataSnapshot dataSnapshot) {
|
||||||
|
|
||||||
for (DataSnapshot data : dataSnapshot.getChildren()) {
|
for (DataSnapshot data : dataSnapshot.getChildren()) {
|
||||||
mList.add(data.getValue(UriPost.class));
|
UriPost tempPost = data.getValue(UriPost.class);
|
||||||
|
tempPost.setDatabaseEntryName(data.getKey());
|
||||||
|
mList.add(tempPost);
|
||||||
}
|
}
|
||||||
Collections.reverse(mList);
|
Collections.reverse(mList);
|
||||||
|
|
||||||
mListener.PostDownloaded();
|
mListener.PostDownloaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,6 +63,19 @@ public class DownloadClass {
|
|||||||
return mList;
|
return mList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList<UriPost> getOwnPosts() {
|
||||||
|
String currentUid = FirebaseAuth.getInstance().getCurrentUser().getUid();
|
||||||
|
ArrayList<UriPost> posts = new ArrayList<>();
|
||||||
|
|
||||||
|
for (UriPost post : mList) {
|
||||||
|
if (post.getPoster().equals(currentUid)) {
|
||||||
|
posts.add(post);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return posts;
|
||||||
|
}
|
||||||
|
|
||||||
public interface PostDownloadListener {
|
public interface PostDownloadListener {
|
||||||
void PostDownloaded();
|
void PostDownloaded();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import java.util.Date;
|
|||||||
*/
|
*/
|
||||||
public class UriPost extends Post {
|
public class UriPost extends Post {
|
||||||
private String uri;
|
private String uri;
|
||||||
|
private String databaseEntryName;
|
||||||
|
|
||||||
public UriPost() {
|
public UriPost() {
|
||||||
// Default constructor required for calls to DataSnapshot.getValue(UriPost.class)
|
// Default constructor required for calls to DataSnapshot.getValue(UriPost.class)
|
||||||
@@ -33,4 +34,12 @@ public class UriPost extends Post {
|
|||||||
public void setUri(String uri) {
|
public void setUri(String uri) {
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDatabaseEntryName() {
|
||||||
|
return databaseEntryName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDatabaseEntryName(String databaseEntryName) {
|
||||||
|
this.databaseEntryName = databaseEntryName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 199 B |
@@ -0,0 +1,11 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:strokeColor="#AAAAAA" android:strokeWidth="0.5"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillAlpha="0.5"
|
||||||
|
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||||
|
</vector>
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 222 B |
@@ -0,0 +1,11 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:strokeColor="#AAAAAA" android:strokeWidth="0.5"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillAlpha="0.5"
|
||||||
|
android:pathData="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:strokeColor="#AAAAAA" android:strokeWidth="0.5"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillAlpha="0.5"
|
||||||
|
android:pathData="M9.4,10.5l4.77,-8.26C13.47,2.09 12.75,2 12,2c-2.4,0 -4.6,0.85 -6.32,2.25l3.66,6.35 0.06,-0.1zM21.54,9c-0.92,-2.92 -3.15,-5.26 -6,-6.34L11.88,9h9.66zM21.8,10h-7.49l0.29,0.5 4.76,8.25C21,16.97 22,14.61 22,12c0,-0.69 -0.07,-1.35 -0.2,-2zM8.54,12l-3.9,-6.75C3.01,7.03 2,9.39 2,12c0,0.69 0.07,1.35 0.2,2h7.49l-1.15,-2zM2.46,15c0.92,2.92 3.15,5.26 6,6.34L12.12,15L2.46,15zM13.73,15l-3.9,6.76c0.7,0.15 1.42,0.24 2.17,0.24 2.4,0 4.6,-0.85 6.32,-2.25l-3.66,-6.35 -0.93,1.6z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:strokeColor="#AAAAAA" android:strokeWidth="0.5"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillAlpha="0.5"
|
||||||
|
android:pathData="M20,4h-3.17L15,2L9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM15,15.5L15,13L9,13v2.5L5.5,12 9,8.5L9,11h6L15,8.5l3.5,3.5 -3.5,3.5z"/>
|
||||||
|
</vector>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
@@ -13,7 +13,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:padding="16dp">
|
android:padding="0dp">
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<android.support.design.widget.BottomNavigationView
|
<android.support.design.widget.BottomNavigationView
|
||||||
|
|||||||
@@ -18,28 +18,23 @@
|
|||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:padding="10dp"
|
android:padding="15dp"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
android:scaleX="2"
|
android:scaleX="2.5"
|
||||||
android:scaleY="2"
|
android:scaleY="2.5"
|
||||||
app:srcCompat="@android:drawable/ic_menu_camera" />
|
android:src="@drawable/ic_camera_black_24dp"/>
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/switch_camera_button"
|
android:id="@+id/switch_camera_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
|
android:padding="10dp"
|
||||||
android:layout_margin="9dp"
|
android:layout_margin="9dp"
|
||||||
|
android:scaleX="1.5"
|
||||||
|
android:scaleY="1.5"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
app:srcCompat="@android:drawable/ic_menu_revert" />
|
android:src="@drawable/ic_switch_camera_black_24dp"/>
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/load_bar"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:indeterminate="true"
|
|
||||||
android:layout_centerInParent="true"/>
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/filter_buttons"
|
android:id="@+id/filter_buttons"
|
||||||
@@ -54,8 +49,10 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:scaleX="0.5"
|
android:scaleX="2"
|
||||||
android:scaleY="0.5"
|
android:scaleY="2"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:layout_margin="10dp"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:src="@drawable/ic_arrow_back_black_24dp"/>
|
android:src="@drawable/ic_arrow_back_black_24dp"/>
|
||||||
|
|
||||||
@@ -64,8 +61,10 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:scaleX="0.5"
|
android:scaleX="2"
|
||||||
android:scaleY="0.5"
|
android:scaleY="2"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:layout_margin="10dp"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:src="@drawable/ic_arrow_forward_black_24dp"/>
|
android:src="@drawable/ic_arrow_forward_black_24dp"/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -74,13 +73,17 @@
|
|||||||
android:id="@+id/comment_box"
|
android:id="@+id/comment_box"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:clickable="false"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:background="@android:color/background_light"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Comment:"/>
|
android:text="@string/comment"/>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/comment_text"
|
android:id="@+id/comment_text"
|
||||||
@@ -89,47 +92,41 @@
|
|||||||
android:lines="4"
|
android:lines="4"
|
||||||
android:layout_margin="4dp"
|
android:layout_margin="4dp"
|
||||||
android:padding="5dp"
|
android:padding="5dp"
|
||||||
android:visibility="visible"
|
|
||||||
android:background="@android:color/darker_gray"/>
|
android:background="@android:color/darker_gray"/>
|
||||||
<Button
|
|
||||||
android:id="@+id/comment_submit"
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Submit"/>
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/comment_submit"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/upload"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/comment_cancel"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/cancel"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<android.support.design.widget.FloatingActionButton
|
||||||
android:id="@+id/picture_taken_buttons"
|
android:id="@+id/upload_button"
|
||||||
android:layout_width="match_parent"
|
android:visibility="gone"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginRight="30dp"
|
android:scaleType="center"
|
||||||
android:layout_marginBottom="20dp">
|
android:layout_margin="15dp"
|
||||||
|
app:fabSize="normal"
|
||||||
<android.support.design.widget.FloatingActionButton
|
android:src="@android:drawable/ic_menu_upload"/>
|
||||||
android:id="@+id/upload_button"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:scaleType="center"
|
|
||||||
app:fabSize="normal"
|
|
||||||
android:src="@android:drawable/ic_menu_upload"/>
|
|
||||||
|
|
||||||
<!--<android.support.design.widget.FloatingActionButton
|
|
||||||
android:id="@+id/save_button"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:scaleType="center"
|
|
||||||
app:fabSize="normal"
|
|
||||||
android:src="@android:drawable/ic_menu_save"/>-->
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,81 +0,0 @@
|
|||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context="nl.myhyvesbookplus.tagram.ProfileFragment">
|
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="5dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/profile_name"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:text="Name:"
|
|
||||||
android:textSize="25sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="10dp" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/profile_pic_button"
|
|
||||||
android:layout_width="60dp"
|
|
||||||
android:layout_height="80dp"
|
|
||||||
android:layout_marginStart="110dp"
|
|
||||||
android:background="@android:color/transparent"
|
|
||||||
android:elevation="1dp"
|
|
||||||
app:srcCompat="@android:drawable/ic_menu_camera" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/imageView_profile_picture"
|
|
||||||
android:contentDescription="@string/profile_picture_description"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="300dp"
|
|
||||||
app:srcCompat="@drawable/avatar_standard"
|
|
||||||
android:layout_marginTop="-70dp"/>
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="25dp" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/change_psw_button"
|
|
||||||
android:layout_width="300dp"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:background="?attr/colorPrimary"
|
|
||||||
android:text="@string/change_psw_button"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="20dp" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/logout_button"
|
|
||||||
android:layout_width="300dp"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:background="?attr/colorPrimary"
|
|
||||||
android:onClick="logOutOnClick"
|
|
||||||
android:text="@string/logout_button"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</ScrollView>
|
|
||||||
</FrameLayout>
|
|
||||||
@@ -65,5 +65,12 @@
|
|||||||
android:text="@string/logout_button"
|
android:text="@string/logout_button"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
<Space
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="10dp" />
|
||||||
|
<Space
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="10dp" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -1,14 +1,35 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/relative_layout_timeline_profile"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:context="nl.myhyvesbookplus.tagram.TimelineFragment">
|
tools:context="nl.myhyvesbookplus.tagram.TimelineFragment">
|
||||||
|
|
||||||
<ListView
|
<RelativeLayout
|
||||||
android:id="@+id/listview_profile"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
</ListView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
<ProgressBar
|
||||||
|
android:id="@+id/progressbar_timeline"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/expanded_image_profile"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:visibility="invisible" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -1,15 +1,43 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/relative_layout_timeline"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:context="nl.myhyvesbookplus.tagram.TimelineFragment">
|
tools:context="nl.myhyvesbookplus.tagram.TimelineFragment">
|
||||||
|
|
||||||
<ListView
|
<RelativeLayout
|
||||||
android:id="@+id/listview"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
</ListView>
|
<ProgressBar
|
||||||
|
android:id="@+id/progressbar_timeline"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
</LinearLayout>
|
<android.support.v4.widget.SwipeRefreshLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/swipe"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
</ListView>
|
||||||
|
</android.support.v4.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/expanded_image"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:visibility="invisible" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -1,40 +1,66 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="15dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/username_timeline"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/timeline_image"
|
android:id="@+id/timeline_image"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_height="250dp"
|
||||||
android:layout_height="250dp" />
|
android:layout_gravity="center" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/timeline_date"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:textColor="#AAAAAA"
|
||||||
|
android:text="date/time" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/comment_timeline"
|
android:id="@+id/comment_timeline"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
android:text="Hallo Ik ben een comment!" />
|
android:text="Hallo Ik ben een comment!" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:padding="5dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp">
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/niet_slecht_button"
|
android:id="@+id/niet_slecht_button"
|
||||||
android:layout_width="200dp"
|
android:layout_width="150dp"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="40dp"
|
||||||
|
android:scaleType="centerInside"
|
||||||
<TextView
|
android:background="@android:color/transparent"
|
||||||
android:layout_width="wrap_content"
|
android:src="@drawable/niet_slecht"/>
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:text="@string/niet_slecht" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/niet_slecht_count"
|
android:id="@+id/niet_slecht_count"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="20sp"
|
||||||
android:text="10" />
|
android:text="10" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="10dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -3,6 +3,10 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="15dp" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/timeline_image_profile"
|
android:id="@+id/timeline_image_profile"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -13,21 +17,34 @@
|
|||||||
android:id="@+id/comment_timeline_profile"
|
android:id="@+id/comment_timeline_profile"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Hallo Ik ben een comment!" />
|
android:gravity="center_horizontal"
|
||||||
|
android:text="@string/comment_placeholder" />
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:gravity="center"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp">
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<ImageButton
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/niet_slecht_button"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="150dp"
|
||||||
android:text="@string/niet_slecht" />
|
android:layout_height="40dp"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:src="@drawable/niet_slecht"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/niet_slecht_count_profile"
|
android:id="@+id/niet_slecht_count_profile"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="20sp"
|
||||||
android:text="10" />
|
android:text="10" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="15dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -11,24 +11,28 @@
|
|||||||
<string name="title_home">Tijdlijn</string>
|
<string name="title_home">Tijdlijn</string>
|
||||||
<string name="title_notifications">Profiel</string>
|
<string name="title_notifications">Profiel</string>
|
||||||
<string name="username">Gebruikersnaam</string>
|
<string name="username">Gebruikersnaam</string>
|
||||||
<string name="confirm_password_hint">bevestig wachtwoord</string>
|
|
||||||
<string name="logo_text">MyHyvesBookPlusTagram logo</string>
|
<string name="logo_text">MyHyvesBookPlusTagram logo</string>
|
||||||
<string name="logout_button">Uitloggen</string>
|
<string name="logout_button">Uitloggen</string>
|
||||||
<string name="profile_picture_button">Wijzig Profiel Foto</string>
|
<string name="profile_picture_button">Wijzig Profiel Foto</string>
|
||||||
<string name="profile_picture_description">profiel foto</string>
|
<string name="profile_picture_description">profiel foto</string>
|
||||||
<string name="change_psw_button">Wachtwoord wijzigen</string>
|
<string name="change_psw_button">Wachtwoord wijzigen</string>
|
||||||
<string name="please_wait">Momentje</string>
|
<string name="please_wait">Momentje</string>
|
||||||
<string name="hello_blank_fragment">Hallo leeg fragment</string>
|
|
||||||
<string name="hello_camera">Hallo Camera fragment</string>
|
|
||||||
<string name="login_error">Voer alstublieft email en wachtwoord in</string>
|
<string name="login_error">Voer alstublieft email en wachtwoord in</string>
|
||||||
<string name="mail_failed">Er is een fout opgetreden. Controleer internetverbinding.</string>
|
<string name="mail_failed">Er is een fout opgetreden. Controleer internetverbinding.</string>
|
||||||
<string name="mail_successful">Er is een e-mail verzonden. Volg a.u.b. de instructies.</string>
|
<string name="mail_successful">Er is een e-mail verzonden. Volg a.u.b. de instructies.</string>
|
||||||
<string name="password_match_error">Wachtwoorden komen niet overeen</string>
|
<string name="password_match_error">Wachtwoorden komoen niet overeen</string>
|
||||||
<string name="register_error">Vul alstublieft alle velden in</string>
|
<string name="register_error">Vul alstublieft alle velden in</string>
|
||||||
<string name="save">Opslaan</string>
|
<string name="save">Opslaan</string>
|
||||||
<string name="upload">Uploaden</string>
|
<string name="upload">Uploaden</string>
|
||||||
<string name="image_save_error">Foto opslaan mislukt. Zorg a.u.b. dat er genoeg ruimte op uw telefoon beschikbaar is.</string>
|
<string name="image_save_error">Foto opslaan mislukt. Zorg a.u.b. dat er genoeg ruimte op uw telefoon beschikbaar is.</string>
|
||||||
<string name="update_profile_pic_error">Het updaten van de profielfoto is mislukt. Controleer uw internetverbinding.</string>
|
<string name="update_profile_pic_error">Het updaten van de profielfoto is mislukt. Controleer uw internetverbinding.</string>
|
||||||
<string name="upload_profile_pic">Profielfoto aan het uploaden…</string>
|
<string name="upload_profile_pic">Profielfoto aan het uploaden…</string>
|
||||||
<string name="niet_slecht">"\"Niet slecht.\"s "</string>
|
<string name="niet_slecht">Niet Slecht.</string>
|
||||||
|
<string name="comment">Bijschrift:</string>
|
||||||
|
<string name="cancel">Annuleer</string>
|
||||||
|
<string name="comment_placeholder">Hallo Ik ben een comment!</string>
|
||||||
|
<string name="refreshing">Verversen…</string>
|
||||||
|
<string name="downloading_posts">Posts worden gedownload…</string>
|
||||||
|
<string name="logging_in">Aan het inloggen</string>
|
||||||
|
<string name="registering">Aan het registreren</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
<string name="username">Username</string>
|
<string name="username">Username</string>
|
||||||
<string name="password">Password</string>
|
<string name="password">Password</string>
|
||||||
<string name="confirm_password">Confirm Password</string>
|
<string name="confirm_password">Confirm Password</string>
|
||||||
<string name="confirm_password_hint">confirm password</string>
|
|
||||||
<string name="login_button">Login</string>
|
<string name="login_button">Login</string>
|
||||||
<string name="register">Register</string>
|
<string name="register">Register</string>
|
||||||
<string name="back_to_login">back to Login</string>
|
<string name="back_to_login">back to Login</string>
|
||||||
@@ -14,20 +13,25 @@
|
|||||||
<string name="login_error">Please fill in email and password</string>
|
<string name="login_error">Please fill in email and password</string>
|
||||||
<string name="password_match_error">Passwords do not match</string>
|
<string name="password_match_error">Passwords do not match</string>
|
||||||
<string name="register_error">Please fill in all the fields</string>
|
<string name="register_error">Please fill in all the fields</string>
|
||||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
|
||||||
<string name="hello_camera">Hello Camera</string>
|
|
||||||
<string name="logo_text">MyHyvesBookPlusTagram logo</string>
|
<string name="logo_text">MyHyvesBookPlusTagram logo</string>
|
||||||
<string name="logout_button">Logout</string>
|
<string name="logout_button">Logout</string>
|
||||||
<string name="profile_picture_button">Change Profile Picture</string>
|
<string name="profile_picture_button">Change Profile Picture</string>
|
||||||
<string name="profile_picture_description">profile picture</string>
|
<string name="profile_picture_description">profile picture</string>
|
||||||
<string name="change_psw_button">Change Password</string>
|
<string name="change_psw_button">Change Password</string>
|
||||||
<string name="please_wait">Please Wait</string>
|
<string name="please_wait">Please Wait</string>
|
||||||
<string name="niet_slecht">"\"Niet slecht.\"s "</string>
|
<string name="niet_slecht">\"\"Niet slecht.\"s: \"</string>
|
||||||
<string name="upload">Upload</string>
|
<string name="upload">Upload</string>
|
||||||
<string name="save">Save</string>
|
<string name="save">Save</string>
|
||||||
<string name="mail_successful">An e-mail was sent. Please follow its instructions.</string>
|
<string name="mail_successful">An e-mail was sent. Please follow its instructions.</string>
|
||||||
<string name="mail_failed">An error occurred. Please check internet connection.</string>
|
<string name="mail_failed">An error occurred. Please check internet connection.</string>
|
||||||
<string name="image_save_error">Saving image to storage failed. Please make sure there is space available on the device.</string>
|
<string name="image_save_error">Saving image to storage failed. Please make sure there is space available on the device.</string>
|
||||||
<string name="update_profile_pic_error">Updating the profile picture failed. Please check network connection.</string>
|
<string name="update_profile_pic_error">Updating the profile picture failed. Please check network connection.</string>
|
||||||
<string name="upload_profile_pic">Uploading profile picture...</string>
|
<string name="upload_profile_pic">Uploading profile picture…</string>
|
||||||
|
<string name="comment">Comment:</string>
|
||||||
|
<string name="cancel">Cancel</string>
|
||||||
|
<string name="comment_placeholder">Hello, I am a comment!</string>
|
||||||
|
<string name="refreshing">Refreshing…</string>
|
||||||
|
<string name="downloading_posts">Downloading posts…</string>
|
||||||
|
<string name="registering">Registering</string>
|
||||||
|
<string name="logging_in">Logging in</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
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