-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception #3830
DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception #3830
Conversation
* DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception
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.
Could you please add tests to make sure this change works as expected?
app/src/main/java/fr/free/nrw/commons/upload/mediaDetails/UploadMediaDetailFragment.java
Outdated
Show resolved
Hide resolved
@macgills I wanted that too, but the image view needs to support a zoom feature, does SimpleDraweeView supports that? |
@ashishkumar468 yes it does, see ZoomableActivity/ZoomableDraweeView |
Okay, thanks for letting me know, I will make the necessary changes |
…isten to transformation change end
@macgills Hi, I have made the necessary changes, please have a look |
}; | ||
|
||
public void setTransformationListener( |
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.
was this too long to fit on 1 line?
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 yes :P
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.
Ohh, sorry, do you mean trying the if, without the braces?
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.
no, I meant this line. you could shorten the parameter name but it is not necessary
Tested and works good, there is a small problem where dependent on how long you zoom the expand/collapse icon is in either state so there is potential that the first tap won't expand |
Hey @macgills could not follow this, can you elaborate this please, also pushed the other suggested changes |
Watch the up/down arrow in my captures Pre Zoom is in correct position Post Zoom is in correct position Post Zoom in incorrect position If I tap on the icon when it is in "incorrect position" it does not expand, it changes to correct position and then on my next click it expands |
@macgills Understood, thanks for the detailed explanation :) |
Hey @macgills Fixed the icon issue, please have a look again |
app/src/main/java/fr/free/nrw/commons/upload/mediaDetails/UploadMediaDetailFragment.java
Outdated
Show resolved
Hide resolved
* #3624 DateTimeFormat wrong - match pattern returned from servers (#3625) * Revert "Fixes: #3179 Make category search non case-sensitive (#3326)" (#3636) Simply lower casing the name of the category sent to the server doesn't result in the server doing a case insensitive category search. In fact, it reduces the category search space as only categories that has a lower case character is searched even if the search text contains upper case characters. The test case did not catch this issue as the first character of the title is case insensitive[1]. So, revert the changes done in commit afdeaae. See further disucssion in the issue thread of #3179 starting from [2]. [1]: https://www.mediawiki.org/wiki/Manual:Page_title [2]: #3179 (comment) * Bugfix/security exception (#3627) * Fixes #3626 * Check is file is actually created before writing to file, file picker android * Handle Security exception * Fixes #3436 and #2881: Media Detail design Overhaul (#3505) * ic_map_dark_24dp: map icon for white background * ic_info_outline_dark_24dp: info icon for dark background * MediaDetailFragment: update the spacer as per image aspect ratio * fragment_media_detail: design overhaul * fragment_media_detail: remove redundant background color statements * make requested changes * add dark mode support * minor ui tweak * white map icon in dark mode * make rquested changes * make requested changes to layout * fix misalignment of category list * subtle amendments * convert comments to javadocs * minor amendments * minor changes * add styles for media detail * Media detail fragment refactored * make suggested changes * minor name fix * fix the delete button border * Fixes #3639 (Fix Save State implementation of CheckBoxTriState ) (#3686) * Add #3723 and #3721 to 2.13 release, fix conflicts Conflicts were caused by merging #3723 before #3721 , so I just rolled both into one commit. * Fix NullPointer when clicking on image in MediaDetailFragment (#3730)… (#3739) * Update changelog.md * Versioning for v2.13 * Fixes #3705 (Crash when viewing pic I just uploaded) (#3782) * Fixes #3705 * Let the MediaDetailPager fragment know when the contributions have been updated * Handle NPE, null check on adapter in MediaDetailPagerFragment * Fixed BookmarkLocationsDao DB migration (#3793) * Fixes #3725 (#3795) * Downgraded okhttp version to support Api 19 devices * Handled null CompoundDrawable[2] in etTitle-> UploadMediaDetailsFragment (#3828) * DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception (#3830) * Fixes #3829 * DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception * removed unused imports, handled possible exceptions * Let Fresco handle the downsampling of image * invalidate in onTransformEnd * Expose an interface TransformationListener in ZoomableDraweeView to listen to transformation change end * removed photoView dependency * removed unused imports in ZoomableActivity * Bugfix, expand/collapse * changed functio name * Bugfix/p18 uploads (#3869) * updated gradle plugin version * BugFix #3856 * Do not use preference for deciding acceptable lat long for nearby uploads, instead save the corresponding location in the Contribution via UploadItem * Marshall contribution's hasInvalidLocation * reset un-related changes * Fixed test cases * Minor code formatting and docs * Fixes #3882 (#3883) * Make hasInvalidLocation non-null integer with default value 0 Co-authored-by: Ashish Kumar <ashish@Ashishs-MacBook-Air.local> * Fixes #3766, Added OPENSTREET attribution (#3889) * Fixes #3766 * Added OPENSTREET attribution in nearby * Added custom text attribution in Nearby * Deleted unused class CustomBorderTextView * review suggested changes * modified telemetry summary string * Versioning and changelog for v2.13.1 (#3908) * Update changelog.md * Versioning for v2.13.1 * Fixes #3914 (#3915) * Verify user login before setting upload count * fixed compile-time error * fix erros * delete emptied files * remove empty file CategoriesModel.java Co-authored-by: Seán Mac Gillicuddy <seantheappdev@gmail.com> Co-authored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com> Co-authored-by: Kshitij Bhardwaj <44129798+kbhardwaj123@users.noreply.github.com> Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com> Co-authored-by: Josephine Lim <josephinelim86@gmail.com> Co-authored-by: Ashish Kumar <ashish@Ashishs-MacBook-Air.local>
* commons-app#3624 DateTimeFormat wrong - match pattern returned from servers (commons-app#3625) * Revert "Fixes: commons-app#3179 Make category search non case-sensitive (commons-app#3326)" (commons-app#3636) Simply lower casing the name of the category sent to the server doesn't result in the server doing a case insensitive category search. In fact, it reduces the category search space as only categories that has a lower case character is searched even if the search text contains upper case characters. The test case did not catch this issue as the first character of the title is case insensitive[1]. So, revert the changes done in commit afdeaae. See further disucssion in the issue thread of commons-app#3179 starting from [2]. [1]: https://www.mediawiki.org/wiki/Manual:Page_title [2]: commons-app#3179 (comment) * Bugfix/security exception (commons-app#3627) * Fixes commons-app#3626 * Check is file is actually created before writing to file, file picker android * Handle Security exception * Fixes commons-app#3436 and commons-app#2881: Media Detail design Overhaul (commons-app#3505) * ic_map_dark_24dp: map icon for white background * ic_info_outline_dark_24dp: info icon for dark background * MediaDetailFragment: update the spacer as per image aspect ratio * fragment_media_detail: design overhaul * fragment_media_detail: remove redundant background color statements * make requested changes * add dark mode support * minor ui tweak * white map icon in dark mode * make rquested changes * make requested changes to layout * fix misalignment of category list * subtle amendments * convert comments to javadocs * minor amendments * minor changes * add styles for media detail * Media detail fragment refactored * make suggested changes * minor name fix * fix the delete button border * Fixes commons-app#3639 (Fix Save State implementation of CheckBoxTriState ) (commons-app#3686) * Add commons-app#3723 and commons-app#3721 to 2.13 release, fix conflicts Conflicts were caused by merging commons-app#3723 before commons-app#3721 , so I just rolled both into one commit. * Fix NullPointer when clicking on image in MediaDetailFragment (commons-app#3730)… (commons-app#3739) * Update changelog.md * Versioning for v2.13 * Fixes commons-app#3705 (Crash when viewing pic I just uploaded) (commons-app#3782) * Fixes commons-app#3705 * Let the MediaDetailPager fragment know when the contributions have been updated * Handle NPE, null check on adapter in MediaDetailPagerFragment * Fixed BookmarkLocationsDao DB migration (commons-app#3793) * Fixes commons-app#3725 (commons-app#3795) * Downgraded okhttp version to support Api 19 devices * Handled null CompoundDrawable[2] in etTitle-> UploadMediaDetailsFragment (commons-app#3828) * DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception (commons-app#3830) * Fixes commons-app#3829 * DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception * removed unused imports, handled possible exceptions * Let Fresco handle the downsampling of image * invalidate in onTransformEnd * Expose an interface TransformationListener in ZoomableDraweeView to listen to transformation change end * removed photoView dependency * removed unused imports in ZoomableActivity * Bugfix, expand/collapse * changed functio name * Bugfix/p18 uploads (commons-app#3869) * updated gradle plugin version * BugFix commons-app#3856 * Do not use preference for deciding acceptable lat long for nearby uploads, instead save the corresponding location in the Contribution via UploadItem * Marshall contribution's hasInvalidLocation * reset un-related changes * Fixed test cases * Minor code formatting and docs * Fixes commons-app#3882 (commons-app#3883) * Make hasInvalidLocation non-null integer with default value 0 Co-authored-by: Ashish Kumar <ashish@Ashishs-MacBook-Air.local> * Fixes commons-app#3766, Added OPENSTREET attribution (commons-app#3889) * Fixes commons-app#3766 * Added OPENSTREET attribution in nearby * Added custom text attribution in Nearby * Deleted unused class CustomBorderTextView * review suggested changes * modified telemetry summary string * Versioning and changelog for v2.13.1 (commons-app#3908) * Update changelog.md * Versioning for v2.13.1 * Fixes commons-app#3914 (commons-app#3915) * Verify user login before setting upload count * fixed compile-time error * fix erros * delete emptied files * remove empty file CategoriesModel.java Co-authored-by: Seán Mac Gillicuddy <seantheappdev@gmail.com> Co-authored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com> Co-authored-by: Kshitij Bhardwaj <44129798+kbhardwaj123@users.noreply.github.com> Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com> Co-authored-by: Josephine Lim <josephinelim86@gmail.com> Co-authored-by: Ashish Kumar <ashish@Ashishs-MacBook-Air.local>
* commons-app#3624 DateTimeFormat wrong - match pattern returned from servers (commons-app#3625) * Revert "Fixes: commons-app#3179 Make category search non case-sensitive (commons-app#3326)" (commons-app#3636) Simply lower casing the name of the category sent to the server doesn't result in the server doing a case insensitive category search. In fact, it reduces the category search space as only categories that has a lower case character is searched even if the search text contains upper case characters. The test case did not catch this issue as the first character of the title is case insensitive[1]. So, revert the changes done in commit afdeaae. See further disucssion in the issue thread of commons-app#3179 starting from [2]. [1]: https://www.mediawiki.org/wiki/Manual:Page_title [2]: commons-app#3179 (comment) * Bugfix/security exception (commons-app#3627) * Fixes commons-app#3626 * Check is file is actually created before writing to file, file picker android * Handle Security exception * Fixes commons-app#3436 and commons-app#2881: Media Detail design Overhaul (commons-app#3505) * ic_map_dark_24dp: map icon for white background * ic_info_outline_dark_24dp: info icon for dark background * MediaDetailFragment: update the spacer as per image aspect ratio * fragment_media_detail: design overhaul * fragment_media_detail: remove redundant background color statements * make requested changes * add dark mode support * minor ui tweak * white map icon in dark mode * make rquested changes * make requested changes to layout * fix misalignment of category list * subtle amendments * convert comments to javadocs * minor amendments * minor changes * add styles for media detail * Media detail fragment refactored * make suggested changes * minor name fix * fix the delete button border * Fixes commons-app#3639 (Fix Save State implementation of CheckBoxTriState ) (commons-app#3686) * Add commons-app#3723 and commons-app#3721 to 2.13 release, fix conflicts Conflicts were caused by merging commons-app#3723 before commons-app#3721 , so I just rolled both into one commit. * Fix NullPointer when clicking on image in MediaDetailFragment (commons-app#3730)… (commons-app#3739) * Update changelog.md * Versioning for v2.13 * Fixes commons-app#3705 (Crash when viewing pic I just uploaded) (commons-app#3782) * Fixes commons-app#3705 * Let the MediaDetailPager fragment know when the contributions have been updated * Handle NPE, null check on adapter in MediaDetailPagerFragment * Fixed BookmarkLocationsDao DB migration (commons-app#3793) * Fixes commons-app#3725 (commons-app#3795) * Downgraded okhttp version to support Api 19 devices * Handled null CompoundDrawable[2] in etTitle-> UploadMediaDetailsFragment (commons-app#3828) * DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception (commons-app#3830) * Fixes commons-app#3829 * DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception * removed unused imports, handled possible exceptions * Let Fresco handle the downsampling of image * invalidate in onTransformEnd * Expose an interface TransformationListener in ZoomableDraweeView to listen to transformation change end * removed photoView dependency * removed unused imports in ZoomableActivity * Bugfix, expand/collapse * changed functio name * Bugfix/p18 uploads (commons-app#3869) * updated gradle plugin version * BugFix commons-app#3856 * Do not use preference for deciding acceptable lat long for nearby uploads, instead save the corresponding location in the Contribution via UploadItem * Marshall contribution's hasInvalidLocation * reset un-related changes * Fixed test cases * Minor code formatting and docs * Fixes commons-app#3882 (commons-app#3883) * Make hasInvalidLocation non-null integer with default value 0 Co-authored-by: Ashish Kumar <ashish@Ashishs-MacBook-Air.local> * Fixes commons-app#3766, Added OPENSTREET attribution (commons-app#3889) * Fixes commons-app#3766 * Added OPENSTREET attribution in nearby * Added custom text attribution in Nearby * Deleted unused class CustomBorderTextView * review suggested changes * modified telemetry summary string * Versioning and changelog for v2.13.1 (commons-app#3908) * Update changelog.md * Versioning for v2.13.1 * Fixes commons-app#3914 (commons-app#3915) * Verify user login before setting upload count * fixed compile-time error * fix erros * delete emptied files * remove empty file CategoriesModel.java Co-authored-by: Seán Mac Gillicuddy <seantheappdev@gmail.com> Co-authored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com> Co-authored-by: Kshitij Bhardwaj <44129798+kbhardwaj123@users.noreply.github.com> Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com> Co-authored-by: Josephine Lim <josephinelim86@gmail.com> Co-authored-by: Ashish Kumar <ashish@Ashishs-MacBook-Air.local>
…andle OOM, Bitmap Too large exception (commons-app#3830) * Fixes commons-app#3829 * DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception * removed unused imports, handled possible exceptions * Let Fresco handle the downsampling of image * invalidate in onTransformEnd * Expose an interface TransformationListener in ZoomableDraweeView to listen to transformation change end * removed photoView dependency * removed unused imports in ZoomableActivity * Bugfix, expand/collapse * changed functio name
…andle OOM, Bitmap Too large exception (commons-app#3830) * Fixes commons-app#3829 * DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception * removed unused imports, handled possible exceptions * Let Fresco handle the downsampling of image * invalidate in onTransformEnd * Expose an interface TransformationListener in ZoomableDraweeView to listen to transformation change end * removed photoView dependency * removed unused imports in ZoomableActivity * Bugfix, expand/collapse * changed functio name
Description (required)
DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception
Fixes #3829
What changes did you make and why?
Downsampled bitmap shown in UploadMediaDetailsFragment
Tests performed (required)
Tested betaDebug on Api 27 & 29 by uploading a very large image