-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pictures can be upload directly clicking them from the device's camera. #2097
Conversation
Hi @SD1998 , thank you for opening this again, using a new branch for a new feature is always the best approach 👍 I've seen that the commit of the android-library (7c7cad7) is not the proper one, please update it to the latest one (0e7fd8e). From your Android app directory:
|
@davigonz Is it the latest one now? (I have just changed it) |
@SD1998 Yes, the library change has just disappeared from the Files changed tab, thanks 👏 |
@davigonz Has the QA started? |
res/values/strings.xml
Outdated
@@ -82,6 +82,10 @@ | |||
<string name="file_list_file">file</string> | |||
<string name="file_list_files">files</string> | |||
<string name="filedetails_select_file">Tap on a file to display additional information.</string> | |||
<string name="upload_owncloud"> Upload to OwnCloud </string> | |||
<string name="upload_bottom_sheet_displayed"> Upload Bottom Sheet Displayed </string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This resource is not being used, please delete it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I am using upload_owncloud
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant upload_bottom_sheet_displayed, which you've already deleted.
There's still some space at the beginning and end of Upload to ownCloud in upload_owncloud resource. Do you really need it? If so, please use margin or padding in the xml layout.
res/values/strings.xml
Outdated
@@ -82,6 +82,10 @@ | |||
<string name="file_list_file">file</string> | |||
<string name="file_list_files">files</string> | |||
<string name="filedetails_select_file">Tap on a file to display additional information.</string> | |||
<string name="upload_owncloud"> Upload to OwnCloud </string> | |||
<string name="upload_bottom_sheet_displayed"> Upload Bottom Sheet Displayed </string> | |||
<string name="upload_bottom_sheet_collapsed"> Upload Bottom Sheet Collapsed </string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, delete it
res/values/strings.xml
Outdated
@@ -176,6 +180,7 @@ | |||
<string name="foreign_files_remote_text">"Remote: %1$s"</string> | |||
<string name="upload_query_move_foreign_files">There is not enough space to copy the selected files into the %1$s folder. Would you like to move them instead? </string> | |||
<string name="pass_code_enter_pass_code">Please insert your passcode</string> | |||
<string name="bottom_sheets_layout_behaviour"> android.support.design.widget.BottomSheetBehavior </string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used, can be deleted
res/values/strings.xml
Outdated
@@ -205,6 +210,9 @@ | |||
<string name="media_rewind_description">Rewind button</string> | |||
<string name="media_play_pause_description">Play or pause button</string> | |||
<string name="media_forward_description">Fast forward button</string> | |||
<string name="button_text_camera"> Camera </string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using spaces before and after the value of this resource? If you want to add a margin or padding, please include it in the xml file instead of here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you using button_text_camera resource? Cannot find its use.
res/values/strings.xml
Outdated
@@ -205,6 +210,9 @@ | |||
<string name="media_rewind_description">Rewind button</string> | |||
<string name="media_play_pause_description">Play or pause button</string> | |||
<string name="media_forward_description">Fast forward button</string> | |||
<string name="button_text_camera"> Camera </string> | |||
<string name="upload_from_camera_title"> Upload From Camera </string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, there are several ones
res/values/strings.xml
Outdated
@@ -205,6 +210,9 @@ | |||
<string name="media_rewind_description">Rewind button</string> | |||
<string name="media_play_pause_description">Play or pause button</string> | |||
<string name="media_forward_description">Fast forward button</string> | |||
<string name="button_text_camera"> Camera </string> | |||
<string name="upload_from_camera_title"> Upload From Camera </string> | |||
<string name="capture_button_text"> Capture </string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capture_button_text seems not to be used either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I just saw that. I used it when I was not using bottom sheets and instead using a FAB.
|
||
SharedPreferences.Editor appPreferencesEditor = PreferenceManager | ||
.getDefaultSharedPreferences(getApplicationContext()).edit(); | ||
|
||
|
||
if (mRadioBtnMoveFiles.isChecked()){ | ||
if(requestCode == FileDisplayActivity.REQUEST_CODE__UPLOAD_FROM_CAMERA){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are using the condition if(requestCode == FileDisplayActivity.REQUEST_CODE__UPLOAD_FROM_CAMERA){
twice here to set several params, is not possible to use just one and unify all the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I have done that
@davigonz I will work on this I remember using some of the string resources in Log_OC.d() I will check them again. If I am not using them then I will remove them. |
@SD1998 What I meant is something easier, like this: |
@davigonz Ok I will work on this. |
7d1fd1f
to
d481dd1
Compare
@davigonz Are there any more changes required? |
d481dd1
to
ebad0fc
Compare
@SD1998 thanks for applying the changes, have a look at the next three comments: |
I have done all the changes. |
8e1800e
to
27ef6a1
Compare
Starting QA here... |
IMPROVEMENT (1) [DONE] When a pic is taken, the name it is upload with is the epoch time of the moment. This is not incorrect, of course, but maybe is more clear to set the calendar date as filename, for example: what do you think? |
@jesmrec I think epoch time will be better as it is possible to take two picture in a minute and upload them. Thus resulting in naming conflicts. For ex. If two pictures are taken at 11:59 then both of them will be named 2018-02-02-1159.JPG. |
27ef6a1
to
72307ee
Compare
it can be set always the second fraction, i mean |
BUG (2) [FIXED] Steps to reproduce:
Current: Option has switched from copy to move Tested with Nexus5 v6 |
@SD1998 Even with the layout you propose, If we use PEEK_HEIGHT_AUTO, I think we would continue having the problem described in #2097 (comment) and if we do not use PEEK_HEIGHT_AUTO, it would reappear the problem described in #2097 (comment). There's likely to be a common solution to show all the options both in landscape and portrait modes. The problem with bottom sheets in landscape mode seems to be known, have a look at https://stackoverflow.com/questions/41591733/bottom-sheet-landscape-issue , it may be useful for you. |
@SD1998 do you think is feasible to fix that? |
@@ -100,6 +104,11 @@ | |||
private OCFile mFile = null; | |||
private FileListListAdapter mAdapter; | |||
|
|||
private LinearLayout uploadFilesLinearLayout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These four variables do not need to be declared globally, you can declare it directly in registerFabUploadListeners method, where are going to be used.
}); | ||
uploadToTextView.setText(String.format(getResources().getString(R.string.upload_to),getResources().getString(R.string.app_name))); | ||
uploadBottomSheetBehavior = BottomSheetBehavior.from((View) uploadBottomSheet.getParent()); | ||
uploadBottomSheetBehavior.setPeekHeight(-1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've managed to fix #2097 (comment) and #2097 (comment) following the next steps:
- Delete line
uploadBottomSheetBehavior.setPeekHeight(-1);
- Include the next code:
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
uploadBottomSheetBehavior.setPeekHeight(uploadBottomSheet.getMeasuredHeight());
}
});
With this code, we wait till the dialog is shown, measure its height and use it to set the height of the bottom sheet. I've tested it with different devices (portrait & landscape) and seems to be working properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davigonz Thanks for the help. I trying to find the value of the height of bottom sheet using ViewTreeObserver class but it did not work out. I will implement the changes.
Hi @SD1998, I've managed to fix the problem with the bottom sheet height to give you a hand, please have a look at the changes I requested above. Besides, please update the camera icon for xxxhdpi as I described in #2097 (comment). After that, @jesmrec will perform the last tests, we will merge and continue with other interesting features. Thanks |
c00baa6
to
7aa392d
Compare
@davigonz I have made all the changes and added the xxxhdpi icon |
uploadBottomSheetBehavior = BottomSheetBehavior.from((View) uploadBottomSheet.getParent()); | ||
uploadBottomSheetBehavior.setPeekHeight(-1); | ||
final BottomSheetBehavior uploadBottomSheetBehavior = BottomSheetBehavior.from((View) uploadBottomSheet.getParent()); | ||
uploadBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you don't need this line, the method below that would be enough to fix the problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davigonz Yes I forgot to remove it. Sorry I will remove it now.
The icon size is correct and now the bottom sheet appears and vanish correctly (checked with three devices in different screen sizes). Finally, we can approve this @SD1998 please rebase first, then the branch will be merged |
872cf00
to
f13d2aa
Compare
@davigonz I have done the rebase. |
Fix to Issue #2027
BUGS & IMPROVEMENTS