Commit graph

359 commits

Author SHA1 Message Date
Vivek Maskara
accb880256 Fix image not loading issue in peer review (#2902)
* Fix image loading issue in peer review

* With more test cases
2019-04-20 10:42:09 +03:00
Vivek Maskara
dcbf076965
Update master with backend overhaul branch (#2829)
* Beginnings of integration with Wikipedia client library. (#2642)

* Remove remaining unnecessary API version check.

* Roll up sleeves.

* Add and integrate the beginnings of app adapter.

* Remove vestigial event logging logic.

Event logging is no longer used in this app.

* Beginnings: remove StringUtils and associated redundancies.

* Remove redundant capitalize() method.

* Remove redundant urlEncode() method.

* Remove redundant (and incomplete) language lists.

* Remove redundant usages of SimpleDateFormat.

* Remove redundant json type adapter.

* Remove redundant MW error model classes.

* Rip out redundant MW model classes.

* Pass SessionManager into AppAdapter instead of injecting.

* Wire up more of the AppAdapter.

* Remove redundant Gson initialization and type adapters.

* Rip out PageTitle.

This was being used in some slightly incorrect/unexpected ways.

* Don't need static WikiSite.

* Bump data client library version

* Bump library version and fix build

* Fix tests

* Fix build

* Fix media of the day

* With fixes in recently modified APIs
2019-04-02 08:35:22 +05:30
Adam Jones
23c23cc9fc Use JSON version 2 API for MwQueryResponse responses (#2816) 2019-04-01 23:33:30 +05:30
Vivek Maskara
0bf63f50b3 Replace remaining AsyncTask with RxAndroid (#2681) 2019-03-28 21:10:47 +00:00
Vivek Maskara
c45b945526 Use JSON APIs for explore (#2731)
* Use JSON APIs for explore

* With tests

* Use JSON APIs for explore

* With tests

* BugFix #2731 (#4)

* Increased sdk version to 23

* with more robust tests

* Fix crashes and other reported issues

* Add javadocs

* Use common method for search and categories

* Add javadocs
2019-03-26 18:02:58 +05:30
Dmitry Brant
adf23c257f Improve extremely inefficient darkness-checking logic. (#2639)
* Improve extremely inefficient darkness-checking logic.

* Use ExifInterface from AndroidX instead of android.media.

* Fix false-positive detekt check.

* Fix false-positive detekt check.
2019-03-19 20:23:36 +05:30
Vanshika Arora
3417d713d2 Fixes #97: Added metadata reader for reading exif data (#2581)
* initial commit

* initial commit

* reading 3 exif directories

* minor changes

* fixed unit tests

* reviwied requested changes

* minor changes

* minor changes
2019-03-19 19:08:42 +05:30
Adam Jones
d719a4a9d4 Add tests for PageTitle (#2624) 2019-03-17 11:22:37 +05:30
Adam Jones
561f9ea23c Add more tests to StringSortingUtils (#2622)
* Add more tests to StringSortingUtils

* Add test with empty strings to improve coverage
2019-03-16 23:21:23 +05:30
Vivek Maskara
7cb87f3cab Consolidate shared prefs to a single store (#2613)
* Consolidate shared prefs to a single store
* Fix achievements activity
* Fix store usage
2019-03-16 13:56:56 +00:00
Vivek Maskara
57e685cf6c Fix #2593: Migrate to androidX (#2594)
* Update dependencies and migrate to androidX
* Make gradle properties tidy
2019-03-16 11:22:37 +00:00
Vanshika Arora
6389b35b49 replaced icafe with metadata extractor (#2546)
* replaced icafe with metadata extractor

* replaced icafe with metadata extractor

* removed icafe from gradle

* removed icafe from gradle

* Revert: travis commented code

* Use original content URI

* merged pr

* commit after merge

* modified unit tests
2019-03-12 00:20:47 +05:30
Ronan Brigdale
480c05b2f3 Fix Lint Issues #171: Fix numerous errors/warnings (#2537) 2019-03-10 23:55:35 +05:30
Ashish Kumar
1b86726364 Bugfix #2476 (#2527)
updated database version and added associated tests
2019-03-01 06:14:36 +13:00
Ashish Kumar
64eae8be82 Bug fix issue #2476 (#2526)
* Added wikidataEntityID in all db versions, handled db.execSql via method runQuery
2019-02-28 05:55:16 +13:00
Vanshika Arora
3a822d3c30 Added IPTC reader (#2383)
* graddle changes

* readfbmd class

* jar files

* added icafe

* gradle changes

* ReadFBMD

* recent commit

* commit changes

* commit changes

* fixed code quality issues

* optimised imports

* changes for  reviews

* not instantiating class

* removed irrelevant code

* added documentation

* modified test cases

* commit changes

* modified variable

* modified variable

* javadoc

* test changes

* removed .log file

* Show warning dialog for FBMD
2019-02-24 23:16:22 +05:30
Ashish Kumar
9c6e9bd017 updated test cases to support db upgrade in #2476 (#2497)
* updated test cases to support db upgrade in #2476

* fixed errors
2019-02-21 00:33:31 +05:30
Vivek Maskara
2bc0d41748 Fix date time issue for google photos (#2438) 2019-02-13 00:17:06 +13:00
Vivek Maskara
5a6402cd07 Make nearby query faster (#2419)
* Make nearby query faster

* Fix query
2019-02-10 20:53:02 +05:30
Vivek Maskara
f12837650a Use JSON SPARQL query for fetching nearby places (#2398)
* Use JSON response for nearby places

* Move okhttp calls to a different class

* wip

* Fetch picture of the day using JSON API

* Search images using JSON APIs

* tests

* Fix injection based on code review comments
2019-02-06 10:40:30 +05:30
Vivek Maskara
52ab39381e Add module for file picker for camera and gallery uploads (#2375)
* Use easy image for image picker

* Do not use harcoded mime type

* Use uploadable file for image uploads

* Add picker files in filepicker module

* Remove redundant checks for file

* Make usage of file extensions consistent

* Add javadocs

* Fix tests

* Enable image upload using bookmark activity

* Fix multiple uploads

* Fix external image uploads

* Fix chooser intents

* Fix image quality checks

* Segregate internal and external upload intents

* Invoke all error messages from one place

* Minor changes

* Fix tests

* Add image processing service tests
2019-02-03 22:40:31 +02:00
Shubham Pinjwani
9451b00a15 Show bookmarked nearby locations differently (#2059) (#2349)
* Show bookmarked nearby locations differently (#2059)

* added custom bookmark marker

* passed value of bookmarkplacelist in tests

* update the nearby markers on clicking bookmark buttons
2019-02-02 19:13:42 +05:30
Vivek Maskara
4bbbfc839b Save Wikidata entity ID in contributions DB (#2317) 2019-01-30 11:49:30 +02:00
Vivek Maskara
68ae11e37f Use central auth token only for cross wiki calls (#2318)
* Use central auth token only for cross wiki calls

* Fix tests

* Add test for wikidata edit token
2019-01-25 18:14:41 +10:00
Vivek Maskara
de9611821b Fix version number for alpha builds (#2325) 2019-01-24 23:32:16 +05:30
Vivek Maskara
532ab8aeae Fix uploads getting stuck (#2309)
* Fix uploads getting stuck

* Fix test

* Use single instance of Gson across the app

* More logs to help debug upload failure

* Add request identifier

* wip

* Fix issues with image quality check dialogs
2019-01-24 17:56:18 +10:00
Vivek Maskara
559127dfa3 Fix app stuck and memory issues while uploading images (#2287)
* Do not use an image array to store all bitmap pixels at once

* Extract image preprocessing to a different service and use computation thread

* Add java docs

* Cleanup code to remove temp file logic

* Add logs in upload flow

* Fix tests

* Fix more tests
2019-01-16 18:32:25 +02:00
Vivek Maskara
d4fa9cfa45 Use wrapper for interacting with shared preferences (#2288)
* Use wrapper for accessing shared preferences across the app

* Use Json kv store for storing place object

* Fix tests

* Fix test failure

* Fix UI tests
2019-01-14 00:13:21 +05:30
Vivek Maskara
e773a82206 Handle null URI while uploading picture (#2262)
* Handle null URI while uploading picture

* Modify cache method to never return null path

* Fix tests
2019-01-04 18:21:55 +10:00
Vivek Maskara
2ea6bd7f65 With more information while sending logs (#2222)
* With more information while sending logs

* With java docs and unit tests

* Changes based on code review
2019-01-03 01:12:08 +10:00
Adam Jones
fb3136ab19 Spelling mistake fixes (#2151)
* Spelling mistake fixes

* Spelling mistake fix
2018-12-21 15:20:52 +02:00
Adam Jones
d7e73c37e6 Refactor and add tests to LengthUtils (#2201) 2018-12-21 14:23:53 +02:00
Vivek Maskara
4b58f16557 Fix null context error in network utils (#2184) 2018-12-20 12:55:21 +00:00
Adam Jones
fb3055e716 Add FileUtils tests for SHA1 and deletion (#2152)
* Add FileUtils tests for SHA1 and deletion

* Avoid changing access modifier for SHA1 test
2018-12-17 21:15:00 +05:30
Vivek Maskara
f897af028a
Fix upload tests (#2130) 2018-12-16 21:04:49 +05:30
Vivek Maskara
8c083f3dd5 Changes to fix build (#2128)
* Changes to fix build

* Apply GPP plugin only on travis
2018-12-17 00:29:33 +10:00
Adam Jones
aa4ab37adb Move utils tests to utils package (#2109) 2018-12-14 10:54:46 +05:30
Vivek Maskara
f3a90c004c Upload tests (#2086)
* Add unit tests for upload flows

* Tests for upload model

* Test fixes

* Remove empty test cases

* Changes based on comments
2018-12-11 02:15:24 +10:00
Vivek Maskara
f607c1c14d Multiple uploads with over haul (#1968)
* Added new upload activity that receives shared files from the gallery.  Cards show and hide, plus titles are correct.  Displayed thumbnails for the shared images

* Better handling of the view paging plus error handling for required fields.

* Code cleanup to make things more readable.

* Extracted a model from the category search fragment that can possibly be shared with the new upload activity.

* Added category selection to the combined upload screen.

* Cleanup before the home-stretch on the GUI.

* Adding license selection.

* Fixed build warnings + cleanup

* Start to support the dark theme.

* Work in progress to add quality checking.

* Fixing merge.

* GPSExtractor: optimized away the EXifInterface object

* Implemented submit functionality, temporarily fixed jacoco crash by disabling DUMMY UploadView object.

* Implemented uploading of categories along with the picture. The category screen now displays GPS and recent categories when nothing is searched.

* Implemented caching of files. Did some work on picture quality detection.

* Implemented too dark picture detection.

* Added a side card for zoom and map buttons along with pretty animations for stuff.

* Added duplicate image on commons checking and fixed files not getting proper file extensions in several places.

* Added support for map button and switched in-app upload buttons to UploadActivity

* Pretty pretty animations!

* Implemented zoom functionality for th background image. Just pinching on the image works instead of requiring buttons.

* Added multi-language descriptions with categories by region.

* Reimplemented the duplicate title checker and implemented a check against putting the same language twice in the description.

* Javadocs for Description and UploadPresenter, plus some general cleanup.

* Small code changes.

* Implemented login checks for the Upload screen.

* Implement receiving data from Nearby.

* Feature/permissions library (#1855)

* Added permission for Dexter, the runtime permission handling library

* [Preparing fir issue #1773] Added a utility function which would take the user to app settings screen where he could manually give us the required permission

* Added an alert dialog with positive and negative callback [Preparing fir issue #1773]

* Improvements in the way External Storage Permission is handled in MultipleShareActivity[Bug fix #1697]
1. Used dexter to handle the external storage permission
2. Behaviour changes : When user tries to share(uppload) images to commons via MultipleShareActivity, following decision tree is followed
	a. If the app has permission for external storage, normal upload operation is followed
	b. If the app does not has the permission for external storage, dexter is used to ask for the same
	c. If the user gives us the required permission, normal upload flow is proceeded
	d. If the doesnot gives us the required permission a rationale dialog is shown with the appropriate message to let him know why we need the permission
	e. If he presses okay, steps a-c are followed and if he presses cancel, we close the app.
	f. If while asking for permission, the user chooses never ask again, then next time he tries to upload an image via MSA, the rational dialog follows the app setting screen where he could manually give us the required permission and the onActivityResult of same is handled

* Added a Constants class to handle request and result codes from one place and other related constants common to the all app elements

* replaced hardcoded strings ok and cancel in DialogUtil to string resources

* init permission rationale dialog in activities onCreate

* Code formatting, updated access modifiers wherever required, added javadocs for new methods created

* *shifted constants to app class
*Added JavaDocs in PermissionUtils

* removed class REQUEST_CODES from CommonsApplication and instead put the enclosing constants in the App class itself

* Made Codacy happy.

* Abstarcted permission acquisition into new class DexterPermissionObtainer

* Fixed Nearby upload detection

* Migrated bad picture detection from AsyncTask to RxJava.

* Removed ShareActivity and related dead code

* Removed dead or duplicate code from FileProcessor

* Added info button to title EditText

* Fixed the add description button not disappearing.
Added "Starting Upload" toast.
Added link to the license on final screen.
Made it so that the map button is hidden when image lacks gps coords.

* Support in app multiple uploads

* Minor changes to fix build

* Changes to fix pending issues with upload flow

* Fix display of similar image fragment

* When uploading several files at once the date is missing #1854 (#2)

* Bug fix issue #1854
* updated ContributionsDao to save create date, which it was not doing currently [it was instead saving current date]
* UploadItem accepts are dateCreated param
* Added a function in UploadModel, getFileCreatedDate which tries to fetched the file creaction date from all possible content providers.

* Fix pending issues in upload flow

* Make multiple uploads work for Google Photos

* Fix default state for upload activity

* Fix keyboard state for license screen

* Fix descriptions for uploads

* wip

* Fix language spinner
2018-11-19 17:00:32 +05:30
Victor-Bonin
80a9c94653 Feature #1756 : Bookmark System (#1935)
* Add bookmark star images

* Add bookmark item in navigation menu

* Add Activity for bookmarks

* Implement bookmarks viewpager

* Bookmark object and bookmarkDao

* Implement Bookmark Picture Fragment and Controller

* Implement image detail bookmark menu action UI

* contentProvider + config + dao rework

* Fix Dao and Content Provider crashes

* Link bookmark controllers and dao

* Implement bookmark location fragment, controller

* Add bookmark icon to location items

* Add empty bookmark list behavior and refactoring

* bookmarkLocation dao and contentProvider

* Fix bookmarks location crashes

* Rename and refactor classes

* Implement location list refresh

* Fix picture list update
When user come back from detail picture fragment, it solve the refresh bug.

* full test coverage

* Refactor bookmarks classes

* Fix bookmarks pictures loading

* Fix bookmark locations list display

* Java Documetation

* Fix Code review quality

* Fix DB version update

* Remove forgotten todo

* Update bookmark activity base class
Change from AuthenticatedActivity to BaseNavigationActivity
2018-10-26 02:54:22 +11:00
Dmitry Brant
fc30f1b5ec Sweeping update of gradle and dependency versions. (#1858)
* Sweeping update of gradle and library versions.

This updates all of the dependencies of the project to their latest
versions. Everyone should please upgrade to the latest version of Android
Studio, update your build tools, and keep your version of Gradle and the
Kotlin plugin up to date.

* Update build tools in travis.

* Remove cruft and fix tests.

* Remove even more stuff.

* Reinstate instrumented tests.

* Update emulator image in travis.

* Localisation updates from https://translatewiki.net.

* Work towards eliminating string literals from code. (#1861)

String literals are being used in many places in the code, instead of
proper string resources which are automatically localized. This PR
replaces many of the string literals with pre-packaged resources, or will
add the appropriate string if necessary.

* Add button on image details to copy wikicode to clipboard (#1849)

* Add button on image details to copy wikicode to clipboard

* Make copy wikicode button width the same as the nominate deletion button width by filling in background

* Build fix

* Enable ProGuard for Debug and Release builds.

This enables ProGuard minification, which significantly shrinks the APK
(for both debug and release configurations) and vastly decreases the
method count.

* Add ProGuard rules for test builds.
2018-09-11 11:51:28 +03:00
Vivek Maskara
a63b9f88bb
Merge 2.8 release with master (#1887)
* Add Traceur for getting meaningful RxJava stack traces (#1832)

* Hotfix for overwrite issue in 2.8.0  (#1838)

* This solution is an hotfix for overrite issue came back on 2.8.0 version. What I did is checking the extension, and if it is null, adding .jpg suffix. Because commons files always have suffixes, and we should compare file names after adding suffixes. Othervise overrides are possible.

* Check if file title includes an extension already, by checking if is there any dot in it.

* Fix logic error

* Add uncovered tests

* Remove unecessary line breaks

* Make Javadocs more explicit

* Versioning and changelog for v2.8.2 (#1842)

* Versioning for v2.8.2

* Changelog for v2.8.2

* Add logs in wiki data edit and session refresh flow (#1874)

* Fix logout (#1875)

* [WIP] Refactor feedback and quiz to reduce possibility of NPE (#1881)

* Refactor feedback and quiz to reduce possibility of NPE

* Handle throwables in quiz checker

* Minor refactoring

* Set Traceur to only work in DEBUG mode (#1884)

* Bug fix for uploaded images count in achievements activity (#1885)

* Versioning and changelog for v2.8.3 (#1886)

* Update changelog.md

* Versioning for v2.8.3
2018-09-07 05:50:41 +05:30
Vivek Maskara
143ad00149
Fix failed uploads (#1790)
* Cusom Mediawiki api layer

* Fix tests
2018-08-05 01:26:00 +05:30
Ujjwal Agrawal
86878fb62d Add feature to Browse commons via app (#1716)
* Search activity, image search fragment added

* Removed explore icon xml

* Updated Javadocs for search Activity and Navigation Base Activity

* SearchImageItem class updated

* Javadocs added for search activity

* removed redundant code and added javadocs for search image modules

* Javadocs added for updateImageList  method

* Rename featuredImage to explore

* Fixed null query issue

* changed cisibility to gone in case of successful Fetch

* Consolidate the networking libraries - drop volley in favor of OkHttp

* Extracted a few networking related items into a new Dagger module and finished the process of mocking the main component for tests.

* Refactoring to extract GpsCategoryModel and ensure single-responsibility-principle is maintained in CategoryApi.

* fixed featured image back bug

* Localisation updates from https://translatewiki.net.

* Javadocs added

* Add option to set image as wallpaper (#1535)

* Add option to set image as wallpaper

* Added java docs

* Toast message on setting the wallpaper successfully

* Localisation updates from https://translatewiki.net.

* SearchHistory Fragment added

* Search History Item added

* Content Provider, RecentSearchesDao added

* Database version changed to 7 and added methods for find, save ,..

* Delete icon deleted

* Reverted changes in gradle files

* Reverted changes in gradle files 2

* Optimized Improts

* reverted refractor for container name

* Refactored packagename, changed name to query in POJO class.

* Updated lastUsed to lastSearched

* Javadocs updated

* Check if user has been in search page for 5 seconds if yes then save it to history

* If else indentation updated

* added import in test

* edittext replaced with Searchview

* RxSearchview added

* Added support for API 21+

* Snackbar removed on success

* Improved code

* Pagination added

* Removed unnecessary toast

* Comment added in method

* Support for landscape mode added

* Fixed screen rotation issue on Explore and Search activity

* Clear focus added

* Delete all function added in Content Provider and called from fragment

* Scrollbar Recyclerview added

* Share Icon changed to 32 dp and back button added in explore, search activity.

* Removed unnecessary code

* Wrote and run tests for Recent Searches
 (creating db, migrating from versions, deletion, finding,..

* Category Search Fragment added

* Adapter factory added

* Renderer added

* Improvements

* Viewpager adapter added

* Updated XML

* Improvements in category card design

* tabs colors changed

* renamed images to media

* Java docs improved

* Javadoc added for setTabs

* JavaDoc for ViewPagerAdapter added

* Refreshed listview after delete

* Added mediaContainer

* Fixed ghost issue in image search fragment

* Ghost issue for categories fixed

* Removed Calling API call onback press

* Category Details activity added

* Menu added in category details activity

* back button added

* back button bugs

* Improvements in category images fragment

* JavaDoc added for some methods

* trimming added, Tab layout hided, recent searches refreshed

* SubCategory list fragment added, API added to extract subCategory Details

* API params updated to get more precise results

* Javadocs added for MWAPI method

* Pagination removed

* Fix API for fetching images inside category

* Parent category API added

* Fix #1704

* Fix #1704 corrected

* Fix #1702

* Fix #1702 and #1704

* added try catch statements

* Optimimzed imports

* loops replaced with Functions

* Javadocs for various methods added

* Fix java docs for Dao

* Javadocs for various methods added

* Fix java docs for Dao

* More javadocs added for explore Feature

* Javadocs added

* Javadocs added

* Improvements in indentation (#1739)
2018-07-24 10:17:24 +03: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
seannemann21
c0d86b76e8
Merge branch 'master' into show-block-status 2018-06-25 14:41:47 -04:00
Sean Nemann
22a5178e04 Updated comments and method headers to clarify that the block status being checked within AuthenticatedActivity refers to the Wikimedia Commons block status of the user 2018-06-11 13:07:54 -04:00
maskara
d1b33933cf Fix build failure 2018-06-05 00:03:56 +05:30
Sean Nemann
fcfae643c3 Updated isUserBlocked method to check the expiration time instead of just if an expiration time exists. Updated tests accordingly 2018-06-04 11:48:07 -04:00
Sean Nemann
01a3a233a9 Added comments to isUserBlocked method and tests for the method 2018-06-04 11:48:05 -04:00