Commit Graph

197 Commits

Author SHA1 Message Date
86f01eb002 Memoize the most expensive parts of SettingsPage 2023-01-01 13:39:10 +13:00
5335f4afbc Memoize switches in SettingsPage 2023-01-01 13:32:26 +13:00
7863b9caa0 Improve speed of setting sound string as well 2022-12-30 20:38:34 +13:00
3fdc5900e3 Improve performance of setttings toggles
I was awaiting the result of the sqlite operations
when really I should have just set the state immediately,
and done the operations in the background.
2022-12-30 20:37:08 +13:00
3603c67133 Add filtering back in to SettingsPage
I accidentally removed it and pushed to production...
Woopsie.
2022-12-30 20:29:16 +13:00
a9000898f3 Replace children with title for Switch
Apparently, the children prop makes React.memo
not work any more. I read about it in
https://stackoverflow.com/questions/53074551/when-should-you-not-use-react-memo
2022-12-30 19:49:54 +13:00
5e37490c2d Add react-hook-form for settings page
This seems to have improved performance.

Related to #135.
2022-12-30 15:47:12 +13:00
14edb66e28 Add common date formats
Add yyyy-MM-d and yyyy.MM.d formats

Closes #139
2022-12-30 13:35:11 +13:00
a3138c48b5 Combine several state operations in SettingsPage 2022-12-29 18:20:40 +13:00
2b302bab73 Move theme line of SettingsPage
Because I am schizophrenic.
2022-12-29 17:28:31 +13:00
41ed9464c9 Use single settings object for state
Since all this state was being set at the same time,
on load, it makes more sense to have it as a single state.
Also they are all connected to the same table so it makes more
sense this way.

Also, I removed the use focus effect in favor of just a
use effect which runs on mount. The things being refreshed here
weren't very important to be updated frequently, and focus effect
has a cost on performance.
2022-12-29 13:52:38 +13:00
c664a9603c Add missing toasts to some settings
- Date format
- Dark color
- Light color
2022-12-28 14:59:39 +13:00
186b7e0fe9 Remove ios check from SettingsPage
These things are pointless unless I
can get the app deployed to the iOS store.
2022-12-28 14:59:19 +13:00
d6e7d6158c Make sure alarms aren't on with app being optimized
If battery optimizations are on for the app,
alarms will have several unpredictable bugs.
For example, sometimes sounds won't play,
sometimes re focuisng the app won't work.
2022-12-28 14:56:29 +13:00
2c6a773548 Change alarm sound toast
Closes #137
2022-12-28 14:15:02 +13:00
60cc619e39 Move button filter to memoized call
This reduces re-renders
2022-12-24 19:58:55 +13:00
48432188c3 Simplify Switch.tsx 2022-12-24 19:55:38 +13:00
27b7e91e91 Factor out buttons in SettingsPage 2022-12-24 13:36:11 +13:00
fc6f5e3b53 Add missing key prop to SettingsPage 2022-12-24 13:18:03 +13:00
777eddf943 Remove usage of FlatList in Settings page
Doing so looks like it improved the performance
of the switches.

