mobile-ledger.git
14 months agomake transaction header row always have Id of 0
Damyan Ivanov [Thu, 11 Mar 2021 06:23:45 +0000 (08:23 +0200)]
make transaction header row always have Id of 0

there's onle one header, and having a stable Id avoids visual flicker
when the list is updated

14 months agofix flicker introduced with unique item Id
Damyan Ivanov [Tue, 9 Mar 2021 20:18:56 +0000 (22:18 +0200)]
fix flicker introduced with unique item Id

when items get unique id every time, resetting the model causes new
IDs to be assigned, making the adapter consider old items gone and new
items added. this sounds OK, but the visual effect is that everything
disappears and then reappears, causing flicker.

14 months agosplit new transaction item holder in two
Damyan Ivanov [Tue, 9 Mar 2021 20:11:29 +0000 (22:11 +0200)]
split new transaction item holder in two

one for the header row, another for the account rows

14 months agoclean up unused resources
Damyan Ivanov [Mon, 8 Mar 2021 20:55:53 +0000 (22:55 +0200)]
clean up unused resources

14 months agoТранзакция → Движение навсякъде
Damyan Ivanov [Mon, 8 Mar 2021 20:37:35 +0000 (22:37 +0200)]
Транзакция → Движение навсякъде

14 months agotemplate details delete icon needs to be white
Damyan Ivanov [Mon, 8 Mar 2021 20:03:36 +0000 (22:03 +0200)]
template details delete icon needs to be white

it is shown in the action bar

14 months agominor optimization: avoid constructing empty string object
Damyan Ivanov [Sun, 7 Mar 2021 10:01:35 +0000 (12:01 +0200)]
minor optimization: avoid constructing empty string object

14 months agoreplace TextUtils.equals() usage with Misc.equalStrings()
Damyan Ivanov [Sun, 7 Mar 2021 10:00:45 +0000 (12:00 +0200)]
replace TextUtils.equals() usage with Misc.equalStrings()

equalStrings() considers null to be equal to the empty string

14 months agoimprovements in debug messages
Damyan Ivanov [Sun, 7 Mar 2021 09:43:46 +0000 (11:43 +0200)]
improvements in debug messages

14 months agonote focused item changed when item is moved
Damyan Ivanov [Sun, 7 Mar 2021 09:43:16 +0000 (11:43 +0200)]
note focused item changed when item is moved

14 months agoavoid dataSync when updating entered amount format on losing focus
Damyan Ivanov [Sun, 7 Mar 2021 09:42:50 +0000 (11:42 +0200)]
avoid dataSync when updating entered amount format on losing focus

no back-end data is changed, only the formatted text in the UI

14 months agoalways work with a clone of the live list when checking transaction
Damyan Ivanov [Sun, 7 Mar 2021 09:40:43 +0000 (11:40 +0200)]
always work with a clone of the live list when checking transaction

shortcuts bite back. the codes makes several lists with items from the
checked list and this may mess with the "get-copy-modify-set" actions
when some item in the working list needs to be changed

instead, make a clone (new list, cloned items; except if the input list
is not the live one, i.e. it is a working copy already) and freely
modify its items directly

if the "always clone" approach gets slow, this whole process may be
moved to a thread

also, note focus has moved when a item above the focused item is removed

14 months agohandle menu items click hooks by code in new transaction activity
Damyan Ivanov [Sun, 7 Mar 2021 09:16:34 +0000 (11:16 +0200)]
handle menu items click hooks by code in new transaction activity

14 months agoadd divider after debug items in the new transaction menu
Damyan Ivanov [Sun, 7 Mar 2021 09:09:03 +0000 (11:09 +0200)]
add divider after debug items in the new transaction menu

also, call super.onCreateOptionsMenu to let the system put any system
menu items if needed

also, don't bother with debug menu items in the release build

14 months agofixup: template details help
Damyan Ivanov [Sat, 6 Mar 2021 16:15:01 +0000 (18:15 +0200)]
fixup: template details help

