Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#110 searchable spinner arrayadapter #895

Open
wants to merge 147 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
5357d0e
Merge remote-tracking branch 'codinguser/master' into develop
pnemonic78 Jun 22, 2017
c234c0d
Merge remote-tracking branch 'codinguser/develop' into develop
pnemonic78 Jun 22, 2017
60d31e3
Merge remote-tracking branch 'codinguser/master' into hotfix/patches
pnemonic78 Oct 2, 2017
dfe8c99
Merge remote-tracking branch 'codinguser/develop' into develop
pnemonic78 Oct 2, 2017
ad9877d
IRR defined double currency.
pnemonic78 Oct 2, 2017
c375478
copy currencies from GnuCash desktop.
pnemonic78 Oct 2, 2017
3dac05d
Currencies XML was modified, so re-populate the commodities database …
pnemonic78 Oct 3, 2017
7a6ff6a
Merge remote-tracking branch 'codinguser/develop' into develop
pnemonic78 May 29, 2018
5f620e3
Merge branch 'develop' into bug-731
pnemonic78 May 29, 2018
9f293d7
Fix issue #790 - text margins for RTL text in transaction details scr…
pnemonic78 Jun 11, 2018
a35d233
Merge pull request #791 from pnemonic78/bug_790a
codinguser Jun 12, 2018
7301bd3
Merge branch 'master' into develop
codinguser Jun 15, 2018
8bc6468
Update gradle wrapper to 4.4 and plugin to 3.1.4
Sep 13, 2018
c546904
Add privacy policy
codinguser Sep 20, 2018
21fc3cf
fixed add button disappearing after rotaion
Feb 14, 2019
08a56cd
Merge pull request #812 from RajatChandel/develop
codinguser Mar 1, 2019
f69a609
Fixes crash when exporting CSV to 3rd party applications
codinguser Mar 1, 2019
15af632
Initial release of croatian accounts
milotype Mar 1, 2019
ef99555
Fixes slow CSV exports
Pikrass Oct 5, 2019
a037f43
Cache account names when exporting transactions to CSV
Pikrass Oct 5, 2019
bbabd3b
Merge pull request #739 from pnemonic78/bug-731
codinguser Nov 9, 2019
9eac7f2
Merge pull request #799 from GianpaMX/develop
codinguser Nov 9, 2019
0d7b396
Merge pull request #826 from milotype/milotype-patch-1
codinguser Nov 9, 2019
9b1851a
Merge pull request #845 from Pikrass/fix-csv-export
codinguser Nov 9, 2019
2a62ab8
Upgrades compileSdk, targetSdk, buildTools and gradle versions
codinguser Nov 9, 2019
448caae
Fixes UI (integration) tests
codinguser Nov 9, 2019
87e2b1d
Upgrade version of robolectric to fix execution of unit tests
codinguser Nov 9, 2019
d2cfae3
Add Book name as subtitle in Accounts Activity
AnilPraharaj Feb 14, 2019
0c7e4e3
Update Java source compatibility to Java 8
codinguser Nov 9, 2019
9fa40d4
Update version for 2.4.1 release
codinguser Nov 9, 2019
b401372
Update translations from CrowdIn
codinguser Nov 10, 2019
4fac627
Update CHANGELOG for v2.4.1 release
codinguser Nov 10, 2019
a9fcb9f
Update version and CHANGELOG for v2.4.1-beta2 release
codinguser Nov 21, 2019
8631c7f
Fixes crash when exporting after upgrading to v2.4.1-beta1 from v2.4.0
codinguser Nov 27, 2019
32ee927
Upgrade version for v2.4.1-beta3 release
codinguser Nov 28, 2019
85704b4
Upgrade version for v2.4.1 final release
codinguser Nov 30, 2019
5670ac8
#110 - Create SearchableSpinner
JeanGarf Jan 17, 2020
7fa63f4
#110 - Use SearchableSpinner in Transactions
JeanGarf Jan 17, 2020
4bb7a0a
#110 - WithContainsFilterArrayAdapter based on ArrayTextFilter
JeanGarf Jan 18, 2020
564a0f0
#110 - Add empty lines to be more readable
JeanGarf Jan 18, 2020
7048863
#110 - Renaming and comments
JeanGarf Jan 18, 2020
697ed1d
#110 - Change PositiveButton label to "Cancel"
JeanGarf Jan 18, 2020
84891c7
#110 - Reformat code to be more readable
JeanGarf Jan 18, 2020
a0fb401
#110 - Replace maxLines by singleLine
JeanGarf Jan 19, 2020
d7052ac
#110 - Add comments
JeanGarf Jan 19, 2020
6cf5542
#110 - Customize item appearance for searchableListView
JeanGarf Jan 19, 2020
a2dd297
#110 - After test, it's better to allow multi-line
JeanGarf Jan 19, 2020
cf3b090
#110 - use singleLine instead of maxLines=1
JeanGarf Jan 22, 2020
7768eb9
#110 - Rename account_spinner_item into transaction_account_spinner_item
JeanGarf Jan 22, 2020
0351d7b
#110 - Improve code quality
JeanGarf Jan 25, 2020
f226bbc
#110 - Rename SearchableSpinner into SearchableSpinnerView
JeanGarf Jan 25, 2020
e1625da
#110 - Use Parent Adapter
JeanGarf Jan 25, 2020
73c2c65
#110 - Use QualifiedAccountNameCursorAdapter and a FilterQueryProvide…
JeanGarf Jan 29, 2020
dbe91e0
#110 - Renamings
JeanGarf Jan 29, 2020
48d738d
#110 - Do not hide keyboard
JeanGarf Jan 29, 2020
f7c517e
#110 - Use account_spinner_dropdown_item for DropDown items
JeanGarf Jan 30, 2020
a49b55f
#110 - Handle keyboard hiding and add colors to debug
JeanGarf Feb 1, 2020
1bf4837
#110 - Comment unused code
JeanGarf Feb 1, 2020
86a2720
#110 - Commit WithContainingTextArrayFilterArrayAdapter before deletion
JeanGarf Feb 1, 2020
ecc99b6
#110 - Delete WithContainingTextArrayFilterArrayAdapter
JeanGarf Feb 1, 2020
2491a60
#110 - Cleaning code
JeanGarf Feb 1, 2020
2c7bfee
#110 - Set Focus onto Amount at first
JeanGarf Feb 1, 2020
2e9bbcd
#110 - Restore black color
JeanGarf Feb 1, 2020
d7740d3
#110 - Use Theme to configure spinners
JeanGarf Feb 2, 2020
1fe5b8c
#110 - SearchableSpinnerView for TransactionActivity ToolBar
JeanGarf Feb 2, 2020
83bd981
#110 - Create displayFavoriteAccountStarIcon() and removeFavoriteIcon…
JeanGarf Feb 2, 2020
38fda80
#110 - Use removeFavoriteIconFromSelectedView()
JeanGarf Feb 2, 2020
0ab14bd
#110 - Add a OnCancelListener and call it on Cancel
JeanGarf Feb 2, 2020
16db0d4
#110 - Rename removeFavoriteIconFromSelectedView() into hideFavoriteA…
JeanGarf Feb 2, 2020
bd6d8ce
#110 - Fetch Accounts except Root and Hidden
JeanGarf Feb 2, 2020
2cce9c2
#110 - Correct query
JeanGarf Feb 2, 2020
c990de6
#110 - Error in selectCurrentAccountInToolbarSpinner() : Shall use a …
JeanGarf Feb 8, 2020
e66301e
#110 - Define Filter only once
JeanGarf Feb 8, 2020
6a2822b
#110 - Reformat code
JeanGarf Feb 8, 2020
8154f12
#110 - Error in selectCurrentAccountInToolbarSpinner() : Shall use a …
JeanGarf Feb 8, 2020
ba5c91c
#110 - OK, but ToolbarSpinner can not select Placeholder
JeanGarf Feb 8, 2020
b465876
#110 - SearchableSpinner for parent and defaultTransfertAccount (but …
JeanGarf Feb 8, 2020
a76418b
#110 - Add setAllowPlaceHolderAccounts() in SearchableSpinnerView
JeanGarf Feb 8, 2020
eaba866
#110 - Use a inner CursorAdapter not the SearchableSpinnerView one's
JeanGarf Feb 11, 2020
a22c18b
#110 - Remove position in onSearchableItemClicked(...)
JeanGarf Feb 11, 2020
952209d
#110 - Add TODO
JeanGarf Feb 11, 2020
6090403
#110 - AllowPlaceHolderAccounts for Parent Account List
JeanGarf Feb 11, 2020
c66a7a0
#110 - Filtering using parentCursorAdapter
JeanGarf Feb 13, 2020
c8a1ee3
#110 - QualifiedAccountNameCursorAdapter with null Cursor => OK
JeanGarf Feb 13, 2020
51c337e
#110 - Cleaning
JeanGarf Feb 13, 2020
cbba374
#110 - Add CursorWhere and CursorWhereArgs in setAdapter(...) in orde…
JeanGarf Feb 13, 2020
9d972fe
#110 - Use new setAdapter(..., where, whereArgs)
JeanGarf Feb 13, 2020
fdc5312
#110 - Filter using CursorWhere an CursorWhereArgs + LIKE %searchView…
JeanGarf Feb 13, 2020
523cc3a
Merge branch '#110_searchable_spinner_v3' into #110_searchable_spinne…
JeanGarf Feb 13, 2020
a19520c
#110 - Do not use _listView.setFilterText(s) because it makes a big b…
JeanGarf Feb 14, 2020
07d767f
#110 - Spinner DropDown with 2 lines (partial)
JeanGarf Feb 14, 2020
00113b5
#110 - Spinner DropDown with 2 lines (partial)
JeanGarf Feb 14, 2020
2eacfbf
#110 - Update styles
JeanGarf Feb 14, 2020
9dbec73
#110 - Transfert selectSpinnerAccount()
JeanGarf Feb 14, 2020
e7a0019
#110 - Impact of renaming select_account
JeanGarf Feb 14, 2020
ee77367
#110 - Add mIsDismissing
JeanGarf Feb 14, 2020
b87cde5
#110 - Display Parent Account Full Name on line 2 and use Account Col…
JeanGarf Feb 15, 2020
8c5b58c
#110 - Renaming
JeanGarf Feb 15, 2020
8cbe17f
#110 - Create setAccountTextColor() to colorize Account Name accordin…
JeanGarf Feb 15, 2020
caa2a10
#110 - Use setAccountTextColor() to colorize Account Name according t…
JeanGarf Feb 15, 2020
6a1e935
#110 - Renamings
JeanGarf Feb 16, 2020
1f69edc
#110 - Change hideFavoriteAccountStarIcon() signature
JeanGarf Feb 16, 2020
6a9728e
#110 - Dismiss on Positive Button
JeanGarf Feb 16, 2020
aa179f0
#110 - Trying to restore color when Positive button, but does not work
JeanGarf Feb 16, 2020
807137a
#110 - Add TODO
JeanGarf Feb 16, 2020
4459fe5
#110 - Use black color for Accounts which have no customized color
JeanGarf Feb 18, 2020
6071994
#110 - Add preferences to open/close keyboard and to allow/deny use o…
JeanGarf Feb 18, 2020
9d5512d
#110 - Renamings
JeanGarf Feb 18, 2020
9406957
#110 - Start to retry with ArrayAdapter instead of CursorAdapter
JeanGarf Feb 19, 2020
7651173
#110 - Differentiate CursorAdapter and ArrayAdapter treatment
JeanGarf Feb 23, 2020
639da09
#110 - Default selected spinner item is black
JeanGarf Feb 25, 2020
cc9d106
#110 - Excepted for Toolbar spinner which is white
JeanGarf Feb 25, 2020
1019d25
#110 - Use pop-up with search text only for QualifiedAccountNameCurso…
JeanGarf Feb 25, 2020
9a723ed
#110 - Code quality
JeanGarf Feb 25, 2020
de6b29e
#110 - Restore compare with uid
JeanGarf Feb 25, 2020
32c2c86
#110 - Create items filter that retain items whose toString() contain…
JeanGarf Feb 25, 2020
82b78fd
#110 - Use SimpleAdapter and ItemToStringContainsTextFilter
JeanGarf Feb 25, 2020
2d031b0
#110 - Override getView() in SimpleAdapter to colorize according to UID
JeanGarf Feb 25, 2020
d96cbd1
#110 - Factorize methods
JeanGarf Feb 25, 2020
efce61e
#110 - Code quality
JeanGarf Feb 26, 2020
731b2de
#110 - Rename ItemToStringContainsTextFilter to ItemContainingTextFil…
JeanGarf Feb 26, 2020
8fde3f8
#110 - Override isFoundInItem() in order to search on the Account Ful…
JeanGarf Feb 26, 2020
107f8d0
#110 - Add Getter
JeanGarf Feb 26, 2020
749f9e9
#110 - Add T_ITEM generic type
JeanGarf Feb 26, 2020
710ac8b
#110 - SearchableSpinnerView compatible with CursorAdapter and ArrayA…
JeanGarf Feb 27, 2020
1871671
#110 - Preference to open keyboard, default to false
JeanGarf Feb 27, 2020
9630f96
#110 - Add TODO
JeanGarf Feb 27, 2020
496f50b
Correct title in StackedBarChartFragment
JeanGarf Feb 27, 2020
ad1c0b9
Use title_cash_flow_report and title_balance_sheet_report instead of …
JeanGarf Feb 27, 2020
578022e
Fill Map in order to get ReportToolbarSpinner containing the 4 charts
JeanGarf Feb 27, 2020
c8d295f
Merge branch 'reports_errors' into #110_searchable_spinner_arayadapter
JeanGarf Feb 27, 2020
7a4e4e5
Fixes #872 Add a final commit
JeanGarf Feb 27, 2020
edefd3d
Merge branch '#872_reports_errors' into #110_searchable_spinner_araya…
JeanGarf Feb 27, 2020
273813a
#110 - Use listPreferredItemHeight height and center vertically in Re…
JeanGarf Feb 27, 2020
2729652
#110 - Revert to use theme_primary color for Accounts which have no c…
JeanGarf Feb 27, 2020
7022ac4
#110 - Cleaning code
JeanGarf Feb 29, 2020
cf19704
#110 Accounts sorted by Favorites first in Splits
JeanGarf Feb 29, 2020
c3e71ca
#110 Use SearchableSpinnerView in Splits
JeanGarf Feb 29, 2020
07a4c03
#110 Avoid "attempt to re-open an already-closed object" Exception in…
JeanGarf Feb 29, 2020
a394590
#110 Do not show root account, itself and placeholder account in tran…
JeanGarf Feb 29, 2020
dd4ffe0
#110 Factorize in AccountUtils.getTransfertAccountWhereClause() the c…
JeanGarf Feb 29, 2020
a4b29da
#110 Enhance Split display
JeanGarf Feb 29, 2020
897c297
#110 Set color on selected (= closed) spinner item
JeanGarf Feb 29, 2020
88f5eb2
#110 Colorize selected (= closed) spinner item, except in toolbar_spi…
JeanGarf Feb 29, 2020
2426942
#110 - Cleaning code
JeanGarf Feb 29, 2020
f1df16e
#110 - Respect Splits sort list order
JeanGarf Feb 29, 2020
2acaa93
#110 - Don't close SearchableSpinner automatically
JeanGarf Mar 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#110 - Use setAccountTextColor() to colorize Account Name according t…
…o their color
JeanGarf committed Feb 15, 2020
commit caa2a108b352baef8af3e9a7886039751d401449
Original file line number Diff line number Diff line change
@@ -99,15 +99,30 @@ class SplitAmountViewHolder {

View itemView;

public SplitAmountViewHolder(View view, Split split){
public SplitAmountViewHolder(View view,
Split split) {

itemView = view;
ButterKnife.bind(this, view);

ButterKnife.bind(this,
view);

AccountsDbAdapter accountsDbAdapter = AccountsDbAdapter.getInstance();

accountName.setText(accountsDbAdapter.getAccountFullName(split.getAccountUID()));
Money quantity = split.getFormattedQuantity();
TextView balanceView = quantity.isNegative() ? splitDebit : splitCredit;
TransactionsActivity.displayBalance(balanceView, quantity);

// Set color according to Account
TransactionFormFragment.setAccountTextColor(accountName,
split.getAccountUID());


Money quantity = split.getFormattedQuantity();
TextView balanceView = quantity.isNegative()
? splitDebit
: splitCredit;

TransactionsActivity.displayBalance(balanceView,
quantity);
}
}

Original file line number Diff line number Diff line change
@@ -18,10 +18,12 @@

import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.database.Cursor;
import android.graphics.Color;
import android.inputmethodservice.KeyboardView;
import android.os.Bundle;
import android.support.annotation.NonNull;
@@ -81,6 +83,7 @@
import org.gnucash.android.ui.util.RecurrenceViewClickListener;
import org.gnucash.android.ui.util.widget.CalculatorEditText;
import org.gnucash.android.ui.util.widget.TransactionTypeSwitch;
import org.gnucash.android.ui.util.widget.searchablespinner.SearchableListDialogFragment;
import org.gnucash.android.ui.util.widget.searchablespinner.SearchableSpinnerView;
import org.gnucash.android.util.KeyboardUtils;
import org.gnucash.android.util.QualifiedAccountNameCursorAdapter;
@@ -335,9 +338,16 @@ public void onActivityCreated(Bundle savedInstanceState) {

setListeners();

//
// mTransferAccountSearchableSpinnerView
//

//updateTransferAccountsList must only be called after initializing mAccountsDbAdapter
updateTransferAccountsList();

mTransferAccountSearchableSpinnerView.setTitle(getString(R.string.select_account));
mTransferAccountSearchableSpinnerView.setPositiveButton(getString(R.string.alert_dialog_cancel));

mTransferAccountSearchableSpinnerView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
/**
* Flag for ignoring first call to this listener.
@@ -387,8 +397,8 @@ public void onNothingSelected(AdapterView<?> adapterView) {
}
});

mTransferAccountSearchableSpinnerView.setTitle(getString(R.string.select_account));
mTransferAccountSearchableSpinnerView.setPositiveButton(getString(R.string.alert_dialog_cancel));
mTransferAccountSearchableSpinnerView.setOnCancelListener(mOnCancelListener);


ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
assert actionBar != null;
@@ -414,6 +424,49 @@ public void onNothingSelected(AdapterView<?> adapterView) {
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}

private DialogInterface.OnCancelListener mOnCancelListener = new DialogInterface.OnCancelListener() {

@Override
public void onCancel(DialogInterface dialog) {

resetSpinnerItemAppearance(dialog);
}
};

private void resetSpinnerItemAppearance(DialogInterface dialog) {

// TODO TW C 2020-02-15 : A finir
// SearchableListDialogFragment searchableListDialogFragment = (SearchableListDialogFragment) dialog;
//
// String accountFullName = (String) searchableListDialogFragment.getParentAdapterView()
// .getSelectedItem();
//
// //
// // Set Account Color
// //
//
// TextView accountFullNameTextView = (TextView) searchableListDialogFragment.getParentAdapterView()
// .findViewById(android.R.id.text1);
//
// if (accountFullNameTextView != null) {
// //
//
// // Get Account color
//// int iColor = AccountsDbAdapter.getActiveAccountColorResource(accountUID);
// int iColor = Color.RED;
//
// // Override color
// accountFullNameTextView.setTextColor(iColor);
//
// } else {
// // n' pas
//
// // RAF
// }

}


// TODO TW C 2020-02-15 : Améliorer commentaires et déplacer
public static void setAccountTextColor(final TextView accountTextView,
final String accountUID) {
Original file line number Diff line number Diff line change
@@ -299,6 +299,11 @@ public void onClick(View v) {
for (Split split : splits) {
if (!split.getAccountUID().equals(mAccountUID)) {
text = AccountsDbAdapter.getInstance().getFullyQualifiedAccountName(split.getAccountUID());

// Set color according to Account
TransactionFormFragment.setAccountTextColor(holder.secondaryText,
split.getAccountUID());

break;
}
}
@@ -308,6 +313,7 @@ public void onClick(View v) {
text = splits.size() + " splits";
}
holder.secondaryText.setText(text);

holder.transactionDate.setText(dateText);

holder.editTransaction.setOnClickListener(new View.OnClickListener() {