public class MainActivity extends ProfileThemedActivity {
public static final String STATE_CURRENT_PAGE = "current_page";
public static final String BUNDLE_SAVED_STATE = "bundle_savedState";
public class MainActivity extends ProfileThemedActivity {
public static final String STATE_CURRENT_PAGE = "current_page";
public static final String BUNDLE_SAVED_STATE = "bundle_savedState";
mViewPager.setCurrentItem(mCurrentPage, false);
if (mAccountFilter != null) showTransactionsFragment(mAccountFilter);
else Data.accountFilter.setValue(null);
mViewPager.setCurrentItem(mCurrentPage, false);
if (mAccountFilter != null) showTransactionsFragment(mAccountFilter);
else Data.accountFilter.setValue(null);
int profileColor = Data.retrieveCurrentThemeIdFromDb();
Colors.setupTheme(this, profileColor);
Colors.profileThemeId = profileColor;
int profileColor = Data.retrieveCurrentThemeIdFromDb();
Colors.setupTheme(this, profileColor);
Colors.profileThemeId = profileColor;
private void scheduleDataRetrievalIfStale(Date lastUpdate) {
long now = new Date().getTime();
if ((lastUpdate == null) || (now > (lastUpdate.getTime() + (24 * 3600 * 1000)))) {
private void scheduleDataRetrievalIfStale(Date lastUpdate) {
long now = new Date().getTime();
if ((lastUpdate == null) || (now > (lastUpdate.getTime() + (24 * 3600 * 1000)))) {
String.format("WEB data last fetched at %1.3f and now is %1.3f. re-fetching",
lastUpdate.getTime() / 1000f, now / 1000f));
String.format("WEB data last fetched at %1.3f and now is %1.3f. re-fetching",
lastUpdate.getTime() / 1000f, now / 1000f));
if (arg == null) mProfileListAdapter.notifyDataSetChanged();
else mProfileListAdapter.notifyItemChanged((int) arg);
if (arg == null) mProfileListAdapter.notifyDataSetChanged();
else mProfileListAdapter.notifyItemChanged((int) arg);
int newProfileTheme = (profile == null) ? -1 : profile.getThemeId();
if (newProfileTheme != Colors.profileThemeId) {
int newProfileTheme = (profile == null) ? -1 : profile.getThemeId();
if (newProfileTheme != Colors.profileThemeId) {
- Log.d("profiles", String.format("profile theme %d → %d", Colors.profileThemeId,
+ debug("profiles", String.format("profile theme %d → %d", Colors.profileThemeId,
}
else {
final String text = DateFormat.getDateTimeInstance().format(newValue);
v.setText(text);
l.setVisibility(View.VISIBLE);
}
else {
final String text = DateFormat.getDateTimeInstance().format(newValue);
v.setText(text);
l.setVisibility(View.VISIBLE);
showTransactionsFragment((account == null) ? (String) null : account.getName());
// FragmentTransaction ft = fragmentManager.beginTransaction();
// if (transactionListFragment == null) {
showTransactionsFragment((account == null) ? (String) null : account.getName());
// FragmentTransaction ft = fragmentManager.beginTransaction();
// if (transactionListFragment == null) {
final MobileLedgerProfile profile = Data.profile.get();
long last_update = (profile != null) ? profile.getLongOption(MLDB.OPT_LAST_SCRAPE, 0L) : 0;
final MobileLedgerProfile profile = Data.profile.get();
long last_update = (profile != null) ? profile.getLongOption(MLDB.OPT_LAST_SCRAPE, 0L) : 0;
if (retrieveTransactionsTask != null) retrieveTransactionsTask.cancel(false);
bTransactionListCancelDownload.setEnabled(false);
}
if (retrieveTransactionsTask != null) retrieveTransactionsTask.cancel(false);
bTransactionListCancelDownload.setEnabled(false);
}
case R.id.account_row_acc_name:
case R.id.account_expander:
case R.id.account_expander_container:
case R.id.account_row_acc_name:
case R.id.account_expander:
case R.id.account_expander_container:
try (LockHolder lh = Data.accounts.lockForWriting()) {
for (int i = 0; i < Data.accounts.size(); i++) {
if (acc.isParentOf(Data.accounts.get(i))) {
try (LockHolder lh = Data.accounts.lockForWriting()) {
for (int i = 0; i < Data.accounts.size(); i++) {
if (acc.isParentOf(Data.accounts.get(i))) {
// String.format("Found a non-child '%s' at position %d",
// Data.accounts.get(i).getName(), i));
break;
// String.format("Found a non-child '%s' at position %d",
// Data.accounts.get(i).getName(), i));
break;
-// Log.d("accounts", String.format("Removing item %d: %s", start + j,
+// debug("accounts", String.format("Removing item %d: %s", start + j,