Related to #135.
2022-12-22 19:18:44 +13:00
42589fe9ab Fix column reference in settings page 2022-12-10 22:22:51 +13:00
3600003660 Clear set images + alarm when importing a database
Closes #131
2022-12-10 22:19:55 +13:00
0b2d4d52e1 Add export/import database buttons to search 2022-12-08 13:22:02 +13:00
0b6471a766 Add ability to export/import SQLite database 2022-12-08 13:18:41 +13:00
96674cd51f Clean unused import from SettingsPage 2022-12-01 15:52:44 +13:00
567e885e76 Make best view select consistent with SettingsPage 2022-12-01 15:51:39 +13:00
a284f045d2 Add left padding to settings selects 2022-12-01 15:45:18 +13:00
1016997269 Fix width of alarm sound in SettingsPage 2022-12-01 15:26:41 +13:00
Tiffany Barclay
a3e0ba84cb Change width of select label 2022-11-30 20:47:16 +13:00
c4aad7beb5 Remove colon from alarm sound label 2022-11-30 15:19:31 +13:00
de4c8081a6 Add labels to selects 2022-11-30 15:15:19 +13:00
8e31dc2186 Add labels to colors 2022-11-30 14:32:42 +13:00
4375a9c24e Simplify process of enabling rest timers 2022-11-30 14:23:36 +13:00
dc27ae9868 Split up dark and light color settings
Previously it was possible to choose a color combination
that was almost impossible to read (due to contrast).
Now we have prevented this from happening, as well as
giving the user more customizability.
2022-11-26 13:15:12 +13:00
be4098962e Add settings module for android 2022-11-21 18:15:43 +13:00
29cbc43534 Use first item for Select.tsx if no value is found 2022-11-21 17:54:45 +13:00
38332c193c Fix settings page crashing
Select.tsx was crashing if it couldn't
find a label for the selected value.
2022-11-20 21:47:05 +13:00
157a26b843 Remove margin bottom from flatlist on settings 2022-11-16 18:32:59 +13:00
6012747643 Merge branch 'master' of gitea.presley.nz:brandon.presley/Massive 2022-11-16 18:30:21 +13:00
a1b240caae Add margin between settings list and selects 2022-11-16 18:27:58 +13:00
3528ba593f Finish removing react-native-picker-select
Replaced with react-native-paper menus.
2022-11-16 18:17:59 +13:00
e7e2f299da Start moving select dropdowns to use menus 2022-11-16 18:01:40 +13:00
19ec8ac5e9 Fix margins for settings page 2022-11-16 17:10:31 +13:00
58ab135b09 Remove default coloring of selects for SettingsPage 2022-11-16 17:07:43 +13:00
261f1c8bf0 Fix colors of selects in settings 2022-11-16 14:46:45 +13:00
162d67c351 Start work on pickers that work on android+ios 2022-11-15 19:51:15 +13:00
401ce5d2b8 Disable 24 hour checking and battery for ios 2022-11-14 21:42:37 +13:00
3dea1e952c Fix default date in SettingsPage 2022-11-14 14:27:50 +13:00
9bfe9737ea Fix lint issues 2022-11-12 16:02:16 +13:00
c51bfbd852 Use date-fns and detect 12/24 hour device setting
Related to #116
2022-11-12 14:38:39 +13:00
f87373479a Attempt to optimize SettingsPage
1. Use FlatList instead of ScrollView
2. Wrap `switches` in a `useMemo` call

I didn't measure it but felt like this sped up
performance slightly. Still might come back to this
page again in the future.

Closes #111
2022-11-07 14:30:25 +13:00
ae84228913 Remove showSets setting 2022-11-05 17:31:18 +13:00
f7c895f608 Fix not remembering settings sound 2022-11-03 21:58:33 +13:00
0ed3b9817c Add lighter purple color option 2022-11-02 12:36:48 +13:00
18eaa9fc14 Adjust spacing of SettingsPage 2022-11-02 12:28:11 +13:00
949b435853 Split up state for SettingsPage
This improved performance when visually
toggling an option
2022-11-01 18:58:09 +13:00
31f1528c35 Replace settings context with theme context
The settings context was having a big performance
impact on the app. We only truly need the theme + color
to be a global context.
2022-11-01 16:50:03 +13:00
8d7fe149f5 Remove unused code 2022-11-01 16:11:39 +13:00
fadab1f30b Fix colors of pickers in SettingsPage 2022-11-01 16:06:25 +13:00
49b5eb48c6 Refactor MassiveSnack
Instead of using a context for the whole app
use DeviceEventEmitter with root state.
This will probably improve performance,
since I think the react context was
re-rendering the entire DOM tree.
2022-11-01 15:55:37 +13:00
1a53fa324b Remove redundant Color context
Settings already stores the color set by the user.
2022-10-31 21:32:33 +13:00
13ca9cef3e Reword "maximum" as "target" for sets
There isn't any restriction involved in the sets
for each workout, it's more like a guide.
2022-10-31 21:00:53 +13:00
bdb27894f7 Optimize root context 2022-10-31 21:00:10 +13:00
bc7aca03e8 Remove semicolons from line endings 2022-10-31 17:22:08 +13:00
b7f1c2192e Pause converting to typeorm due to odd error
ERROR  TypeError: Cannot read property 'getItem' of undefined

This error is located at:
    in FlatList (created by SetList)
    in RCTView (created by View)
    in View (created by Page)
    in Page (created by SetList)
    in SetList (created by SceneView)
...