14 months agouse the "black" icon here, this is a menu
Damyan Ivanov [Sat, 6 Mar 2021 16:14:32 +0000 (18:14 +0200)]
use the "black" icon here, this is a menu

14 months agoblack trash icon
Damyan Ivanov [Sat, 6 Mar 2021 16:13:43 +0000 (18:13 +0200)]
black trash icon

for menus

14 months agoprovide some guidance for template parameters
Damyan Ivanov [Sat, 6 Mar 2021 16:11:29 +0000 (18:11 +0200)]
provide some guidance for template parameters

14 months agoHelpDialog: support for markdown-style links in the message
Damyan Ivanov [Sat, 6 Mar 2021 16:08:31 +0000 (18:08 +0200)]
HelpDialog: support for markdown-style links in the message

14 months agomove help dialog in a separate class
Damyan Ivanov [Sat, 6 Mar 2021 07:53:56 +0000 (09:53 +0200)]
move help dialog in a separate class

will be used from other places too

14 months agomulti-line pattern and test text input fields
Damyan Ivanov [Fri, 5 Mar 2021 21:57:01 +0000 (23:57 +0200)]
multi-line pattern and test text input fields

these can get rather long and scrolling is annoying

14 months agoadd help menu for the template list
Damyan Ivanov [Fri, 5 Mar 2021 21:43:59 +0000 (23:43 +0200)]
add help menu for the template list

14 months agodebug++
Damyan Ivanov [Thu, 4 Mar 2021 21:25:37 +0000 (23:25 +0200)]
debug++

14 months agosyncData(): refuse to do anything when not associated with an item
Damyan Ivanov [Thu, 4 Mar 2021 21:24:59 +0000 (23:24 +0200)]
syncData(): refuse to do anything when not associated with an item

this may hapen when the item is swiped out (and loses focus, which may
cause re-setting amount text)

14 months agoavoid crash when removing the currency of a row
Damyan Ivanov [Thu, 4 Mar 2021 21:23:34 +0000 (23:23 +0200)]
avoid crash when removing the currency of a row

14 months agosave a setText() call that would not change anyting
Damyan Ivanov [Thu, 4 Mar 2021 21:22:59 +0000 (23:22 +0200)]
save a setText() call that would not change anyting

14 months agonew account rows are created without amount hint
Damyan Ivanov [Thu, 4 Mar 2021 21:21:33 +0000 (23:21 +0200)]
new account rows are created without amount hint

14 months agodrop improper list copy
Damyan Ivanov [Thu, 4 Mar 2021 21:21:07 +0000 (23:21 +0200)]
drop improper list copy

1) the list shall be copied only when the original is the live list
2) a (proper) list copy is made just a couple of lines earlier

14 months agofix model inconsistency when hiding/showing currency
Damyan Ivanov [Thu, 4 Mar 2021 20:11:42 +0000 (22:11 +0200)]
fix model inconsistency when hiding/showing currency

14 months agodebug++
Damyan Ivanov [Thu, 4 Mar 2021 19:43:21 +0000 (21:43 +0200)]
debug++

14 months agonew transaction: avoid manipulating the FAB directly, use the manager
Damyan Ivanov [Thu, 4 Mar 2021 19:43:08 +0000 (21:43 +0200)]
new transaction: avoid manipulating the FAB directly, use the manager

direct manipulation leads to inconsistency - the manager thinks that the
fab is visible and refuses to show it

14 months agoreset the submittable flag when resetting model state
Damyan Ivanov [Thu, 4 Mar 2021 19:41:32 +0000 (21:41 +0200)]
reset the submittable flag when resetting model state

14 months agoseparate error message text from the rest of the message
Damyan Ivanov [Thu, 4 Mar 2021 19:02:20 +0000 (21:02 +0200)]
separate error message text from the rest of the message

14 months agoremove the focused check before restoring cursor position
Damyan Ivanov [Thu, 4 Mar 2021 17:25:07 +0000 (19:25 +0200)]
remove the focused check before restoring cursor position

