Fixed multiple notification sound bug (yet to be tested), new booleans for AsyncTask

This commit is contained in:
Deniz Düzgören
2019-05-23 14:28:41 +02:00
parent a41d5127c5
commit 75d9ae25d8
2 changed files with 88 additions and 74 deletions
@@ -101,7 +101,7 @@ public class FragmentPlan extends Fragment {
if (prefs.getInt("firstTimeOpening", 0) == 2) {
if (!prefs.getBoolean("notif", false)) {
pullToRefresh.setRefreshing(true);
new DataFetcher(false, getContext(), getActivity().getApplication(), getView().getRootView()).execute();
new DataFetcher(true, false, false, getContext(), getActivity().getApplication(), getView().getRootView()).execute();
edit.putInt("firstTimeOpening", 3);
edit.apply();
}
@@ -109,7 +109,7 @@ public class FragmentPlan extends Fragment {
if (prefs.getBoolean("autoRefresh", false)) {
pullToRefresh.setRefreshing(true);
new DataFetcher(false, getContext(), getActivity().getApplication(), getView().getRootView()).execute();
new DataFetcher(true, false, false, getContext(), getActivity().getApplication(), getView().getRootView()).execute();
bottomSheetText.setText(prefs.getString("informational", getString(R.string.noinfo)));
}
substViewModel = ViewModelProviders.of(getActivity()).get(SubstViewModel.class);
@@ -127,7 +127,7 @@ public class FragmentPlan extends Fragment {
@Override
public void onRefresh() {
pullToRefresh.setRefreshing(true);
new DataFetcher(true, getContext(), getActivity().getApplication(), getView().getRootView()).execute(); // TODO test for notification
new DataFetcher(true, false, true, getContext(), getActivity().getApplication(), getView().getRootView()).execute(); // TODO test for notification
bottomSheetText.setText(prefs.getString("informational", getString(R.string.noinfo)));
}
});