diff --git a/app/src/main/java/com/nauk/moodl/Activities/HomeActivityFragments/Watchlist.java b/app/src/main/java/com/nauk/moodl/Activities/HomeActivityFragments/Watchlist.java index 0c2cbad..4028081 100644 --- a/app/src/main/java/com/nauk/moodl/Activities/HomeActivityFragments/Watchlist.java +++ b/app/src/main/java/com/nauk/moodl/Activities/HomeActivityFragments/Watchlist.java @@ -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 updater = new AsyncTask() { + @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); diff --git a/app/src/main/java/com/nauk/moodl/Activities/SettingsActivity.java b/app/src/main/java/com/nauk/moodl/Activities/SettingsActivity.java index 1369336..5e7738e 100644 --- a/app/src/main/java/com/nauk/moodl/Activities/SettingsActivity.java +++ b/app/src/main/java/com/nauk/moodl/Activities/SettingsActivity.java @@ -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")); diff --git a/app/src/main/res/layout/fragment_watchlist_homeactivity.xml b/app/src/main/res/layout/fragment_watchlist_homeactivity.xml index 7f70043..5dce68e 100644 --- a/app/src/main/res/layout/fragment_watchlist_homeactivity.xml +++ b/app/src/main/res/layout/fragment_watchlist_homeactivity.xml @@ -91,7 +91,7 @@ style="?android:attr/progressBarStyleLarge" android:layout_gravity="center" android:background="@drawable/circular_progress_bar" - android:visibility="gone"/> + android:visibility="visible"/>