Commit Graph

33 Commits

Author SHA1 Message Date
Matthieu b25262db2f Fix coverage stat, update dependencies, remove useless db passing 2021-04-20 12:07:18 +00:00
Matthieu 8b90e17fc4 Restore integration tests in CI 2021-02-17 22:55:31 +01:00
Matthieu cf3021c26a Alert user if API is not enabled. Store some settings in db 2021-02-05 14:48:12 +01:00
Matthieu f8b3e1627a use nodeinfo whenever possible 2021-02-04 20:44:31 +01:00
Matthieu 4c935918d6 Add 'What's an instance' dialog in login instead of opening link 2021-01-25 10:57:27 +01:00
Matthieu bebf0233dc Start removing deprecated kotlin-android-extensions uses 2021-01-13 01:28:08 +01:00
Matthieu 8e5e2c2d87 Fix #271 by updating the apiholder before relaunching the application 2021-01-05 00:38:16 +01:00
Matthieu 3a91b02e55 Use coroutines 2020-12-29 19:34:48 +01:00
Matthieu 86543ee74c Correct a bunch of small things raised by inspection 2020-12-28 20:53:24 +01:00
Matthieu ff7f18d2ae Refactor and move out openUrl method to utils 2020-12-28 17:18:07 +01:00
Matthieu d6d1262629 Don't query but try catch to bypass new package visibility feature in android 11 2020-12-28 17:00:02 +01:00
Matthieu 0a4d285d14 Big reorganization of code into logical units (#251)
Not much actual code is changed
2020-12-26 12:10:54 +01:00
Matthieu 60ba840421 Use BaseActivity to inject the database and api 2020-12-16 22:11:45 +01:00
Matthieu 9980d651d2 Remove imports and make CameraActivity inherit from BaseActivity 2020-12-16 21:50:27 +01:00
Matthieu 689dffe7c1 Add in-app language setting 2020-12-11 16:53:12 +01:00
Matthieu e71e5c304a clean imports 2020-12-08 18:33:16 +01:00
Matthieu 3370001c4c store client ID and secret, and set up refresh if a request fails with 401 2020-11-29 20:19:25 +01:00
Matthieu bf9d5287ba Store refresh tokens 2020-11-29 14:58:54 +01:00
Matthieu 7bca413d60 Use nodeinfo endpoint to get info about the capabilities of the instance 2020-08-22 22:34:21 +02:00
Matthieu 21925e7af4 Dependency injection
Configure dependency injection for API and the database. Uses Dagger (dagger.dev)

The API is held in a holder, so that it can be invalidated or recreated as needed.

Big refactor of the feeds, this introduces a bit more duplication of code (some very similar methods that differ only in the types or minor details), but now the inheritance makes more sense and there is less "forcing" to make the inheritance work (for example: no more casting Int to String just to have the right type for the key)
It should be easier to work with the feeds in the future, maybe we'll find better abstractions later on.
2020-07-26 20:56:01 +02:00
Ulysse Widmer 34f3d12dbc
Offline mode part 2 - Store posts in the DB (#209)
* store posts base idea

* switch to nullable types in Status object

* store posts first try + switch to nullable types for Attachment objects

* fix some tests, add converters

* update gradle

* wip: display stored post

* first draft of functional offline post

* added likes and shares to offline data

* fully functional

* clear activity correctly

* clear correctly activities

* refactored some tests and added offline feed test

* Distinguish between users, and only store home timeline

* count better

* Sort when getting statuses

* disable buttons, since we're offline anyways

Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com>
2020-06-05 20:14:57 +02:00
Wv5twkFEKh54vo4tta9yu7dHa3 ca307abcde
multiAccount functionnality (#168)
* multiAccount functionnality

* remove sharedpreferences usages

* start fixing tests to work with changes

* remove test of removed functionality

* more fiddling with tests

* fix instance insert being broken

* clean up some more preferences usage

* close db

* try to fix a bunch of issues

* move db close

* add instance to user drawer item

* remove rule that is no longer needed

* correct mock server to fix test

* removed unused stuff

* fix domains not being validated correctly

* update test

* Delete q

* Move image filter application to a thread

* remove unused imports

* remove unused strings

* remove unused strings

* fix buttons (sometimes)

* solve some linter issues, fix saturation brightness contrast not being shown properly

* remove unused strings

* add tests for drawer

* remove unused imports, other linter suggestions

* fix broken auto linter fix
2020-05-19 09:49:34 +02:00
Ulysse Widmer e96d5e22a7
Offline mode - Phase 1 (#156)
* rework post entity

* refactor login activity

* added db instance to login activity

* remember user logins offline

* drawer works offline

* fixed some tests

* move imagefragment in fragment folder

* added tests for the new login flow

* add missing drawer test

* add login offline test

* added online login flow tests

* fixed tests

* added mockserver /instance repsonse

* fixed marie's request
2020-05-14 20:14:41 +02:00
Ulysse Widmer 92c534ca1b
Feature/post creation (#83)
* added perm and features for cameraS, gps and external storage

* added camera activity accessible from main activity

* added button to redirect to camera activity

* implementing callback flow to use camera

* working camera

* added texture view for camera display

* added camera activity

* implemented texture listener

* camera not working, flow done, no feedback implemented

* camera working

* refactored code, still an activity

* added private to internal function, better error function handling

* deleted camera activity

* added camera fragment

* added camera fragment

* refactored camera as fragment

* necessary dependencies for fragment testing

* initial camera fragment test

* corrected access to activity form fragment

* Added state changes and termination

* added lines to test, to test coverage

* Removed unsupported state STARTED state transition

* Added basic tests to test code coverage

* use layout for tests, to trigger permissions requirements

* grant camera permission to app in camera test

* replaced null handlers by proper function getter

* changed layout, added takePictureButton

* using expresso to get code coverage on camea

* take picture flow not finished

* dummy change to camera test to perform new build

* added connection flow before test to reach main activity

* can take a picture and put it to ImageView

* replaced button text with images

* smaller buttons

* test camera fragment buttons

* added orientation handler

* changed icon to make travis happy

* test new espresso config for travis

* removed useless rule

* deleted useless val

* added layout ID's

* moved swipes from Before to Tests, and thread sleep

* stoped swiping, now tests from fragment directly

* start post creation flow

* use Uri when taking photo, can now go back from picture preview

* adjusted test and flow idea

* tests on displayed UI elements for the post creation fragment

* refactor camera fragment into transition new post fragemnt

* finished first phase: get a picture Uri

* fixed lint error found by travis CI

* added global timeout to test

* test the new way of test

* refactor new way of testing

* added in-app camera view and linked everything to the final flow + started API to post

* strugling on the upload media part

* upload image on server implemented

* post upload implemented

* added API call to get max_toot_chars and correct def of a post description

* fixed some tests

* fix tests: clicking on tabs make the app crash because of the camera fragment

* comment problematic chunk of code while samuel tries to fix it

* switch minimumsdk to api 24

* Revert "switch minimumsdk to api 24"

This reverts commit 24ce46dd82038b59732fd958e5e071ded39cd549.

* deactivited live camera for API 23

* tests for post creation fragment UI elements

* remove worthless UI testing and add gallery intent test

* removed camera intent for now

* some refactor

* lint error and more refactor

* more refactor on merge from master

* refactor and test for PostCreationActivity

* Revert "refactor and test for PostCreationActivity"

This reverts commit a0c146bcc545cdc3792df4806e6b0c908bd18747.

* Revert "Revert "refactor and test for PostCreationActivity""

This reverts commit 147a9ed80d5f9c9e3c38b5a977786bfb39eeb1b6.

* permissions correction for test

* updtated test

* fix a test and refactor

* relink correct fragment

* save picture locally

* test post button

* requested changes

* fixed required changes

* Revert "fixed required changes"

This reverts commit 405a9d4d1af05353e30028e60041cc1c97569c1b.

* redo change request

* added /media api response to mockserver

Co-authored-by: Andrea Clement <samuel.dietz@epfl.ch>
2020-04-24 12:44:12 +02:00
Wv5twkFEKh54vo4tta9yu7dHa3 7318ff5083
tweak UI, add mascot and info link to LoginActivity (#106)
* tweak UI, add mascot and info link to LoginActivity

* Fix test, add other test
2020-04-16 12:46:40 +02:00
Wv5twkFEKh54vo4tta9yu7dHa3 8af19cbd9a
Hide keyboard on clicking connect (#103) 2020-04-10 16:12:03 +02:00
Wv5twkFEKh54vo4tta9yu7dHa3 61cdb1118b
WIP: Loading (#76)
* Add loading indications, refactor fragments into common parent class

* Add cirrus

* actually add cirrus

* Add timeouts

* Fix test rules

* Add gitlab ci file to tes

* move tests to MockedServer to not have infinite waits by Espresso

* Update README for gitlab badge
2020-04-01 19:38:21 +02:00
Wv5twkFEKh54vo4tta9yu7dHa3 20c5ff4ee0
First use login flow (#44)
* transform profile activity into fragment

* Implement swipeable tabs

* Ask for login on first start, add API endpoints, change profile to show the user's profile

* Add tests

* delete test for now

* Adapt test to changes (no more profile from drawer)

* Add unit test for api

* Add test for profile, refactor to allow testing, add exception to security policy to allow tests

* Adapt test to new situation

* Fix typo due to change

* refactor somewhat

* remove unused function

* remove test dependent on network

* update test

* remove test

Co-authored-by: Ulysse Widmer <ulysse.widmer@epfl.ch>
2020-03-13 11:48:45 +01:00
Ulysse Widmer de314dc9de
Implements swipe motion & fragmentalize (#41)
* implements swipe motion

add a new class to implement swipe motion
add the swipe right from home page to display settings
passed the homepage in a fragment

* transform profile activity into fragment

transformed profile activity and layout into fragment
linked it with a swipe motion

* refactor settings drawer tests

* added more tests and refactored some files

* added animations to the sliding of the swipe motion
2020-03-12 22:23:25 +01:00
Matthieu 34f19810bc Simplify failedregistration calls 2020-03-07 18:31:58 +01:00
Matthieu b79ebca03a Some more tests, move values into xml 2020-03-07 18:13:26 +01:00
Matthieu 33f0711b1f Finish authentication 2020-03-06 18:24:20 +01:00
Matthieu d0ca08391b Add button to main activity to start a login process 2020-03-06 08:49:26 +01:00