Commit Graph

51 Commits

Author SHA1 Message Date
Kirill Kamakin
a5ae5e91cd Disable Picasso logging 2022-04-09 17:32:18 +05:00
Kirill Kamakin
15b4c2b91a Replace if with when in SplashViewModel 2022-04-09 17:32:18 +05:00
Kirill Kamakin
a9e0842a38 Simplify RecipeInfoFragment code 2022-04-09 03:38:30 +05:00
Kirill Kamakin
e7620400b8 Use single UI state for activity 2022-04-09 03:06:02 +05:00
Kirill Kamakin
fb4e081e33 Fix restarting count down 2022-04-08 23:26:22 +05:00
Kirill Kamakin
a3d320bb79 Fix logout button 2022-04-08 21:54:43 +05:00
Kirill Kamakin
0768842405 Fix restarting count down in disclaimer 2022-04-08 21:27:59 +05:00
Kirill Kamakin
d2029438d7 Fix handling result in BaseURLFragment and AuthenticationFragment 2022-04-08 21:19:05 +05:00
Kirill Kamakin
7c081c199a Replace AccountManager with EncryptedSharedPreferences 2022-04-08 20:07:32 +05:00
Kirill Kamakin
ba28f7d322 Start AddAccountActivity implementation 2022-04-08 17:54:23 +05:00
Kirill Kamakin
b129913a82 Clear unused and fix tests 2022-04-08 17:54:23 +05:00
Kirill Kamakin
d40793104f Fix recursive calls to getAuthToken 2022-04-08 17:54:23 +05:00
Kirill Kamakin
57f4ec4e22 Implement the simplest account manager authentication 2022-04-08 17:54:22 +05:00
Kirill Kamakin
096b5389bd Use AccountManager 2022-04-08 17:54:21 +05:00
Kirill Kamakin
eca325ebe4 Simplify error handling 2022-04-05 15:35:18 +05:00
Kirill Kamakin
97ffbff89a Trim e-mail and username to ease the login process
Spaces aren't visible in EditText and it's possible to
get authentication errors because of that invisible space.
2022-04-04 21:19:57 +05:00
Kirill Kamakin
f14afd2ebe Fix IllegalStateException when clicking login after logout
The previous login result was stored as live data and
prevented AuthenticationFragment from being shown
properly. However, an attempt to destroy RecipesFragment
was made. This attempt caused IllegalStateException
when accessing view in onDestroyView.
2022-04-04 20:52:14 +05:00
Kirill Kamakin
fb10333c2c Fix showing login/logout button on initial screens 2022-04-04 19:34:21 +05:00
Kirill Kamakin
c98feceab4 Fix pressing back on AuthenticationFragment
If login request isn't disabled when user presses
back then they might get navigated back to
authentication again.
2022-04-04 18:54:48 +05:00
Kirill Kamakin
e6dbff4a67 Fix IllegalStateException when inflating menu 2022-04-04 18:52:19 +05:00
Kirill Kamakin
468aa8c02a Implement login/logout functionality 2022-04-04 16:42:22 +05:00
Kirill Kamakin
f44f54522d Extract Base URL from authentication 2022-04-04 03:34:50 +05:00
Kirill Kamakin
b3e25db4df Replace Shared Preferences with Data Store 2022-04-03 19:59:57 +05:00
Kirill Kamakin
ec5d05c819 Use @Singleton where possible 2022-04-03 17:24:38 +05:00
Kirill Kamakin
7fc2887dc7 Major code refactoring
Main goals are:
1. Ability to use mocks in unit tests instead of
having to setup mock web server as if it was an
integration test.
2. Cache Retrofit services in memory
3. Make it easier to read
4. Use OptIn where possible instead of propagating
Experimental* annotations everywhere
2022-04-03 00:17:28 +05:00
Kirill Kamakin
b56f267979 Use viewLifecycleOwner to observe auth status
Even though views aren't modified when auth
status changes, we still need to operate
only when view is visible.
2022-04-02 18:12:32 +05:00
Kirill Kamakin
c8019e9c85 Implement hiding ingredients and instructions 2021-12-27 19:41:56 +03:00
Kirill Kamakin
50f6066416 Fix memory leaks found by LeakCanary 2021-12-27 14:26:35 +03:00
Kirill Kamakin
a36fec226d Use view binding property delegate (#22) 2021-12-27 08:37:10 +00:00
Kirill Kamakin
edfac85e8e Extract dagger modules to di package 2021-12-27 11:03:38 +03:00
Kirill Kamakin
b5249e4bf6 Replace Glide with Picasso (#19) 2021-11-28 13:41:21 +00:00
Kirill Kamakin
a15fac7c7e Hide error when text is entered (#14) 2021-11-27 16:36:30 +00:00
Kirill Kamakin
44458dd146 Fix a number of lint issues (#2)
* Fix systemUiVisibility deprecation warnings

This commit extracts setSystemUiVisibility as
an extension and uses the new API depending on
the Build.VERSION

* Fix splash fragment vector issues

Clip-path isn't available before V24 and
width/height should not exceed 200 dp.

* Remove unused disclaimer fragment header

* Remove unused ic_launcher_round

* Ignore IconMissingDensityFolder lint

Ignoring it because all the images are vector

* Ignore UnusedAttribute lint

It warns about networkSecurityConfig which
is used only in debug builds to allow
user SSL certificates. Lint says it's not
available before v24. But it doesn't matter
since before v24 the user SSL certificates
were allowed by default.

* Use plurals for disclaimer count down
2021-11-27 13:10:00 +00:00
Kirill Kamakin
339f8327de Implement URL input format checks 2021-11-27 12:27:25 +03:00
Kirill Kamakin
9ea2facc8d Extract recipe info adapters to ViewModel 2021-11-27 10:44:28 +03:00
Kirill Kamakin
715e63a1d4 Specify RecipeInfoFragment's layout managers in xml 2021-11-27 10:39:57 +03:00
Kirill Kamakin
cc5c9edb1f Refactor RecipesFragment
This commit extracts SwipeRefreshLayout extension to a
separate file. Additionally, it refactors RecipesFragment in
order to move all the logic to the ViewModel from the View.
2021-11-27 00:22:52 +03:00
Kirill Kamakin
e701b5d7df Show recipe info in bottom sheet dialog 2021-11-25 20:06:53 +03:00
Kirill Kamakin
57babcbd1f Fix using trySendBlocking where trySend must be 2021-11-23 23:48:53 +03:00
Kirill Kamakin
db2a0b4a94 Wait a second on splash to show image properly 2021-11-23 22:16:22 +03:00
Kirill Kamakin
20cb747b2a Change fullscreen state as soon as possible in splash 2021-11-23 22:16:05 +03:00
Kirill Kamakin
d8b4245eef Remove app title after user authenticates 2021-11-23 21:04:16 +03:00
Kirill Kamakin
d36ebfe50c Show auth errors to the user 2021-11-21 17:29:44 +03:00
Kirill Kamakin
0a0472c17d Fix ability to click login twice 2021-11-20 22:59:13 +03:00
Kirill Kamakin
a6e948ca6b Fix calling navigateToAuth twice and even more
Calling that method several times in a row is not supported,
Navigation library throws an Exception saying it doesn't know how
to navigate there
2021-11-20 22:07:43 +03:00
Kirill Kamakin
8239f11f13 Add more verbose logging 2021-11-20 20:32:37 +03:00
Kirill Kamakin
1d2c5584a8 Read instructions step header from resources 2021-11-20 20:21:46 +03:00
Kirill Kamakin
ff4be6807f Add splash screen 2021-11-20 20:11:19 +03:00
Kirill Kamakin
4b817ba404 Add disclaimer fragment 2021-11-20 18:43:33 +03:00
Kirill Kamakin
0e4016150a Observe auth statuses as LiveData, not Flow 2021-11-20 15:37:03 +03:00