the check can fail for some reason, breaking user experience

14 months agomaterial (slightly larger) text sizes in template list
Damyan Ivanov [Thu, 4 Mar 2021 10:37:14 +0000 (10:37 +0000)]
material (slightly larger) text sizes in template list

14 months agoshow hidden FAB after four seconds
Damyan Ivanov [Wed, 3 Mar 2021 21:18:54 +0000 (23:18 +0200)]
show hidden FAB after four seconds

14 months agoreplace unused coordinator layout with constraint layout
Damyan Ivanov [Wed, 3 Mar 2021 20:46:48 +0000 (22:46 +0200)]
replace unused coordinator layout with constraint layout

removing the nested scroll view also makes the behaviour of the FAB not
depend on the number of items in the recycle view

14 months agouse standard height toolbars in main activity and new transaction act.
Damyan Ivanov [Wed, 3 Mar 2021 20:29:43 +0000 (22:29 +0200)]
use standard height toolbars in main activity and new transaction act.

14 months agouse default toolbar height for the templates activity
Damyan Ivanov [Wed, 3 Mar 2021 20:07:05 +0000 (22:07 +0200)]
use default toolbar height for the templates activity

looks better and the extra height is not needed

14 months ago"fix" background of templates toolbar
Damyan Ivanov [Wed, 3 Mar 2021 20:06:21 +0000 (22:06 +0200)]
"fix" background of templates toolbar

this needs a better fix, but the workaround present in the other
activities will do for now

14 months agoinclude "last account" flag in debug output
Damyan Ivanov [Wed, 3 Mar 2021 17:34:43 +0000 (19:34 +0200)]
include "last account" flag in debug output

14 months agoset focus to the transaction description upon UI reset
Damyan Ivanov [Wed, 3 Mar 2021 17:34:23 +0000 (19:34 +0200)]
set focus to the transaction description upon UI reset

for example when the transaction is submitted

14 months agoNT: keep cursor position while setting account name text
Damyan Ivanov [Wed, 3 Mar 2021 17:33:20 +0000 (19:33 +0200)]
NT: keep cursor position while setting account name text

some times the ViewHolder is replaced and the already entred text needs
to be restored. this resets the cursor position to 0, which is rather
uncomfortable while entering text

14 months agoswitch new transaction UI to FabManager
Damyan Ivanov [Wed, 3 Mar 2021 13:30:29 +0000 (15:30 +0200)]
switch new transaction UI to FabManager

14 months agomeasure FAB
Damyan Ivanov [Wed, 3 Mar 2021 13:29:54 +0000 (15:29 +0200)]
measure FAB

requires that it is bottom-aligned to a supported layout

fixes a problem when the FAB needs to be hidden before view are measured
and laid out

14 months agoparent is guaranteed to be a View here, or null
Damyan Ivanov [Wed, 3 Mar 2021 12:35:23 +0000 (14:35 +0200)]
parent is guaranteed to be a View here, or null

14 months agodrop collapsing toolbar layout, plain toolbar is fine
Damyan Ivanov [Wed, 3 Mar 2021 12:32:31 +0000 (12:32 +0000)]
drop collapsing toolbar layout, plain toolbar is fine

same as the other places

14 months agoseparate FAB management in a helper class
Damyan Ivanov [Wed, 3 Mar 2021 12:31:51 +0000 (12:31 +0000)]
separate FAB management in a helper class

CoordinatorLayout + FAB with "hide bottom view on scroll" behaviour
might seem to work, but there is a corner case when the view is just
large enough so that the FAB overlaps it, but not large enough to cause
scrolling and in this case it is possible to either be stuck with the
FAB over the bottom of the business area, or to hide the FAB without an
intuitive to make it pop up again

also, use single FAB for the Templates activity

