Skip to content

Commit

Permalink
codinguser#110 - Cleaning code
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanGarf committed Feb 29, 2020
1 parent 88f5eb2 commit 2426942
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,28 +346,6 @@ public void onActivityCreated(Bundle savedInstanceState) {

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

mTransferAccountSearchableSpinnerView.setPositiveButton(getString(R.string.alert_dialog_cancel),
new DialogInterface.OnClickListener() {

@Override
public void onClick(final DialogInterface dialog,
final int which) {

// TODO TW M 2020-02-16 : TBD

// final View spinnerSelectedItemView = mTransferAccountSearchableSpinnerView.getSelectedView();
//
// TextView accountFullNameTextView = (TextView) spinnerSelectedItemView.findViewById(android.R.id.text1);
//
// setAccountTextColor(accountFullNameTextView,
// // TODO TW M 2020-02-16 : TBD
// // corriger pour mettre le split
// // account
// mAccountUID);

}
});

mTransferAccountSearchableSpinnerView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
/**
* Flag for ignoring first call to this listener.
Expand Down Expand Up @@ -421,9 +399,6 @@ public void onNothingSelected(AdapterView<?> adapterView) {
}
});

mTransferAccountSearchableSpinnerView.setOnCancelListener(mOnCancelListener);


ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
assert actionBar != null;
// actionBar.setSubtitle(mAccountsDbAdapter.getFullyQualifiedAccountName(mAccountUID));
Expand All @@ -448,49 +423,6 @@ 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 m 2020-02-15 : TBD

// SearchableListDialogFragment searchableListDialogFragment = (SearchableListDialogFragment) dialog;
//
// String accountFullName = (String) searchableListDialogFragment.getParentSearchableSpinnerView()
// .getSelectedItem();
//
// //
// // Set Account Color
// //
//
// TextView accountFullNameTextView = (TextView) searchableListDialogFragment.getParentSearchableSpinnerView()
// .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
// }

}

/**
* Extension of SimpleCursorAdapter which is used to populate the fields for the list items
* in the transactions suggestions (auto-complete transaction description).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,13 @@ public void onNothingSelected(AdapterView<?> parent) {
}
};

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

@Override
public void onCancel(DialogInterface dialog) {

resetSpinnerItemAppearance();
}
};

private DialogInterface.OnClickListener mSearchableSpinnerPositiveBtnOnClickListener = new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface dialog,
int which) {

resetSpinnerItemAppearance();
// NTD
}
};

Expand Down Expand Up @@ -288,17 +279,6 @@ private TransactionsListFragment prepareTransactionsListFragment() {
}
}

protected void resetSpinnerItemAppearance() {

// TODO TW m 2020-02-16 : Useless ?

// // item text
// TextView accountFullClassName = (TextView) mToolbarSpinner.findViewById(android.R.id.text1);
//
// accountFullClassName.setTextColor(Color.RED);
}


/**
* Refreshes the fragments currently in the transactions activity
*/
Expand Down Expand Up @@ -455,8 +435,6 @@ private void setupActionBarNavigation() {

mToolbarSpinner.setOnItemSelectedListener(mTransactionListNavigationListener);

mToolbarSpinner.setOnCancelListener(mSearchableSpinnerOnCancelListener);

mToolbarSpinner.setTitle(getString(R.string.select_account));

// The "positive" button act as a Cancel button
Expand Down

0 comments on commit 2426942

Please sign in to comment.