I found an open issue on the react-native github which seems
related https://github.com/facebook/react-native/issues/31523
but after following all of their suggestions I still have the
same error. I tried:
- Removing @babel/plugin-proposal-class-properties & @babel/plugin-transform-flow-strip-types
- Adding @babel/plugin-transform-flow-strip-types
2022-10-31 13:20:36 +13:00
463852e6a6 Prevent double searching everywhere
Also change variable names. Search should represent the
act of searching, rather than the value being typed by the user.
2022-10-28 18:59:54 +13:00
e6dcd4a47e Use hermes engine
https://reactnative.dev/docs/hermes
2022-10-28 18:36:47 +13:00
ac0af26f77 Add more date format options
Closes #94
2022-10-28 15:49:03 +13:00
859fa2a89f Add setting to disable sound on rest timers
Closes #50
2022-10-27 17:28:27 +13:00
80b1a1ef56 Fix single views for new custom headers 2022-10-23 19:13:58 +13:00
36e6637ba2 Revert "Revert "Add custom app bar""
This reverts commit e84dd7bdea.
2022-10-23 12:35:58 +13:00
e84dd7bdea Revert "Add custom app bar"
This reverts commit a664b65ce2.
2022-10-23 12:32:44 +13:00
a664b65ce2 Add custom app bar
The header bar provided by react-navigation was jumping on first
load, whereas this custom one doesn't.
2022-10-23 12:24:39 +13:00
c73937396e Fix defaults for freshly installed app
Closes #95
2022-10-18 21:43:46 +13:00
77db34b310 Add toggle for hiding maximum set count
Closes #90
2022-10-16 16:54:20 +13:00
46f0875497 Create useSnackbar custom hook 2022-10-14 17:27:19 +13:00
8461f86e88 Wrap color context with useColor custom hook
I find it easier to import hooks by useX instead of
useContext(X). Like how the navigation library is just
useNavigation
2022-10-14 17:24:02 +13:00
3cbabb723a Add sessions page
Related to #82
2022-10-05 23:38:52 +13:00
eb53d58991 Add ability to set app theme
Closes #79
2022-10-04 14:35:56 +13:00
c65bbf948f Add hh:mm format to date setting 2022-10-02 19:14:10 +13:00
93878f14e4 Fix image on new set prediction 2022-10-02 19:07:52 +13:00
ba3ed2a272 Revert "Revert "Add setting for showing date by default""
This reverts commit e1b7e80e2f.
2022-10-02 18:07:43 +13:00
a5c70050a7 Revert "Revert "Add setting for date format""
This reverts commit 3691c729b4.
2022-10-02 18:04:36 +13:00
b0b804eae1 Use react context for settings
Closes #81
2022-10-01 16:01:07 +13:00
ee76864a16 Fix margin differences in Settings page 2022-09-29 14:52:38 +13:00
374cbdf45d Add set prediction settings
Closes #51
2022-09-29 14:44:01 +13:00
3691c729b4 Revert "Add setting for date format"
This reverts commit 023041b846.
2022-09-26 19:13:48 +13:00
e1b7e80e2f Revert "Add setting for showing date by default"
This reverts commit e8715162a0.
2022-09-26 19:13:24 +13:00
e8715162a0 Add setting for showing date by default
Closes #52
2022-09-26 19:02:25 +13:00
023041b846 Add setting for date format 2022-09-26 18:23:06 +13:00
91c0430760 Factor out massive switch 2022-09-26 16:10:13 +13:00
5e1a6c42cd Swap theme and sound options in SettingsPage
Closes #53
2022-09-25 23:51:05 +13:00
ce0297dce6 Make settings page more compact 2022-09-25 18:35:30 +13:00
d38d2a59b4 Add white and black themes 2022-09-25 17:43:29 +13:00
b5b4aa8666 Split out colors 2022-09-25 17:32:49 +13:00
3509aa93f3 Add setting to hide steps 2022-09-24 17:29:52 +12:00
3e4dfa5c80 Add setting to hide workouts from edit set
Closes #43
2022-09-24 17:23:15 +12:00
462a7f09bc Fix settings forgetting show unit
Closes #47
2022-09-24 17:12:58 +12:00
686666b953 Get unit in settings page from sqlite 2022-09-24 16:55:41 +12:00
e516cdfdc0 Add ability to customize primary color
Closes #40
2022-09-24 13:57:51 +12:00