14 months agodrop last remnants of new transaction bottom padding
Damyan Ivanov [Wed, 3 Mar 2021 07:13:53 +0000 (09:13 +0200)]
drop last remnants of new transaction bottom padding

14 months agoadd divider before fallback templates
Damyan Ivanov [Tue, 2 Mar 2021 21:12:27 +0000 (23:12 +0200)]
add divider before fallback templates

14 months agocheck if transaction is submittable after applying a template
Damyan Ivanov [Tue, 2 Mar 2021 16:57:24 +0000 (18:57 +0200)]
check if transaction is submittable after applying a template

14 months agoTemplates: order fallback templates at the bottom of the list
Damyan Ivanov [Tue, 2 Mar 2021 16:56:14 +0000 (18:56 +0200)]
Templates: order fallback templates at the bottom of the list

14 months agoslight optimization
Damyan Ivanov [Mon, 1 Mar 2021 19:53:46 +0000 (21:53 +0200)]
slight optimization

14 months agofix storing/restoring focus on reconfiguration
Damyan Ivanov [Mon, 1 Mar 2021 19:53:33 +0000 (21:53 +0200)]
fix storing/restoring focus on reconfiguration

14 months agooptimize calls to checkTransactionSubmittable()
Damyan Ivanov [Mon, 1 Mar 2021 17:58:42 +0000 (19:58 +0200)]
optimize calls to checkTransactionSubmittable()

this an expensive function traversing over all rows, so a cheap
avoidance would be nice

14 months agoflag initial amount hint as present (still null)
Damyan Ivanov [Mon, 1 Mar 2021 05:57:58 +0000 (07:57 +0200)]
flag initial amount hint as present (still null)

this avoids unnecessary item replacement manifesting as selection change
when the first letter of the account name is entered

14 months agowhen comparing account rows, ignore amount hints if amount is present
Damyan Ivanov [Sun, 28 Feb 2021 21:27:53 +0000 (23:27 +0200)]
when comparing account rows, ignore amount hints if amount is present

avoids unnecessary view holder update, possibly messing with the amount
being entered

14 months agoformat amounts when the input field loses focus
Damyan Ivanov [Sun, 28 Feb 2021 21:26:26 +0000 (23:26 +0200)]
format amounts when the input field loses focus

previously this relied on an update via the model

14 months agofix IME hints for amount inputs
Damyan Ivanov [Sun, 28 Feb 2021 20:42:00 +0000 (22:42 +0200)]
fix IME hints for amount inputs

14 months agofocus the first amount after loading a previous transaction
Damyan Ivanov [Sun, 28 Feb 2021 17:32:55 +0000 (19:32 +0200)]
focus the first amount after loading a previous transaction

14 months agonew-transaction: avoid auto-completion pop-ups when applying data
Damyan Ivanov [Sun, 28 Feb 2021 17:32:34 +0000 (19:32 +0200)]
new-transaction: avoid auto-completion pop-ups when applying data

the data comes from the model, i.e. either from an applied template or
loading of a previous transaction (auto-completion of transaction
description)

14 months agofix removal of empty transaction rows after the major rework
Damyan Ivanov [Sun, 28 Feb 2021 17:06:03 +0000 (19:06 +0200)]
fix removal of empty transaction rows after the major rework

14 months agofix sending empty transaction comments as "", not as null
Damyan Ivanov [Sun, 28 Feb 2021 16:55:53 +0000 (18:55 +0200)]
fix sending empty transaction comments as "", not as null

null causes a '400 expecting String, found Null'

14 months agoavoid crash when there is no information about focused element
Damyan Ivanov [Sun, 28 Feb 2021 16:55:00 +0000 (18:55 +0200)]
avoid crash when there is no information about focused element

observed when sending the transaction to the backend throws an exception

14 months agonew transaction: replace bottom filler with scroll FAB behaviour
Damyan Ivanov [Sat, 27 Feb 2021 20:27:30 +0000 (22:27 +0200)]
new transaction: replace bottom filler with scroll FAB behaviour

