Commit graph

25 commits

Author SHA1 Message Date
neslihanturan
d29aa2e2e5 Fix urgent crashes A and E (#1749)
* Create utility class for contribution process

* implement method to save five from given URİ

* Add file utilities for directory checks

* Add ContributionUtils for saving file during upload

* Change method call acordingly with handleImagePicked() method

* Call method to save file temproarily when a photo to upload is chosen from contributions list.

* Call method to save file temproarily when a photo to upload is chosen from nearby list and map

* Arrange method call

* Write a method to save file temporarily during upload process. It will save the file to a internal path and it will be deleted by another method after upload process is done.

* Add a method to save a file to a given path from a content provider Uri

* On openAssetFileDescriptor method, use URi from temporarily saved file, instead of Contributions.getLocalUri which was Uri from content provider

* Edit uploadContribution method so that it will use FileInputStream from temporarily saved file, insdeat of the Uri from content provider.

* Make it work

* Code cleanup

* Add directory cleaner method

* Call temp directory cleaner method at the end of uplpoad process

* Use FileInputStream insted

* Add directory cleaner method

* Add file removal method

* Use external directory instead

* Make destination file name flexible

* Make it work with share action coming from another activity

* Make it work for Multiple hare Activity

* Code cleanup

* Solve camera issue

* Fix camera crash

* Cleanup

* Revert change of commenting out posibly useles code, because I am not sure if it is useless or not. Requires discussion

* Use timestamp in temoorary file names, so that we wont never create same file and access old file reference. It was a weird problem though

* Code cleanup

* Add nullable annotation to handleImagePicked method uri parameter

* Add Nullable anotation to method

* Code cleanup

* Bugfix: use uri.getPath() instead uri.toString

* Remove unecesarry file saving operation, which was added accidentally

* Fix travis fail

* Remove temp file if upload gets failed and file is still there

* Code cleanup:Remove unused parameters from removeTempFile method

* Empty temp directory on app create, in case some of files are still there

* Add null check to array to prevent NPE on first run

* Fix multiple uploads bug

* Remove file if upload is succeed

* Add external storage utility methods

* Check external file permission before saving files temporarily

* finish activity if permission is not granted

* Add log lines

* Remove files even if user decides to go back without sharing

* Add easy null check

* Change storage permission settings in singe upload fragment too

* Finish app if permission is not granted

* Code optimisation

* Remove temp file if upload process never is finalised on activity stop

* Bugfix maybe contribution is never created

* Fix travis build
2018-08-02 06:24:08 +10:00
albendz
7b5b9169db Fix preview crash on local files during upload (#1696)
* Try to get the localized version of the wikipedia article before defaulting to the English version.

Tested with Spanish on physical Android device.

Other notes:
Difficulties building with gradle due to dexcount plugin: https://github.com/KeepSafe/dexcount-gradle-plugin/issues/234. In testing, disabled the plugin.

* Update article fetch to not include unnecessary SERVICE line

* Add checks for local file, check for string length
2018-07-22 17:43:33 +03:00
maskara
e1afa6081e Refactor usage of dagger application with fixed dagger application 2018-01-13 16:16:47 +05:30
Xiang Fan
7118234ebf MediaWikiImageView: add javadoc 2018-01-01 16:10:48 +07:00
Paul Hawke
02b5b9b680 Merge branch 'master' into dependency-injection 2017-11-24 22:30:08 -06:00
Joe Rattazzi
b07064def3 Correcting some easy Codacy issues 2017-10-14 17:46:47 -05:00
Paul Hawke
9c0cbe7ad5 Further reduce code calling back to the CommonsApplication by pulling out a SessionManager to manage our current account. 2017-09-09 14:08:40 -05:00
Paul Hawke
cfe17cafa6 Moved other singletons over to being managed by Dagger 2017-08-26 08:57:15 -05:00
Paul Hawke
647cc166ef @Inject the MediaWikiApi where needed to reduce coupling between classes. 2017-08-26 08:56:15 -05:00
Paul Hawke
ed1ae98d8e Finished removing coupling between classes around the getInstance() method. 2017-08-26 08:56:15 -05:00
Paul Hawke
8fe2816ca9 First baby steps into the world of dependency injection using Dagger. 2017-08-26 08:56:14 -05:00
Dmytro Vodnik
397b4fa586 fix for #708 2017-07-13 12:23:15 +03:00
Dmitry Brant
5ab060567a Fix vector placeholder images in API <21. 2017-05-26 17:37:18 -04:00
Dmitry Brant
39e24b1863 Don't put local URI into thumbnail cache. 2017-05-20 15:32:41 +02:00
Dmitry Brant
5fc684fcc5 Fix showing local image if fetching thumbnail fails. 2017-05-20 13:41:23 +02:00
Dmitry Brant
38e7cad345 Final touch-ups to improved image loading. 2017-05-19 17:19:10 +02:00
Dmitry Brant
85b15cd1c1 Further improve image loading, and remove unused code. 2017-05-19 15:57:25 +02:00
Dmitry Brant
a3f3ee7fdb Merge remote-tracking branch 'upstream/master' 2017-05-19 15:14:29 +02:00
Dmitry Brant
bb49fb9801 Clean up image loading code, and switch to using Fresco. 2017-05-19 15:08:29 +02:00
Adam Jones
8e3e8982c7 Android correctness lint issues 2017-05-15 16:45:46 +01:00
veyndan
c1bcd921e3 Add missing @Override annotations 2017-02-26 02:38:05 +00:00
Josephine Lim
9ef32612c1 Merge pull request #315 from anirudh24seven/optimize-imports
Reorganize imports across the project
2016-10-31 14:32:43 +13:00
Anirudh S
1a11e0afc0 Reorganize imports across the project
Remove unwanted imports and sort import statements by running Android
Studio's 'Optimize Imports' feature in all source files.
2016-10-30 23:14:07 +05:30
Anirudh S
94e8c991ee Modified extra whitespace lines in source code
Code is much easier to read if there isn't too much of a gap between
lines. Primarily converted multi-line gaps into single line gaps.
2016-10-30 23:01:44 +05:30
Yusuke Matsubara
b4231bbfdc Merge "commons" into the project root directory 2016-07-02 16:48:57 +09:00
Renamed from commons/app/src/main/java/fr/free/nrw/commons/MediaWikiImageView.java (Browse further)