Compare commits
6 Commits
marijn-fix
...
paul-zoom
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c27584dd2 | ||
|
|
4754c231fe | ||
|
|
250ee529fe | ||
|
|
69bbfeaacd | ||
|
|
1f4fa4c768 | ||
|
|
dc7690e183 |
@@ -246,15 +246,9 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
|||||||
* Switch between front facing camera and the back camera.
|
* Switch between front facing camera and the back camera.
|
||||||
*/
|
*/
|
||||||
public void switchFacing() {
|
public void switchFacing() {
|
||||||
if (facing == Camera.CameraInfo.CAMERA_FACING_FRONT)
|
facing = facing == Camera.CameraInfo.CAMERA_FACING_FRONT ?
|
||||||
facing = Camera.CameraInfo.CAMERA_FACING_BACK;
|
Camera.CameraInfo.CAMERA_FACING_BACK :
|
||||||
else
|
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ public class PicturePreview extends SurfaceView implements SurfaceHolder.Callbac
|
|||||||
|
|
||||||
filter = new ColorMatrixColorFilter(cm);
|
filter = new ColorMatrixColorFilter(cm);
|
||||||
paint.setColorFilter(filter);
|
paint.setColorFilter(filter);
|
||||||
|
saveCanvas.setBitmap(filterPicture);
|
||||||
saveCanvas.drawBitmap(rotate(picture, rotate), 0, 0, paint);
|
saveCanvas.drawBitmap(rotate(picture, rotate), 0, 0, paint);
|
||||||
canvas.drawBitmap(rotate(picture, rotate), 0, 0, paint);
|
canvas.drawBitmap(rotate(picture, rotate), 0, 0, paint);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -8,10 +8,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.animation.DecelerateInterpolator;
|
import android.view.animation.DecelerateInterpolator;
|
||||||
import android.widget.BaseAdapter;
|
import android.widget.BaseAdapter;
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.ImageButton;
|
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.ListView;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
@@ -28,20 +25,21 @@ import java.util.ArrayList;
|
|||||||
import nl.myhyvesbookplus.tagram.model.UriPost;
|
import nl.myhyvesbookplus.tagram.model.UriPost;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by niels on 27-6-17.
|
* Class which creates views for the profile-page timeline. This is done with a ListView.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ProfileAdapter extends BaseAdapter {
|
public class ProfileAdapter extends BaseAdapter {
|
||||||
|
|
||||||
private static final String TAG = "ProfileAdapter";
|
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private ArrayList<UriPost> mData;
|
private ArrayList<UriPost> mData;
|
||||||
private TextView comment;
|
private TextView comment;
|
||||||
private TextView nietSlechts;
|
private TextView nietSlechts;
|
||||||
private ImageView photo;
|
private ImageView photo;
|
||||||
|
|
||||||
|
/* Hold a reference to the current animator, so that it can be canceled mid-way. */
|
||||||
private Animator mCurrentAnimator;
|
private Animator mCurrentAnimator;
|
||||||
|
|
||||||
|
/* ProfileAdapter constructor */
|
||||||
ProfileAdapter(Context context, ArrayList<UriPost> data) {
|
ProfileAdapter(Context context, ArrayList<UriPost> data) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
@@ -63,6 +61,13 @@ public class ProfileAdapter extends BaseAdapter {
|
|||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initiate a new view to be part of the ListView.
|
||||||
|
* @param position The position at which the view should start.
|
||||||
|
* @param convertView The viewconverter.
|
||||||
|
* @param parent The parent of the view.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
View rowView = mInflater.inflate(R.layout.list_item_timeline_profile, parent, false);
|
View rowView = mInflater.inflate(R.layout.list_item_timeline_profile, parent, false);
|
||||||
@@ -85,6 +90,11 @@ public class ProfileAdapter extends BaseAdapter {
|
|||||||
return newRowView;
|
return newRowView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find all views from within the row.
|
||||||
|
* @param rowView The row from which views must be found.
|
||||||
|
* @return The rowView which contains the necessary views.
|
||||||
|
*/
|
||||||
private View findViews(View rowView) {
|
private View findViews(View rowView) {
|
||||||
comment = (TextView) rowView.findViewById(R.id.comment_timeline_profile);
|
comment = (TextView) rowView.findViewById(R.id.comment_timeline_profile);
|
||||||
nietSlechts = (TextView) rowView.findViewById(R.id.niet_slecht_count_profile);
|
nietSlechts = (TextView) rowView.findViewById(R.id.niet_slecht_count_profile);
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ import nl.myhyvesbookplus.tagram.controller.ProfilePictureUploader;
|
|||||||
|
|
||||||
import static android.app.Activity.RESULT_OK;
|
import static android.app.Activity.RESULT_OK;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Profilefragment which holds the personal info of the user.
|
||||||
|
* Makes use of ProfileAdapter in order to load in the items for ListView.
|
||||||
|
*/
|
||||||
|
|
||||||
public class ProfileFragment extends Fragment implements View.OnClickListener {
|
public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||||
static final int REQUEST_TAKE_PHOTO = 1;
|
static final int REQUEST_TAKE_PHOTO = 1;
|
||||||
ProgressDialog progressDialog;
|
ProgressDialog progressDialog;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import java.util.ArrayList;
|
|||||||
import nl.myhyvesbookplus.tagram.model.UriPost;
|
import nl.myhyvesbookplus.tagram.model.UriPost;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by marijnjansen on 26/06/2017.
|
* Class which creates views for the home-page timeline. This is done with a ListView.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class TimeLineAdapter extends BaseAdapter implements AdapterView.OnItemClickListener {
|
public class TimeLineAdapter extends BaseAdapter implements AdapterView.OnItemClickListener {
|
||||||
@@ -42,8 +42,11 @@ public class TimeLineAdapter extends BaseAdapter implements AdapterView.OnItemCl
|
|||||||
private Context mContext;
|
private Context mContext;
|
||||||
private ArrayList<UriPost> mData;
|
private ArrayList<UriPost> mData;
|
||||||
private DatabaseReference mRef;
|
private DatabaseReference mRef;
|
||||||
|
|
||||||
|
/* Hold a reference to the current animator, so that it can be canceled mid-way. */
|
||||||
private Animator mCurrentAnimator;
|
private Animator mCurrentAnimator;
|
||||||
|
|
||||||
|
/* TimeLineAdapter constructor */
|
||||||
TimeLineAdapter(Context context, ArrayList<UriPost> data) {
|
TimeLineAdapter(Context context, ArrayList<UriPost> data) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
@@ -66,11 +69,17 @@ public class TimeLineAdapter extends BaseAdapter implements AdapterView.OnItemCl
|
|||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initiate a new view to be part of the ListView.
|
||||||
|
* @param position The position at which the view should start.
|
||||||
|
* @param convertView The viewconverter.
|
||||||
|
* @param parent The parent of the view.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||||
View rowView = mInflater.inflate(R.layout.list_item_timeline, parent, false);
|
View rowView = mInflater.inflate(R.layout.list_item_timeline, parent, false);
|
||||||
|
|
||||||
TextView userName = (TextView) rowView.findViewById(R.id.username_timeline);
|
|
||||||
TextView comment = (TextView) rowView.findViewById(R.id.comment_timeline);
|
TextView comment = (TextView) rowView.findViewById(R.id.comment_timeline);
|
||||||
final TextView nietSlechts = (TextView) rowView.findViewById(R.id.niet_slecht_count);
|
final TextView nietSlechts = (TextView) rowView.findViewById(R.id.niet_slecht_count);
|
||||||
TextView dateTime = (TextView) rowView.findViewById(R.id.timeline_date);
|
TextView dateTime = (TextView) rowView.findViewById(R.id.timeline_date);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package nl.myhyvesbookplus.tagram;
|
package nl.myhyvesbookplus.tagram;
|
||||||
|
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
|
|||||||
Reference in New Issue
Block a user