code becomes more consistent when the last item in the list is not a
special case

and FAB UI behaviour also becomes consistent with the rest of the app

14 months agorework new transaction activity/model/etc with proper concept separation
Damyan Ivanov [Sat, 27 Feb 2021 20:06:18 +0000 (20:06 +0000)]
rework new transaction activity/model/etc with proper concept separation

activity monitors the model and sends changes to adapter; view holder
propagates changes to the model

this makes it possible to properly handle QR scan results in the
activity without dirty tricks

14 months agomove sample text scanning to the template activity
Damyan Ivanov [Sun, 21 Feb 2021 10:30:25 +0000 (12:30 +0200)]
move sample text scanning to the template activity

the initial idea was to have an abstract fragment class that could
handle the details about launching the QR scanner and accept the result.

however, the right place to do this is the activity, because only an
activity can receive the scan result, and launch the QR app.

Before, this was worked around by a LiveData thing that the activity
observed, and which the "Scan" buttons triggered. This has a nasty side
effect that the LiveData is triggered whenever the activity is
re-instantiated

14 months agoaccount name auto-complete: convert input to upper case
Damyan Ivanov [Sun, 21 Feb 2021 10:13:18 +0000 (12:13 +0200)]
account name auto-complete: convert input to upper case

the database uses case_sensitive_like pragma for other reasons, so
thi lookup query needs to be adapted. this wasn't a problem before
the adoption of Room for database structure migration with all the
connection-level pragmas, used by the account storage part

14 months agobump version (name and code)
Damyan Ivanov [Sat, 20 Feb 2021 12:23:28 +0000 (14:23 +0200)]
bump version (name and code)

14 months agoRoom takes over DB migrations
Damyan Ivanov [Sat, 20 Feb 2021 06:49:45 +0000 (08:49 +0200)]
Room takes over DB migrations

14 months agodescribe transaction_accounts to Room
Damyan Ivanov [Fri, 19 Feb 2021 16:37:56 +0000 (16:37 +0000)]
describe transaction_accounts to Room

14 months agodescribe transactions to Room
Damyan Ivanov [Fri, 19 Feb 2021 16:31:28 +0000 (16:31 +0000)]
describe transactions to Room

14 months agoinitialize Room after all legacy upgrading is done
Damyan Ivanov [Fri, 19 Feb 2021 16:23:38 +0000 (16:23 +0000)]
initialize Room after all legacy upgrading is done

this is here until all database tables are described in Room and the
structure changes can be migrated too Room too.

14 months agodescribe description_history to Room
Damyan Ivanov [Fri, 19 Feb 2021 16:20:13 +0000 (16:20 +0000)]
describe description_history to Room

14 months agodescribe account_values to Room
Damyan Ivanov [Fri, 19 Feb 2021 16:15:47 +0000 (16:15 +0000)]
describe account_values to Room

14 months agodescribe options to Room
Damyan Ivanov [Thu, 18 Feb 2021 20:37:25 +0000 (22:37 +0200)]
describe options to Room

14 months agodescribe profiles for Room
Damyan Ivanov [Thu, 18 Feb 2021 20:26:02 +0000 (22:26 +0200)]
describe profiles for Room

14 months agoremove unnecessary qualification
Damyan Ivanov [Thu, 18 Feb 2021 19:21:00 +0000 (21:21 +0200)]
remove unnecessary qualification

14 months agooffer fallback templates only when no other template matches
Damyan Ivanov [Thu, 18 Feb 2021 19:17:33 +0000 (21:17 +0200)]
offer fallback templates only when no other template matches

14 months agomore pattern → template renaming
Damyan Ivanov [Thu, 18 Feb 2021 19:10:12 +0000 (21:10 +0200)]
more pattern → template renaming

14 months agofix crash when there is no test text and the pattern is tested
Damyan Ivanov [Thu, 18 Feb 2021 19:08:17 +0000 (21:08 +0200)]
fix crash when there is no test text and the pattern is tested

