Neated up the code.
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
@@ -60,8 +60,7 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
|||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
user = FirebaseAuth.getInstance().getCurrentUser();
|
user = FirebaseAuth.getInstance().getCurrentUser();
|
||||||
loadPersonalPosts();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assigns all views and buttons.
|
* Assigns all views and buttons.
|
||||||
@@ -160,14 +159,8 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
|
|||||||
|
|
||||||
public void startList() {
|
public void startList() {
|
||||||
ProfileAdapter adapter = new ProfileAdapter(getActivity(), downloadClass.getmList());
|
ProfileAdapter adapter = new ProfileAdapter(getActivity(), downloadClass.getmList());
|
||||||
if (listView != null) {
|
|
||||||
listView.setAdapter(adapter);
|
listView.setAdapter(adapter);
|
||||||
} else {
|
}
|
||||||
Log.d("Jemoeder", "startList: Halloooooooo");
|
|
||||||
}
|
|
||||||
|
|
||||||
// listView.addHeaderView(adapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
@@ -180,25 +173,20 @@ 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadPersonalPosts() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private File createImageFile() throws IOException {
|
private File createImageFile() throws IOException {
|
||||||
// Create an image file name
|
// 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 */
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user