|
@ -457,12 +457,8 @@ public class UploadActivity extends BaseActivity { |
|
|
fileIcon = "archive.gif"; |
|
|
fileIcon = "archive.gif"; |
|
|
textWatcher.setFileExtension(".zip"); |
|
|
textWatcher.setFileExtension(".zip"); |
|
|
|
|
|
|
|
|
if (!hasModifiedFilename) { |
|
|
if (!hasModifiedFilename) |
|
|
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.FRANCE).format(new Date()); |
|
|
setZipUploadFilename(); |
|
|
String zipFilename = "mTHMMY_" + timeStamp + ".zip"; |
|
|
|
|
|
uploadFilename.setText(zipFilename); |
|
|
|
|
|
hasModifiedFilename = false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (int fileIndex = 0; fileIndex < data.getClipData().getItemCount(); ++fileIndex) { |
|
|
for (int fileIndex = 0; fileIndex < data.getClipData().getItemCount(); ++fileIndex) { |
|
|
Uri newFileUri = data.getClipData().getItemAt(fileIndex).getUri(); |
|
|
Uri newFileUri = data.getClipData().getItemAt(fileIndex).getUri(); |
|
@ -506,12 +502,8 @@ public class UploadActivity extends BaseActivity { |
|
|
fileIcon = "archive.gif"; |
|
|
fileIcon = "archive.gif"; |
|
|
textWatcher.setFileExtension(".zip"); |
|
|
textWatcher.setFileExtension(".zip"); |
|
|
|
|
|
|
|
|
if (!hasModifiedFilename) { |
|
|
if (!hasModifiedFilename) |
|
|
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.FRANCE).format(new Date()); |
|
|
setZipUploadFilename(); |
|
|
String zipFilename = "mTHMMY_" + timeStamp + ".zip"; |
|
|
|
|
|
uploadFilename.setText(zipFilename); |
|
|
|
|
|
hasModifiedFilename = false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
addFileViewToList(filename); |
|
|
addFileViewToList(filename); |
|
@ -538,12 +530,8 @@ public class UploadActivity extends BaseActivity { |
|
|
fileIcon = "archive.gif"; |
|
|
fileIcon = "archive.gif"; |
|
|
textWatcher.setFileExtension(".zip"); |
|
|
textWatcher.setFileExtension(".zip"); |
|
|
|
|
|
|
|
|
if (!hasModifiedFilename) { |
|
|
if (!hasModifiedFilename) |
|
|
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.FRANCE).format(new Date()); |
|
|
setZipUploadFilename(); |
|
|
String zipFilename = "mTHMMY_" + timeStamp + ".zip"; |
|
|
|
|
|
uploadFilename.setText(zipFilename); |
|
|
|
|
|
hasModifiedFilename = false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
UploadFile newFile = new UploadFile(true, TakePhoto.processResult(this, |
|
|
UploadFile newFile = new UploadFile(true, TakePhoto.processResult(this, |
|
@ -599,6 +587,13 @@ public class UploadActivity extends BaseActivity { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void setZipUploadFilename(){ |
|
|
|
|
|
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.FRANCE).format(new Date()); |
|
|
|
|
|
String zipFilename = "mTHMMY_" + timeStamp + ".zip"; |
|
|
|
|
|
uploadFilename.setText(zipFilename); |
|
|
|
|
|
hasModifiedFilename = false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Should only be called after making sure permissions are granted
|
|
|
// Should only be called after making sure permissions are granted
|
|
|
private void takePhoto() { |
|
|
private void takePhoto() { |
|
|
// Create the File where the photo should go
|
|
|
// Create the File where the photo should go
|
|
@ -768,8 +763,7 @@ public class UploadActivity extends BaseActivity { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|
|
public void onTextChanged(CharSequence s, int start, int before, int count) { } |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void afterTextChanged(Editable s) { |
|
|
public void afterTextChanged(Editable s) { |
|
@ -951,7 +945,7 @@ public class UploadActivity extends BaseActivity { |
|
|
if(foundUploadsCourse != null){ |
|
|
if(foundUploadsCourse != null){ |
|
|
uploadsCourse = foundUploadsCourse; |
|
|
uploadsCourse = foundUploadsCourse; |
|
|
semester = retrievedSemester; |
|
|
semester = retrievedSemester; |
|
|
Timber.i("Selected course: %s, semester: %s", uploadsCourse.getName(), semester); |
|
|
Timber.d("Selected course: %s, semester: %s", uploadsCourse.getName(), semester); |
|
|
titleDescriptionBuilderButton.setEnabled(true); |
|
|
titleDescriptionBuilderButton.setEnabled(true); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|