14 months agoanother approach at supporting multi-line SQL statements
Damyan Ivanov [Thu, 18 Feb 2021 18:41:41 +0000 (20:41 +0200)]
another approach at supporting multi-line SQL statements

14 months agowhitespace
Damyan Ivanov [Thu, 18 Feb 2021 17:43:17 +0000 (19:43 +0200)]
whitespace

14 months agonot boolean, integer
Damyan Ivanov [Thu, 18 Feb 2021 17:43:09 +0000 (19:43 +0200)]
not boolean, integer

for room compatibility

14 months agoadd fallback flag to templates
Damyan Ivanov [Thu, 18 Feb 2021 17:42:40 +0000 (19:42 +0200)]
add fallback flag to templates

14 months agoslightly easier account item rearrangement
Damyan Ivanov [Mon, 8 Feb 2021 06:12:22 +0000 (06:12 +0000)]
slightly easier account item rearrangement

14 months agono need for gravity, only one edge is constrained anyway
Damyan Ivanov [Mon, 8 Feb 2021 06:08:39 +0000 (06:08 +0000)]
no need for gravity, only one edge is constrained anyway

14 months agodebug++
Damyan Ivanov [Mon, 8 Feb 2021 06:07:50 +0000 (06:07 +0000)]
debug++

14 months agotemplate details: ensure single empty account when account data is changed
Damyan Ivanov [Mon, 8 Feb 2021 06:07:24 +0000 (06:07 +0000)]
template details: ensure single empty account when account data is changed

14 months agomember rearrangement
Damyan Ivanov [Mon, 8 Feb 2021 06:06:28 +0000 (06:06 +0000)]
member rearrangement

14 months agodebug++
Damyan Ivanov [Mon, 8 Feb 2021 06:06:17 +0000 (06:06 +0000)]
debug++

14 months agomodel: adjust items' positions when an item is removed
Damyan Ivanov [Mon, 8 Feb 2021 06:05:54 +0000 (06:05 +0000)]
model: adjust items' positions when an item is removed

14 months agomodel: adjust items' positions when an item is moved
Damyan Ivanov [Mon, 8 Feb 2021 06:05:17 +0000 (06:05 +0000)]
model: adjust items' positions when an item is moved

14 months agomodel: reorder account rows by their position
Damyan Ivanov [Mon, 8 Feb 2021 06:01:32 +0000 (06:01 +0000)]
model: reorder account rows by their position

it is stupid that this cannot be achieved in Room

14 months agomodel: ensure exactly one empty account row
Damyan Ivanov [Mon, 8 Feb 2021 05:58:50 +0000 (05:58 +0000)]
model: ensure exactly one empty account row

also properly apply the check after removing an item. the intermediate
items.setValue(newList) is complete unnecessary

also make the check when receiving items from the database

14 months agotemplate details model: method for creating a copy of the data list
Damyan Ivanov [Mon, 8 Feb 2021 05:56:11 +0000 (05:56 +0000)]
template details model: method for creating a copy of the data list

this is a clone-like list, that shares no common objects with the original
needed so that any changes to it do not touch the original items and
differ discovers the changes

14 months agoadapter/debug: dump new item list
Damyan Ivanov [Mon, 8 Feb 2021 05:53:22 +0000 (05:53 +0000)]
adapter/debug: dump new item list

14 months agodrop unused method
Damyan Ivanov [Mon, 8 Feb 2021 05:52:53 +0000 (05:52 +0000)]
drop unused method

14 months agoposition becomes plain long (not Long)
Damyan Ivanov [Mon, 8 Feb 2021 05:51:54 +0000 (05:51 +0000)]
position becomes plain long (not Long)

14 months agoAccountRow.isEmpty(): is this a disposable empty row?
Damyan Ivanov [Mon, 8 Feb 2021 05:50:38 +0000 (05:50 +0000)]
AccountRow.isEmpty(): is this a disposable empty row?

i.e., without account name/comment/amount source/value