- public void onAccountRefreshDone(int error) {
- swiper.setRefreshing(false);
- if (error != 0) {
- String err_text = getResources().getString(error);
- Log.d("visual", String.format("showing snackbar: %s", err_text));
- Snackbar.make(swiper, err_text, Snackbar.LENGTH_LONG).show();
- }
- else {
- MLDB.set_option_value("last_refresh", new Date().getTime());
- update_account_table();
- }
- }
- private void update_account_table() {
- if (this.getContext() == null) return;
-
- model.reloadAccounts(this.getContext());
- modelAdapter.notifyDataSetChanged();
- }
- public void onRefreshAccountSummaryClicked(MenuItem mi) {
- update_accounts(true);
- }
-
- public void onShowOnlyStarredClicked(MenuItem mi) {
- SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(mActivity);
- boolean flag = pref.getBoolean(PREF_KEY_SHOW_ONLY_STARRED_ACCOUNTS, false);
-
- SharedPreferences.Editor editor = pref.edit();
- editor.putBoolean(PREF_KEY_SHOW_ONLY_STARRED_ACCOUNTS, !flag);
- Log.d("pref", "Setting show only starred accounts pref to " + (flag ? "false" : "true"));
- editor.apply();
-
- update_account_table();
- }
-