Much cleaner code. Known bugs seem to be fixed. Added extra progressDialog for posts downloading.
This commit is contained in:
@@ -24,27 +24,8 @@ import android.widget.RelativeLayout;
|
||||
import nl.myhyvesbookplus.tagram.controller.PostUploader;
|
||||
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{
|
||||
// TODO: Rename parameter arguments, choose names that match
|
||||
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 CameraPreview mPreview;
|
||||
private Bitmap mPhoto;
|
||||
@@ -54,33 +35,6 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
@@ -98,11 +52,12 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
||||
|
||||
mCameraLayout.addView(mPreview);
|
||||
|
||||
// Draw buttons over preview
|
||||
// Draw initial buttons over preview
|
||||
view.findViewById(R.id.picture_button).bringToFront();
|
||||
view.findViewById(R.id.switch_camera_button).bringToFront();
|
||||
filterButtons.bringToFront();
|
||||
|
||||
/* Upon pressing the switch camera facing button: */
|
||||
(view.findViewById(R.id.switch_camera_button)).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -119,6 +74,7 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
||||
}
|
||||
});
|
||||
|
||||
/* Upon pressing the take photo button: */
|
||||
(view.findViewById(R.id.picture_button)).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -141,6 +97,7 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
||||
}
|
||||
});
|
||||
|
||||
/* Upon pressing the upload button: */
|
||||
(view.findViewById(R.id.upload_button)).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -153,6 +110,7 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
||||
}
|
||||
});
|
||||
|
||||
/* Upon pressing the enter button on the virtual keyboard: */
|
||||
(view.findViewById(R.id.comment_submit)).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -184,6 +142,7 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
||||
}
|
||||
});
|
||||
|
||||
/* Upon pressing the cancel button: */
|
||||
(view.findViewById(R.id.comment_cancel)).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -209,6 +168,7 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
||||
}
|
||||
});
|
||||
|
||||
/* Upon pressing the left arrow filter change button: */
|
||||
(view.findViewById(R.id.filter_left)).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -227,6 +187,7 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
||||
}
|
||||
});
|
||||
|
||||
/* Upon pressing the right arrow filter change button: */
|
||||
(view.findViewById(R.id.filter_right)).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -256,30 +217,7 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
||||
.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0);
|
||||
}
|
||||
|
||||
// TODO: Rename method, update argument and hook method into UI event
|
||||
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;
|
||||
}
|
||||
|
||||
//TODO Niet helemaal zeker wat dit doet.
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
@@ -291,6 +229,11 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
||||
getActivity().findViewById(R.id.content).setPadding(dp,dp,dp,dp);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
Camera c = null;
|
||||
try {
|
||||
@@ -301,13 +244,27 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Switch between front facing camera and the back camera.
|
||||
*/
|
||||
public void switchFacing() {
|
||||
if (facing == Camera.CameraInfo.CAMERA_FACING_FRONT)
|
||||
facing = Camera.CameraInfo.CAMERA_FACING_BACK;
|
||||
else
|
||||
facing = Camera.CameraInfo.CAMERA_FACING_FRONT;
|
||||
// TODO
|
||||
// facing =
|
||||
// facing == Camera.CameraInfo.CAMERA_FACING_FRONT ?
|
||||
// Camera.CameraInfo.CAMERA_FACING_BACK :
|
||||
// Camera.CameraInfo.CAMERA_FACING_FRONT;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
FloatingActionButton upload = (FloatingActionButton) view.findViewById(R.id.upload_button);
|
||||
ImageButton picButton = (ImageButton) view.findViewById(R.id.picture_button);
|
||||
@@ -332,6 +289,8 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//TODO: Kan dit weg? super aanroepen enzo.
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
@@ -346,20 +305,4 @@ public class CameraFragment extends Fragment implements PostUploader.PostUploadL
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
||||
* @param passwordString the entered password
|
||||
*/
|
||||
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)
|
||||
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
|
||||
@@ -211,7 +211,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
||||
* @param password the entered 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)
|
||||
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
|
||||
@Override
|
||||
|
||||
@@ -20,9 +20,10 @@ import nl.myhyvesbookplus.tagram.controller.PostUploader;
|
||||
import nl.myhyvesbookplus.tagram.controller.ProfilePictureUploader;
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements
|
||||
CameraFragment.OnFragmentInteractionListener,
|
||||
ProfilePictureUploader.ProfilePictureUpdatedListener,
|
||||
DownloadClass.PostDownloadListener, PostUploader.PostUploadListener {
|
||||
DownloadClass.PostDownloadListener,
|
||||
PostUploader.PostUploadListener {
|
||||
|
||||
final static private String TAG = "MainScreen";
|
||||
|
||||
FirebaseAuth mAuth;
|
||||
@@ -89,11 +90,6 @@ public class MainActivity extends AppCompatActivity implements
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFragmentInteraction(Uri uri) {
|
||||
|
||||
}
|
||||
|
||||
public void logOutOnClick(View view) {
|
||||
FirebaseAuth.getInstance().signOut();
|
||||
goToLogin();
|
||||
@@ -107,7 +103,6 @@ public class MainActivity extends AppCompatActivity implements
|
||||
|
||||
@Override
|
||||
public void ProfilePictureUpdated(Boolean success) {
|
||||
Log.d(TAG, "ProfilePictureUpdated: Ja ik luister naar je!");
|
||||
FragmentManager man = getFragmentManager();
|
||||
ProfileFragment frag = (ProfileFragment) man.findFragmentById(R.id.content);
|
||||
FragmentTransaction transaction = man.beginTransaction();
|
||||
@@ -123,9 +118,12 @@ public class MainActivity extends AppCompatActivity implements
|
||||
FragmentManager fragmentManager = getFragmentManager();
|
||||
Fragment frag = fragmentManager.findFragmentById(R.id.content);
|
||||
|
||||
|
||||
|
||||
if (frag instanceof ProfileFragment) {
|
||||
((ProfileFragment) frag).startList();
|
||||
} else if (frag instanceof TimelineFragment) {
|
||||
((TimelineFragment) frag).progressDialog.dismiss();
|
||||
((TimelineFragment) frag).startList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class ProfileAdapter extends BaseAdapter {
|
||||
return newRowView;
|
||||
}
|
||||
|
||||
protected View findViews(View rowView) {
|
||||
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);
|
||||
|
||||
@@ -37,8 +37,9 @@ import static android.app.Activity.RESULT_OK;
|
||||
|
||||
public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||
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 ImageButton profilePicButton;
|
||||
protected StorageReference httpsReference;
|
||||
@@ -46,17 +47,19 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||
protected ImageView profilePicture;
|
||||
protected FirebaseUser user;
|
||||
protected File photoFile;
|
||||
|
||||
private ListView listView;
|
||||
private DownloadClass downloadClass;
|
||||
private View headerInflater;
|
||||
private View timeLineInflater;
|
||||
|
||||
ProgressDialog progressDialog;
|
||||
|
||||
/// Required empty public constructor ///
|
||||
|
||||
/* Required empty public constructor */
|
||||
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
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -75,6 +78,9 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||
bindOnClick();
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign the ListView and add the header to it.
|
||||
*/
|
||||
protected void findTimelineViews() {
|
||||
listView = (ListView) timeLineInflater.findViewById(R.id.list);
|
||||
listView.addHeaderView(headerInflater);
|
||||
@@ -88,8 +94,15 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||
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
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
@@ -123,11 +136,11 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||
/**
|
||||
* Called when a view has been clicked.
|
||||
*
|
||||
* @param v The view that was clicked.
|
||||
* @param view The view that was clicked.
|
||||
*/
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.profile_pic_button:
|
||||
profilePicOnClick();
|
||||
break;
|
||||
@@ -142,13 +155,13 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||
*/
|
||||
private void profilePicOnClick() {
|
||||
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) {
|
||||
/* Create the File where the photo should go */
|
||||
try {
|
||||
photoFile = createImageFile();
|
||||
} catch (IOException ex) {
|
||||
Toast.makeText(getActivity(), getString(R.string.image_save_error), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(getActivity(), getString(R.string.image_save_error),
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
if (photoFile != null) {
|
||||
Uri photoURI = FileProvider.getUriForFile(getActivity(),
|
||||
@@ -160,6 +173,9 @@ 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);
|
||||
@@ -167,6 +183,7 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||
|
||||
/**
|
||||
* 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 resultCode Code should be RESULT_OK to allow camera to proceed.
|
||||
* @param data The image data from the camera.
|
||||
@@ -180,8 +197,13 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
// Create an image file name
|
||||
String imageFileName = "JPEG_" + user.getUid();
|
||||
File storageDir = getActivity().getExternalFilesDir(Environment.DIRECTORY_PICTURES);
|
||||
return File.createTempFile(
|
||||
@@ -191,9 +213,6 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// TODO Make this function into its own class for modularity.
|
||||
/**
|
||||
* Performs password reset action.
|
||||
*/
|
||||
@@ -209,8 +228,6 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// TODO Add code here for when there is no currently active user.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package nl.myhyvesbookplus.tagram;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.app.ProgressDialog;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
@@ -9,27 +10,48 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.ListView;
|
||||
|
||||
|
||||
import android.widget.Toast;
|
||||
|
||||
import nl.myhyvesbookplus.tagram.controller.DownloadClass;
|
||||
|
||||
|
||||
public class TimelineFragment extends Fragment {
|
||||
|
||||
/* Some protected and private inits */
|
||||
private ListView listView;
|
||||
private DownloadClass downloadClass;
|
||||
ProgressDialog progressDialog;
|
||||
|
||||
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
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_timeline, container, false);
|
||||
listView = (ListView) view.findViewById(R.id.list);
|
||||
final SwipeRefreshLayout swipeView = (SwipeRefreshLayout) view.findViewById(R.id.swipe);
|
||||
View timeLineInflater = inflater.inflate(R.layout.fragment_timeline, container, false);
|
||||
listView = (ListView) timeLineInflater.findViewById(R.id.list);
|
||||
final SwipeRefreshLayout swipeView = (SwipeRefreshLayout) timeLineInflater.findViewById(R.id.swipe);
|
||||
|
||||
swipeView.setEnabled(false);
|
||||
downloadClass = new DownloadClass(getActivity());
|
||||
@@ -38,15 +60,16 @@ public class TimelineFragment extends Fragment {
|
||||
swipeView.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
downloadClass = new DownloadClass(getActivity());
|
||||
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);
|
||||
}
|
||||
}, 3000);
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -57,15 +80,15 @@ public class TimelineFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public void onScroll(AbsListView absListView, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||
if (firstVisibleItem == 0)
|
||||
swipeView.setEnabled(true);
|
||||
else
|
||||
swipeView.setEnabled(false);
|
||||
swipeView.setEnabled(firstVisibleItem == 0);
|
||||
}
|
||||
});
|
||||
return view;
|
||||
return timeLineInflater;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start display of the list; uses an adapter and listener in the main activity.
|
||||
*/
|
||||
public void startList() {
|
||||
TimeLineAdapter adapter = new TimeLineAdapter(getActivity(), downloadClass.getmList());
|
||||
listView.setAdapter(adapter);
|
||||
|
||||
@@ -11,15 +11,12 @@
|
||||
<string name="title_home">Tijdlijn</string>
|
||||
<string name="title_notifications">Profiel</string>
|
||||
<string name="username">Gebruikersnaam</string>
|
||||
<string name="confirm_password_hint">bevestig wachtwoord</string>
|
||||
<string name="logo_text">MyHyvesBookPlusTagram logo</string>
|
||||
<string name="logout_button">Uitloggen</string>
|
||||
<string name="profile_picture_button">Wijzig Profiel Foto</string>
|
||||
<string name="profile_picture_description">profiel foto</string>
|
||||
<string name="change_psw_button">Wachtwoord wijzigen</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="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>
|
||||
@@ -30,9 +27,12 @@
|
||||
<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="upload_profile_pic">Profielfoto aan het uploaden…</string>
|
||||
<string name="mail_success">An e-mail was sent, please follow its instructions.</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>
|
||||
@@ -6,7 +6,6 @@
|
||||
<string name="username">Username</string>
|
||||
<string name="password">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="register">Register</string>
|
||||
<string name="back_to_login">back to Login</string>
|
||||
@@ -14,8 +13,6 @@
|
||||
<string name="login_error">Please fill in email and password</string>
|
||||
<string name="password_match_error">Passwords do not match</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="logout_button">Logout</string>
|
||||
<string name="profile_picture_button">Change Profile Picture</string>
|
||||
@@ -33,5 +30,8 @@
|
||||
<string name="comment">Comment:</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="comment_placeholder">Hello, I am a comment!</string>
|
||||
<string name="mail_success">Er is een e-mail verzonden. Volg a.u.b. de instructies.</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>
|
||||
|
||||
Reference in New Issue
Block a user