Resources rm = getResources();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Resources.Theme theme = getTheme();
- Globals.table_row_odd_bg = rm.getColor(R.color.table_row_odd_bg, theme);
- Globals.table_row_even_bg = rm.getColor(R.color.table_row_even_bg, theme);
+ Globals.tableRowOddBG = rm.getColor(R.color.table_row_odd_bg, theme);
+ Globals.tableRowEvenBG = rm.getColor(R.color.table_row_even_bg, theme);
Globals.primaryDark = rm.getColor(R.color.design_default_color_primary_dark, theme);
Globals.defaultTextColor = rm.getColor(android.R.color.tab_indicator_text, theme);
}
else {
- Globals.table_row_odd_bg = rm.getColor(R.color.table_row_odd_bg);
- Globals.table_row_even_bg = rm.getColor(R.color.table_row_even_bg);
+ Globals.tableRowOddBG = rm.getColor(R.color.table_row_odd_bg);
+ Globals.tableRowEvenBG = rm.getColor(R.color.table_row_even_bg);
Globals.primaryDark = rm.getColor(R.color.design_default_color_primary_dark);
Globals.defaultTextColor = rm.getColor(android.R.color.tab_indicator_text);
}
public class RetrieveTransactionsTask
extends AsyncTask<Void, RetrieveTransactionsTask.Progress, Void> {
private static final int MATCHING_TRANSACTIONS_LIMIT = 50;
- private static final Pattern commentPattern = Pattern.compile("^\\s*;");
- private static final Pattern transactionStartPattern = Pattern.compile("<tr class=\"title\" " +
- "id=\"transaction-(\\d+)\"><td class=\"date\"[^\"]*>([\\d.-]+)</td>");
- private static final Pattern transactionDescriptionPattern =
+ private static final Pattern reComment = Pattern.compile("^\\s*;");
+ private static final Pattern reTransactionStart = Pattern.compile("<tr class=\"title\" " +
+ "id=\"transaction-(\\d+)\"><td class=\"date\"[^\"]*>([\\d.-]+)</td>");
+ private static final Pattern reTransactionDescription =
Pattern.compile("<tr class=\"posting\" title=\"(\\S+)\\s(.+)");
- private static final Pattern transactionDetailsPattern =
+ private static final Pattern reTransactionDetails =
Pattern.compile("^\\s+(\\S[\\S\\s]+\\S)\\s\\s+([-+]?\\d[\\d,.]*)(?:\\s+(\\S+)$)?");
- private static final Pattern endPattern = Pattern.compile("\\bid=\"addmodal\"");
+ private static final Pattern reEnd = Pattern.compile("\\bid=\"addmodal\"");
private WeakReference<MainActivity> contextRef;
private int error;
// %3A is '='
private boolean success;
- private Pattern account_name_re = Pattern.compile("/register\\?q=inacct%3A([a-zA-Z0-9%]+)\"");
- private Pattern account_value_re = Pattern.compile(
+ private Pattern reAccountName = Pattern.compile("/register\\?q=inacct%3A([a-zA-Z0-9%]+)\"");
+ private Pattern reAccountValue = Pattern.compile(
"<span class=\"[^\"]*\\bamount\\b[^\"]*\">\\s*([-+]?[\\d.,]+)(?:\\s+(\\S+))?</span>");
public RetrieveTransactionsTask(WeakReference<MainActivity> contextRef) {
this.contextRef = contextRef;
boolean onlyStarred = Data.optShowOnlyStarred.get();
Data.backgroundTaskCount.incrementAndGet();
try {
- HttpURLConnection http = NetworkUtil.prepare_connection("journal");
+ HttpURLConnection http = NetworkUtil.prepareConnection("journal");
http.setAllowUserInteraction(false);
publishProgress(progress);
MainActivity ctx = getContext();
while ((line = buf.readLine()) != null) {
throwIfCancelled();
Matcher m;
- m = commentPattern.matcher(line);
+ m = reComment.matcher(line);
if (m.find()) {
// TODO: comments are ignored for now
Log.v("transaction-parser", "Ignoring comment");
Data.accounts.set(accountList);
continue;
}
- m = account_name_re.matcher(line);
+ m = reAccountName.matcher(line);
if (m.find()) {
String acct_encoded = m.group(1);
String acct_name = URLDecoder.decode(acct_encoded, "UTF-8");
break;
case EXPECTING_ACCOUNT_AMOUNT:
- m = account_value_re.matcher(line);
+ m = reAccountValue.matcher(line);
boolean match_found = false;
while (m.find()) {
throwIfCancelled();
case EXPECTING_TRANSACTION:
if (!line.isEmpty() && (line.charAt(0) == ' ')) continue;
- m = transactionStartPattern.matcher(line);
+ m = reTransactionStart.matcher(line);
if (m.find()) {
transactionId = Integer.valueOf(m.group(1));
state = ParserState.EXPECTING_TRANSACTION_DESCRIPTION;
progress.setTotal(transactionId);
publishProgress(progress);
}
- m = endPattern.matcher(line);
+ m = reEnd.matcher(line);
if (m.find()) {
L("--- transaction value complete ---");
success = true;
case EXPECTING_TRANSACTION_DESCRIPTION:
if (!line.isEmpty() && (line.charAt(0) == ' ')) continue;
- m = transactionDescriptionPattern.matcher(line);
+ m = reTransactionDescription.matcher(line);
if (m.find()) {
if (transactionId == 0)
throw new TransactionParserException(
// }
}
else {
- m = transactionDetailsPattern.matcher(line);
+ m = reTransactionDetails.matcher(line);
if (m.find()) {
String acc_name = m.group(1);
String amount = m.group(2);
import static java.lang.Thread.sleep;
public class SaveTransactionTask extends AsyncTask<LedgerTransaction, Void, Void> {
- private final TaskCallback task_callback;
+ private final TaskCallback taskCallback;
private String token;
private String session;
- private String backend_url;
+ private String backendUrl;
private LedgerTransaction ltr;
protected String error;
public SaveTransactionTask(TaskCallback callback) {
- task_callback = callback;
+ taskCallback = callback;
}
- private boolean send_ok() throws IOException {
- HttpURLConnection http = NetworkUtil.prepare_connection("add");
+ private boolean sendOK() throws IOException {
+ HttpURLConnection http = NetworkUtil.prepareConnection("add");
http.setRequestMethod("POST");
http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
http.setRequestProperty("Accept", "*/*");
http.setDoInput(true);
UrlEncodedFormData params = new UrlEncodedFormData();
- params.add_pair("_formid", "identify-add");
- if (token != null) params.add_pair("_token", token);
- params.add_pair("date", ltr.getDate());
- params.add_pair("description", ltr.getDescription());
+ params.addPair("_formid", "identify-add");
+ if (token != null) params.addPair("_token", token);
+ params.addPair("date", ltr.getDate());
+ params.addPair("description", ltr.getDescription());
for (LedgerTransactionAccount acc : ltr.getAccounts()) {
- params.add_pair("account", acc.getAccountName());
+ params.addPair("account", acc.getAccountName());
if (acc.isAmountSet())
- params.add_pair("amount", String.format(Locale.US, "%1.2f", acc.getAmount()));
- else params.add_pair("amount", "");
+ params.addPair("amount", String.format(Locale.US, "%1.2f", acc.getAmount()));
+ else params.addPair("amount", "");
}
String body = params.toString();
} else if (http.getResponseCode() == 200) {
// get the new cookie
{
- Pattern sess_cookie_re = Pattern.compile("_SESSION=([^;]+);.*");
+ Pattern reSessionCookie = Pattern.compile("_SESSION=([^;]+);.*");
Map<String, List<String>> header = http.getHeaderFields();
- List<String> cookie_header = header.get("Set-Cookie");
- if (cookie_header != null) {
- String cookie = cookie_header.get(0);
- Matcher m = sess_cookie_re.matcher(cookie);
+ List<String> cookieHeader = header.get("Set-Cookie");
+ if (cookieHeader != null) {
+ String cookie = cookieHeader.get(0);
+ Matcher m = reSessionCookie.matcher(cookie);
if (m.matches()) {
session = m.group(1);
Log.d("network", "new session is " + session);
protected Void doInBackground(LedgerTransaction... ledgerTransactions) {
error = null;
try {
- backend_url = Data.profile.get().getUrl();
+ backendUrl = Data.profile.get().getUrl();
ltr = ledgerTransactions[0];
int tried = 0;
- while (!send_ok()) {
+ while (!sendOK()) {
try {
tried++;
if (tried >= 2)
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
- task_callback.done(error);
+ taskCallback.done(error);
}
}
new ObservableList<>(new ArrayList<>());
public static ObservableValue<Boolean> optShowOnlyStarred = new ObservableValue<>();
public static void setCurrentProfile(MobileLedgerProfile newProfile) {
- MLDB.set_option_value(MLDB.OPT_PROFILE_UUID, newProfile.getUuid());
+ MLDB.setOption(MLDB.OPT_PROFILE_UUID, newProfile.getUuid());
profile.set(newProfile);
}
}
/*
- * Copyright © 2018 Damyan Ivanov.
+ * Copyright © 2019 Damyan Ivanov.
* This file is part of Mobile-Ledger.
* Mobile-Ledger is free software: you can distribute it and/or modify it
* under the term of the GNU General Public License as published by
private boolean hidden;
private boolean hiddenToBe;
private List<LedgerAmount> amounts;
- static Pattern higher_account = Pattern.compile("^[^:]+:");
+ static Pattern reHigherAccount = Pattern.compile("^[^:]+:");
public LedgerAccount(String name) {
this.setName(name);
shortName = name;
StringBuilder parentBuilder = new StringBuilder();
while (true) {
- Matcher m = higher_account.matcher(shortName);
+ Matcher m = reHigherAccount.matcher(shortName);
if (m.find()) {
level++;
parentBuilder.append(m.group(0));
Data.profiles.setList(MobileLedgerProfile.loadAllFromDB());
MobileLedgerProfile profile = null;
- String profileUUID = MLDB.get_option_value(MLDB.OPT_PROFILE_UUID, null);
+ String profileUUID = MLDB.getOption(MLDB.OPT_PROFILE_UUID, null);
if (profileUUID == null) {
if (Data.profiles.isEmpty()) {
Data.profiles.setList(MobileLedgerProfile.createInitialProfileList());
startActivity(intent, args);
}
}
- public void fab_new_transaction_clicked(View view) {
+ public void fabNewTransactionClicked(View view) {
Intent intent = new Intent(this, NewTransactionActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.slide_in_right, R.anim.dummy);
}
- public void nav_exit_clicked(View view) {
+ public void navExitClicked(View view) {
Log.w("app", "exiting");
finish();
}
- public void nav_settings_clicked(View view) {
+ public void navSettingsClicked(View view) {
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
drawer.closeDrawers();
progressBar.setIndeterminate(false);
}
}
- public void nav_profiles_clicked(View view) {
+ public void navProfilesClicked(View view) {
drawer.closeDrawers();
Intent intent = new Intent(this, ProfileListActivity.class);
startActivity(intent);
private static SaveTransactionTask saver;
private TableLayout table;
private ProgressBar progress;
- private TextView text_date;
- private AutoCompleteTextView text_descr;
+ private TextView tvDate;
+ private AutoCompleteTextView tvDescription;
private MenuItem mSave;
-
+ private static boolean isZero(float f) {
+ return (f < 0.005) && (f > -0.005);
+ }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
- text_date = findViewById(R.id.new_transaction_date);
- text_date.setOnFocusChangeListener((v, hasFocus) -> {
+ tvDate = findViewById(R.id.new_transaction_date);
+ tvDate.setOnFocusChangeListener((v, hasFocus) -> {
if (hasFocus) pickTransactionDate(v);
});
- text_descr = findViewById(R.id.new_transaction_description);
- MLDB.hook_autocompletion_adapter(this, text_descr, MLDB.DESCRIPTION_HISTORY_TABLE,
+ tvDescription = findViewById(R.id.new_transaction_description);
+ MLDB.hookAutocompletionAdapter(this, tvDescription, MLDB.DESCRIPTION_HISTORY_TABLE,
"description", false, findViewById(R.id.new_transaction_acc_1));
- hook_text_change_listener(text_descr);
+ hookTextChangeListener(tvDescription);
progress = findViewById(R.id.save_transaction_progress);
table = findViewById(R.id.new_transaction_accounts_table);
for (int i = 0; i < table.getChildCount(); i++) {
TableRow row = (TableRow) table.getChildAt(i);
- AutoCompleteTextView acc_name_view = (AutoCompleteTextView) row.getChildAt(0);
- TextView amount_view = (TextView) row.getChildAt(1);
- hook_swipe_listener(row);
- MLDB.hook_autocompletion_adapter(this, acc_name_view, MLDB.ACCOUNTS_TABLE, "name", true,
- amount_view);
- hook_text_change_listener(acc_name_view);
- hook_text_change_listener(amount_view);
+ AutoCompleteTextView tvAccountName = (AutoCompleteTextView) row.getChildAt(0);
+ TextView tvAmount = (TextView) row.getChildAt(1);
+ hookSwipeListener(row);
+ MLDB.hookAutocompletionAdapter(this, tvAccountName, MLDB.ACCOUNTS_TABLE, "name", true,
+ tvAmount);
+ hookTextChangeListener(tvAccountName);
+ hookTextChangeListener(tvAmount);
// Log.d("swipe", "hooked to row "+i);
}
}
- @Override
- protected void onStart() {
- super.onStart();
- if (text_descr.getText().toString().isEmpty()) text_descr.requestFocus();
- }
-
@Override
public void finish() {
super.finish();
}
return super.onOptionsItemSelected(item);
}
-
- public void save_transaction() {
+ @Override
+ protected void onStart() {
+ super.onStart();
+ if (tvDescription.getText().toString().isEmpty()) tvDescription.requestFocus();
+ }
+ public void saveTransaction() {
if (mSave != null) mSave.setVisible(false);
- toggle_all_editing(false);
+ toggleAllEditing(false);
progress.setVisibility(View.VISIBLE);
saver = new SaveTransactionTask(this);
- String date = text_date.getText().toString();
+ String date = tvDate.getText().toString();
if (date.isEmpty()) date = String.valueOf(new Date().getDate());
- LedgerTransaction tr = new LedgerTransaction(date, text_descr.getText().toString());
+ LedgerTransaction tr = new LedgerTransaction(date, tvDescription.getText().toString());
TableLayout table = findViewById(R.id.new_transaction_accounts_table);
for (int i = 0; i < table.getChildCount(); i++) {
}
saver.execute(tr);
}
-
- private void toggle_all_editing(boolean enabled) {
- text_date.setEnabled(enabled);
- text_descr.setEnabled(enabled);
+ private void toggleAllEditing(boolean enabled) {
+ tvDate.setEnabled(enabled);
+ tvDescription.setEnabled(enabled);
TableLayout table = findViewById(R.id.new_transaction_accounts_table);
for (int i = 0; i < table.getChildCount(); i++) {
TableRow row = (TableRow) table.getChildAt(i);
}
}
}
-
- private void hook_swipe_listener(final TableRow row) {
+ private void hookSwipeListener(final TableRow row) {
row.getChildAt(0).setOnTouchListener(new OnSwipeTouchListener(this) {
public void onSwipeLeft() {
// Log.d("swipe", "LEFT" + row.getId());
TableRow prev_row = (TableRow) table.getChildAt(table.indexOfChild(row) - 1);
TableRow next_row = (TableRow) table.getChildAt(table.indexOfChild(row) + 1);
TextView prev_amt =
- (prev_row != null) ? (TextView) prev_row.getChildAt(1) : text_descr;
+ (prev_row != null) ? (TextView) prev_row.getChildAt(1) : tvDescription;
TextView next_acc =
(next_row != null) ? (TextView) next_row.getChildAt(0) : null;
});
}
- private void hook_text_change_listener(final TextView view) {
- view.addTextChangedListener(new TextWatcher() {
- @Override
- public void beforeTextChanged(CharSequence s, int start, int count, int after) {
-
- }
-
- @Override
- public void onTextChanged(CharSequence s, int start, int before, int count) {
-
- }
-
- @Override
- public void afterTextChanged(Editable s) {
-// Log.d("input", "text changed");
- check_transaction_submittable();
- }
- });
-
- }
-
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.new_transaction, menu);
return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
getResources().getDisplayMetrics()));
}
+ private void hookTextChangeListener(final TextView view) {
+ view.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+
+ }
- private void do_add_account_row(boolean focus) {
+ @Override
+ public void afterTextChanged(Editable s) {
+// Log.d("input", "text changed");
+ check_transaction_submittable();
+ }
+ });
+
+ }
+ private void doAddAccountRow(boolean focus) {
final AutoCompleteTextView acc = new AutoCompleteTextView(this);
acc.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT,
TableRow.LayoutParams.WRAP_CONTENT, 9f));
if (focus) acc.requestFocus();
- hook_swipe_listener(row);
- MLDB.hook_autocompletion_adapter(this, acc, MLDB.ACCOUNTS_TABLE, "name", true, amt);
- hook_text_change_listener(acc);
- hook_text_change_listener(amt);
+ hookSwipeListener(row);
+ MLDB.hookAutocompletionAdapter(this, acc, MLDB.ACCOUNTS_TABLE, "name", true, amt);
+ hookTextChangeListener(acc);
+ hookTextChangeListener(amt);
}
-
public void addTransactionAccountFromMenu(MenuItem item) {
- do_add_account_row(true);
+ doAddAccountRow(true);
}
-
public void resetTransactionFromMenu(MenuItem item) {
- reset_form();
+ resetForm();
}
-
public void saveTransactionFromMenu(MenuItem item) {
- save_transaction();
+ saveTransaction();
}
-
- private boolean is_zero(float f) {
- return (f < 0.005) && (f > -0.005);
- }
-
// rules:
// 1) at least two account names
// 2) each amount must have account name
if ((empty_rows == 0) &&
((table.getChildCount() == accounts) || (table.getChildCount() == amounts)))
{
- do_add_account_row(false);
+ doAddAccountRow(false);
}
Log.d("submittable", String.format("accounts=%d, accounts_with_values=%s, " +
if (have_description && (accounts >= 2) && (accounts_with_values >= (accounts - 1)) &&
(amounts_with_accounts == amounts) &&
- (single_empty_amount && single_empty_amount_has_account || is_zero(running_total)))
+ (single_empty_amount && single_empty_amount_has_account || isZero(running_total)))
{
if (mSave != null) mSave.setVisible(true);
}
progress.setVisibility(View.INVISIBLE);
Log.d("visuals", "hiding progress");
- if (error == null) reset_form();
+ if (error == null) resetForm();
else Snackbar.make(findViewById(R.id.new_transaction_accounts_table), error,
BaseTransientBottomBar.LENGTH_LONG).show();
- toggle_all_editing(true);
+ toggleAllEditing(true);
check_transaction_submittable();
}
- private void reset_form() {
- text_date.setText("");
- text_descr.setText("");
+ private void resetForm() {
+ tvDate.setText("");
+ tvDescription.setText("");
- text_descr.requestFocus();
+ tvDescription.requestFocus();
while (table.getChildCount() > 2) {
table.removeViewAt(2);
holder.tvDate.setText(step.getTransaction().getDate());
if (step.getPosition() % 2 == 0) {
- holder.row.setBackgroundColor(Globals.table_row_even_bg);
+ holder.row.setBackgroundColor(Globals.tableRowEvenBG);
}
else {
- holder.row.setBackgroundColor(Globals.table_row_odd_bg);
+ holder.row.setBackgroundColor(Globals.tableRowOddBG);
}
break;
accNameFilter = mActivity.findViewById(R.id.transaction_filter_account_name);
TransactionListFragment me = this;
- MLDB.hook_autocompletion_adapter(mActivity, accNameFilter, "accounts", "name", true);
+ MLDB.hookAutocompletionAdapter(mActivity, accNameFilter, "accounts", "name", true);
accNameFilter.setOnItemClickListener((parent, view, position, id) -> {
// Log.d("tmp", "direct onItemClick");
TransactionListViewModel.scheduleTransactionListReload();
/*
- * Copyright © 2018 Damyan Ivanov.
+ * Copyright © 2019 Damyan Ivanov.
* This file is part of Mobile-Ledger.
* Mobile-Ledger is free software: you can distribute it and/or modify it
* under the term of the GNU General Public License as published by
public final class Globals {
@ColorInt
- public static int table_row_even_bg;
+ public static int tableRowEvenBG;
@ColorInt
- public static int table_row_odd_bg;
+ public static int tableRowOddBG;
@ColorInt
public static int primaryDark, defaultTextColor;
public static void hideSoftKeyboard(Activity act) {
public static SQLiteDatabase getWritableDatabase() {
return getDatabase(WRITE);
}
- static public int get_option_value(String name, int default_value) {
- String s = get_option_value(name, String.valueOf(default_value));
+ static public int getIntOption(String name, int default_value) {
+ String s = getOption(name, String.valueOf(default_value));
try {
return Integer.parseInt(s);
}
return default_value;
}
}
- static public long get_option_value(String name, long default_value) {
- String s = get_option_value(name, String.valueOf(default_value));
+ static public long getLongOption(String name, long default_value) {
+ String s = getOption(name, String.valueOf(default_value));
try {
return Long.parseLong(s);
}
return default_value;
}
}
- static public String get_option_value(String name, String default_value) {
+ static public String getOption(String name, String default_value) {
Log.d("db", "about to fetch option " + name);
SQLiteDatabase db = getReadableDatabase();
try (Cursor cursor = db.rawQuery("select value from options where profile = ? and name=?",
return default_value;
}
}
- static public void set_option_value(String name, String value) {
+ static public void setOption(String name, String value) {
Log.d("option", String.format("%s := %s", name, value));
SQLiteDatabase db = MLDB.getWritableDatabase();
db.execSQL("insert or replace into options(profile, name, value) values(?, ?, ?);",
new String[]{NO_PROFILE, name, value});
}
- static public void set_option_value(String name, long value) {
- set_option_value(name, String.valueOf(value));
+ static public void setLongOption(String name, long value) {
+ setOption(name, String.valueOf(value));
}
@TargetApi(Build.VERSION_CODES.N)
- public static void hook_autocompletion_adapter(final Context context,
- final AutoCompleteTextView view,
- final String table, final String field,
- final boolean profileSpecific) {
- hook_autocompletion_adapter(context, view, table, field, profileSpecific, null);
+ public static void hookAutocompletionAdapter(final Context context,
+ final AutoCompleteTextView view,
+ final String table, final String field,
+ final boolean profileSpecific) {
+ hookAutocompletionAdapter(context, view, table, field, profileSpecific, null);
}
@TargetApi(Build.VERSION_CODES.N)
- public static void hook_autocompletion_adapter(final Context context,
- final AutoCompleteTextView view, final String table, final String field,
- final boolean profileSpecific,
- final View nextView) {
+ public static void hookAutocompletionAdapter(final Context context,
+ final AutoCompleteTextView view,
+ final String table, final String field,
+ final boolean profileSpecific,
+ final View nextView) {
String[] from = {field};
int[] to = {android.R.id.text1};
SimpleCursorAdapter adapter =
public final class NetworkUtil {
private static final int thirtySeconds = 30000;
- public static HttpURLConnection prepare_connection(String path) throws IOException {
+ public static HttpURLConnection prepareConnection(String path) throws IOException {
MobileLedgerProfile profile = Data.profile.get();
final String backend_url = profile.getUrl();
final boolean use_auth = profile.isAuthEnabled();
/*
- * Copyright © 2018 Damyan Ivanov.
+ * Copyright © 2019 Damyan Ivanov.
* This file is part of Mobile-Ledger.
* Mobile-Ledger is free software: you can distribute it and/or modify it
* under the term of the GNU General Public License as published by
pairs = new ArrayList<>();
}
- public void add_pair(String name, String value) {
- pairs.add(new AbstractMap.SimpleEntry<String,String>(name, value));
+ public void addPair(String name, String value) {
+ pairs.add(new AbstractMap.SimpleEntry<>(name, value));
}
@NonNull
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
- android:onClick="fab_new_transaction_clicked"
+ android:onClick="fabNewTransactionClicked"
app:backgroundTint="@color/colorPrimary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="match_parent"
android:layout_weight="1"
android:drawableStart="@drawable/ic_view_list_black_24dp"
- android:onClick="nav_profiles_clicked"
+ android:onClick="navProfilesClicked"
android:text="@string/profiles" />
<TextView
style="@style/nav_button"
android:layout_weight="1"
android:drawableStart="@drawable/ic_settings_black_24dp"
- android:onClick="nav_settings_clicked"
+ android:onClick="navSettingsClicked"
android:text="@string/action_settings" />
<TextView
style="@style/nav_button"
android:layout_weight="1"
android:drawableStart="@drawable/ic_exit_to_app_black_24dp"
- android:onClick="nav_exit_clicked"
+ android:onClick="navExitClicked"
android:text="@string/nav_exit_title" />
</LinearLayout>