while (!interrupted()) {
try {
DbOpItem item = queue.take();
- debug("opQrunner", "Got " + item.sql);
+ debug("opQRunner", "Got " + item.sql);
{
SQLiteDatabase db = App.getDatabase();
if (BuildConfig.DEBUG) {
}
b.append("]");
}
- debug("opQrunner", b.toString());
+ debug("opQRunner", b.toString());
}
db.execSQL(item.sql, item.params);
}
protected String error;
private String token;
private String session;
- private LedgerTransaction ltr;
+ private LedgerTransaction transaction;
private MobileLedgerProfile mProfile;
private boolean simulate = false;
http.setRequestProperty("Accept", "*/*");
net.ktnx.mobileledger.json.v1_15.ParsedLedgerTransaction jsonTransaction =
- net.ktnx.mobileledger.json.v1_15.ParsedLedgerTransaction.fromLedgerTransaction(ltr);
+ net.ktnx.mobileledger.json.v1_15.ParsedLedgerTransaction.fromLedgerTransaction(
+ transaction);
ObjectMapper mapper = new ObjectMapper();
ObjectWriter writer =
mapper.writerFor(net.ktnx.mobileledger.json.v1_15.ParsedLedgerTransaction.class);
http.setRequestProperty("Accept", "*/*");
net.ktnx.mobileledger.json.v1_14.ParsedLedgerTransaction jsonTransaction =
- net.ktnx.mobileledger.json.v1_14.ParsedLedgerTransaction.fromLedgerTransaction(ltr);
+ net.ktnx.mobileledger.json.v1_14.ParsedLedgerTransaction.fromLedgerTransaction(
+ transaction);
ObjectMapper mapper = new ObjectMapper();
ObjectWriter writer =
mapper.writerFor(net.ktnx.mobileledger.json.v1_14.ParsedLedgerTransaction.class);
if (token != null)
params.addPair("_token", token);
- SimpleDate transactionDate = ltr.getDate();
+ SimpleDate transactionDate = transaction.getDate();
if (transactionDate == null) {
transactionDate = SimpleDate.today();
}
params.addPair("date", Globals.formatLedgerDate(transactionDate));
- params.addPair("description", ltr.getDescription());
- for (LedgerTransactionAccount acc : ltr.getAccounts()) {
+ params.addPair("description", transaction.getDescription());
+ for (LedgerTransactionAccount acc : transaction.getAccounts()) {
params.addPair("account", acc.getAccountName());
if (acc.isAmountSet())
params.addPair("amount", String.format(Locale.US, "%1.2f", acc.getAmount()));
protected Void doInBackground(LedgerTransaction... ledgerTransactions) {
error = null;
try {
- ltr = ledgerTransactions[0];
+ transaction = ledgerTransactions[0];
switch (mProfile.getApiVersion()) {
case auto:
AlertDialog dialog = builder.create();
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
- public void onShow(DialogInterface dialogIinterface) {
+ public void onShow(DialogInterface dialogInterface) {
dialog.getButton(AlertDialog.BUTTON_NEUTRAL)
.setOnClickListener(new View.OnClickListener() {
@Override
import net.ktnx.mobileledger.utils.DimensionUtils;
public class MobileLedgerListFragment extends Fragment {
- public SwipeRefreshLayout swiper;
+ public SwipeRefreshLayout refreshLayout;
public TransactionListAdapter modelAdapter;
protected RecyclerView root;
@NonNull
return (MainActivity) requireActivity();
}
protected void themeChanged(Integer counter) {
- swiper.setColorSchemeColors(Colors.getSwipeCircleColors());
+ refreshLayout.setColorSchemeColors(Colors.getSwipeCircleColors());
}
public void onBackgroundTaskRunningChanged(Boolean isRunning) {
if (getActivity() == null)
return;
- if (swiper == null)
+ if (refreshLayout == null)
return;
- swiper.setRefreshing(isRunning);
+ refreshLayout.setRefreshing(isRunning);
}
protected void manageFabOnScroll() {
final MainActivity mainActivity = getMainActivity();
manageFabOnScroll();
- swiper = mainActivity.findViewById(R.id.account_swiper);
+ refreshLayout = mainActivity.findViewById(R.id.account_swipe_refresh_layout);
Colors.themeWatch.observe(getViewLifecycleOwner(), this::themeChanged);
- swiper.setOnRefreshListener(() -> {
+ refreshLayout.setOnRefreshListener(() -> {
debug("ui", "refreshing accounts via swipe");
Data.scheduleTransactionListRetrieval(mainActivity);
});
this.recyclerView = null;
}
public void descriptionSelected(String description) {
- debug("descr selected", description);
+ debug("description selected", description);
if (!accountListIsEmpty())
return;
sb.append(" ORDER BY t.year desc, t.month desc, t.day desc LIMIT 1");
final String sql = sb.toString();
- debug("descr", sql);
- debug("descr", params.toString());
+ debug("description", sql);
+ debug("description", params.toString());
Activity activity = (Activity) recyclerView.getContext();
// FIXME: handle exceptions?
if (Misc.isEmptyOrNull(accFilter))
return;
- debug("descr", "Trying transaction search without preferred account filter");
+ debug("description", "Trying transaction search without preferred account filter");
final String broaderSql =
"select t.profile, t.id from transactions t where t.description=?" +
" ORDER BY year desc, month desc, day desc LIMIT 1";
params.remove(1);
- debug("descr", broaderSql);
- debug("descr", description);
+ debug("description", broaderSql);
+ debug("description", description);
activity.runOnUiThread(() -> {
Snackbar.make(recyclerView, R.string.ignoring_preferred_account,
if (mProfile.equals(Data.getProfile()))
Data.setCurrentProfile(newProfile);
}
- private void hookTextChangeSyncRoutine(TextView view, TextChangeSyncProc syncRoutine) {
+ private void hookTextChangeSyncRoutine(TextView view, TextChangeSyncRoutine syncRoutine) {
view.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
defaultCommodity.setText(name);
defaultCommodity.setTypeface(Typeface.DEFAULT);
}
- interface TextChangeSyncProc {
+ interface TextChangeSyncRoutine {
void onTextChanged(String text);
}
}
MainActivity mainActivity = getMainActivity();
- swiper = mainActivity.findViewById(R.id.transaction_swipe);
- if (swiper == null)
+ refreshLayout = mainActivity.findViewById(R.id.transaction_swipe);
+ if (refreshLayout == null)
throw new RuntimeException("Can't get hold on the swipe layout");
root = mainActivity.findViewById(R.id.transaction_root);
if (root == null)
llm.setOrientation(RecyclerView.VERTICAL);
root.setLayoutManager(llm);
- swiper.setOnRefreshListener(() -> {
+ refreshLayout.setOnRefreshListener(() -> {
debug("ui", "refreshing transactions via swipe");
Data.scheduleTransactionListRetrieval(mainActivity);
});
Data.accountFilter.observe(getViewLifecycleOwner(), this::onAccountNameFilterChanged);
TransactionListViewModel.updating.addObserver(
- (o, arg) -> swiper.setRefreshing(TransactionListViewModel.updating.get()));
+ (o, arg) -> refreshLayout.setRefreshing(TransactionListViewModel.updating.get()));
TransactionListViewModel.updateError.addObserver((o, arg) -> {
String err = TransactionListViewModel.updateError.get();
if (err == null)
>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
- android:id="@+id/account_swiper"
+ android:id="@+id/account_swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<string name="zero_amount">0.00</string>
<string name="new_transaction_saving">Saving…</string>
<string name="simulate_save_label">Simulate save requests</string>
- <string name="simulate_save_condensed_label">Simul. save</string>
+ <string name="simulate_save_condensed_label">Simulate saves</string>
<string name="simulation_label">SIMULATION</string>
<string name="profile_future_dates_label">Allow input of dates in the future</string>
<string name="future_dates_none">No future dates are allowed</string>
* NEW:
- App shortcuts for starting the new transaction activity on Android 7.1+
- - Auto-filling of the accounts in the new transaction screen can be limitted to the transactions using accounts corresponding to a filter -- the filter is set in the profile details
+ - Auto-filling of the accounts in the new transaction screen can be limited to the transactions using accounts corresponding to a filter -- the filter is set in the profile details
* IMPROVED:
- Account list: Accounts with many commodities have their commodity list collapsed to avoid filling too much of the screen with one account
- Account list: Viewing account's transactions migrated to a context menu
* SECURITY
+ avoid exposing basic HTTP authentication to wifi portals
+ profile editor: warn when using authentication with insecure HTTP scheme
- + permit cleartext HTTP traffic on Android 8+ (still, please use HTTPS to keep yout data safe while in transit)
+ + permit cleartext HTTP traffic on Android 8+ (still, please use HTTPS to keep your data safe while in transit)
* IMPROVEMENTS
+ clarify that crash reports are sent via email and user can review them before sending
+ allow toggling password visibility in profile details
* FIXES:
+ fixed crash when parsing posting flags with hledger-web before 1.14
+ visual fixes
- + fix numerical entry with some samsung keyboards
+ + fix numerical entry with some Samsung keyboards
+ show transaction-level comment in transaction list
+ scroll to a specific date in the transaction list
* IMPROVEMENTS
- + better all-around theming; employ some material design recommendations
+ + better all-around theme integration; employ some material design recommendations
+ follow system-wide font size settings
* FIXES
+ fix a crash in legacy parser with amounts like '$123.45'