Implement rating flow
Этот коммит содержится в:
@@ -16,6 +16,7 @@
|
||||
package org.traccar.client;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
@@ -26,6 +27,7 @@ import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.multidex.MultiDexApplication;
|
||||
|
||||
public class MainApplication extends MultiDexApplication {
|
||||
@@ -71,4 +73,7 @@ public class MainApplication extends MultiDexApplication {
|
||||
}
|
||||
}
|
||||
|
||||
public void handleRatingFlow(@NonNull Activity activity) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -218,6 +218,7 @@ public class MainFragment extends PreferenceFragmentCompat implements OnSharedPr
|
||||
} else {
|
||||
stopTrackingService();
|
||||
}
|
||||
((MainApplication) getActivity().getApplication()).handleRatingFlow(getActivity());
|
||||
} else if (key.equals(KEY_DEVICE)) {
|
||||
findPreference(KEY_DEVICE).setSummary(sharedPreferences.getString(KEY_DEVICE, null));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012 - 2019 Anton Tananaev (anton@traccar.org)
|
||||
* Copyright 2012 - 2020 Anton Tananaev (anton@traccar.org)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -34,6 +34,9 @@ import android.util.Log;
|
||||
|
||||
public class TrackingService extends Service {
|
||||
|
||||
public static final String ACTION_STARTED = "org.traccar.action.SERVICE_STARTED";
|
||||
public static final String ACTION_STOPPED = "org.traccar.action.SERVICE_STOPPED";
|
||||
|
||||
private static final String TAG = TrackingService.class.getSimpleName();
|
||||
private static final int NOTIFICATION_ID = 1;
|
||||
|
||||
@@ -82,6 +85,7 @@ public class TrackingService extends Service {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
Log.i(TAG, "service create");
|
||||
sendBroadcast(new Intent(ACTION_STARTED));
|
||||
StatusActivity.addMessage(getString(R.string.status_service_create));
|
||||
|
||||
startForeground(NOTIFICATION_ID, createNotification(this));
|
||||
@@ -120,6 +124,7 @@ public class TrackingService extends Service {
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
Log.i(TAG, "service destroy");
|
||||
sendBroadcast(new Intent(ACTION_STOPPED));
|
||||
StatusActivity.addMessage(getString(R.string.status_service_destroy));
|
||||
|
||||
stopForeground(true);
|
||||
|
||||
Ссылка в новой задаче
Block a user