Fix watchlist loading
- Watchlist was no longer refreshing - No loading indicator when first loading the fragment
This commit is contained in:
parent
54e6bb4e9e
commit
a46ad91f79
@ -74,7 +74,7 @@ public class Watchlist extends Fragment {
|
||||
defaultCurrency = preferencesManager.getDefaultCurrency();
|
||||
currencyTickerList = new CurrencyTickerList(getActivity());
|
||||
tickerUpdated = false;
|
||||
checkUpdatedData();
|
||||
updateTickerList();
|
||||
|
||||
editModeEnabled = false;
|
||||
|
||||
@ -98,6 +98,25 @@ public class Watchlist extends Fragment {
|
||||
return view;
|
||||
}
|
||||
|
||||
private void updateTickerList()
|
||||
{
|
||||
AsyncTask<Void, Integer, Void> updater = new AsyncTask<Void, Integer, Void>() {
|
||||
@Override
|
||||
protected Void doInBackground(Void... voids) {
|
||||
currencyTickerList.update(new BalanceManager.IconCallBack() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
tickerUpdated = true;
|
||||
checkUpdatedData();
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
updater.execute();
|
||||
}
|
||||
|
||||
private void setupEditButton()
|
||||
{
|
||||
ImageButton editButton = view.findViewById(R.id.edit_button);
|
||||
|
@ -216,22 +216,6 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
||||
addPreferencesFromResource(R.xml.pref_general);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
/*findPreference("hide_balance").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
boolean isChecked = ((SwitchPreference) findPreference("hide_balance")).isChecked();
|
||||
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
|
||||
editor.putBoolean("hide_balance", isChecked);
|
||||
editor.apply();
|
||||
|
||||
return isChecked;
|
||||
}
|
||||
});*/
|
||||
|
||||
findPreference("version").setSummary(BuildConfig.VERSION_NAME);
|
||||
|
||||
bindPreferenceSummaryToValue(findPreference("default_currency"));
|
||||
|
@ -91,7 +91,7 @@
|
||||
style="?android:attr/progressBarStyleLarge"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/circular_progress_bar"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="visible"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user