mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 09:01:55 +01:00
wip
This commit is contained in:
parent
32615126d1
commit
2b30caefd6
@ -98,7 +98,6 @@ import nodomain.freeyourgadget.gadgetbridge.model.ActivitySummaryItems;
|
|||||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySummaryJsonSummary;
|
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySummaryJsonSummary;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySummaryParser;
|
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySummaryParser;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivityTrack;
|
import nodomain.freeyourgadget.gadgetbridge.model.ActivityTrack;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.GPSCoordinate;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.FitFile;
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.FitFile;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.messages.FitRecord;
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.messages.FitRecord;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.util.AndroidUtils;
|
import nodomain.freeyourgadget.gadgetbridge.util.AndroidUtils;
|
||||||
@ -117,6 +116,7 @@ public class ActivitySummaryDetail extends AbstractGBActivity {
|
|||||||
int selectedGpxIndex;
|
int selectedGpxIndex;
|
||||||
String selectedGpxFile;
|
String selectedGpxFile;
|
||||||
File export_path = null;
|
File export_path = null;
|
||||||
|
private DetailsAsyncTask refreshTask = null;
|
||||||
|
|
||||||
private ActivitySummariesChartFragment activitySummariesChartFragment;
|
private ActivitySummariesChartFragment activitySummariesChartFragment;
|
||||||
private ActivitySummariesGpsFragment activitySummariesGpsFragment;
|
private ActivitySummariesGpsFragment activitySummariesGpsFragment;
|
||||||
@ -367,10 +367,17 @@ public class ActivitySummaryDetail extends AbstractGBActivity {
|
|||||||
// Update the summary header right away - but it will be refreshed once the item is reloaded
|
// Update the summary header right away - but it will be refreshed once the item is reloaded
|
||||||
makeSummaryHeader(currentItem);
|
makeSummaryHeader(currentItem);
|
||||||
|
|
||||||
DetailsAsyncTask detailsAsyncTask = new DetailsAsyncTask();
|
if (refreshTask != null) {
|
||||||
detailsAsyncTask.execute(currentItem);
|
refreshTask.cancel(true);
|
||||||
|
refreshTask = null;
|
||||||
|
}
|
||||||
|
refreshTask = new DetailsAsyncTask();
|
||||||
|
refreshTask.execute(currentItem);
|
||||||
|
|
||||||
ProgressBar loadingProgressbar = findViewById(R.id.loading_progressbar);
|
LinearLayout fieldLayout = findViewById(R.id.summaryDetails);
|
||||||
|
fieldLayout.setAlpha(0.3f);
|
||||||
|
|
||||||
|
final ProgressBar loadingProgressbar = findViewById(R.id.loading_progressbar);
|
||||||
loadingProgressbar.setVisibility(View.VISIBLE);
|
loadingProgressbar.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
activitySummariesChartFragment.setDateAndGetData(
|
activitySummariesChartFragment.setDateAndGetData(
|
||||||
@ -768,6 +775,11 @@ public class ActivitySummaryDetail extends AbstractGBActivity {
|
|||||||
private class DetailsAsyncTask extends AsyncTask<BaseActivitySummary, Void, ActivitySummaryJsonSummary> {
|
private class DetailsAsyncTask extends AsyncTask<BaseActivitySummary, Void, ActivitySummaryJsonSummary> {
|
||||||
@Override
|
@Override
|
||||||
protected ActivitySummaryJsonSummary doInBackground(final BaseActivitySummary... baseActivitySummaries) {
|
protected ActivitySummaryJsonSummary doInBackground(final BaseActivitySummary... baseActivitySummaries) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(3000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
final DeviceCoordinator coordinator = gbDevice.getDeviceCoordinator();
|
final DeviceCoordinator coordinator = gbDevice.getDeviceCoordinator();
|
||||||
final ActivitySummaryParser summaryParser = coordinator.getActivitySummaryParser(gbDevice, ActivitySummaryDetail.this);
|
final ActivitySummaryParser summaryParser = coordinator.getActivitySummaryParser(gbDevice, ActivitySummaryDetail.this);
|
||||||
|
|
||||||
@ -781,6 +793,8 @@ public class ActivitySummaryDetail extends AbstractGBActivity {
|
|||||||
protected void onPostExecute(final ActivitySummaryJsonSummary activitySummaryJsonSummary) {
|
protected void onPostExecute(final ActivitySummaryJsonSummary activitySummaryJsonSummary) {
|
||||||
makeSummaryContent(activitySummaryJsonSummary);
|
makeSummaryContent(activitySummaryJsonSummary);
|
||||||
findViewById(R.id.loading_progressbar).setVisibility(View.GONE);
|
findViewById(R.id.loading_progressbar).setVisibility(View.GONE);
|
||||||
|
LinearLayout fieldLayout = findViewById(R.id.summaryDetails);
|
||||||
|
fieldLayout.setAlpha(1f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user