Add operation records analytics

This commit is contained in:
seven332 committed 2019-02-18 22:03:36 +08:00
1 parent dd700a0f2d
commit 169f4c3eb8
10 files changed
+131 -2

No files matched your search

@@ -25,6 +25,7 @@ import android.os.AsyncTask;
import android.util.Log;
import androidx.appcompat.app.AlertDialog;
import com.hippo.app.ListCheckBoxDialogBuilder;
import com.hippo.ehviewer.Analytics;
import com.hippo.ehviewer.EhApplication;
import com.hippo.ehviewer.EhDB;
import com.hippo.ehviewer.R;
@@ -195,6 +196,7 @@ public final class CommonOperations {
if (slot == -1) {
EhDB.putLocalFavorites(galleryInfo);
listener.onSuccess(null);
Analytics.addGalleryToFavourite(galleryInfo.gid, galleryInfo.token);
} else if (slot >= 0 && slot <= 9) {
EhClient client = EhApplication.getEhClient(activity);
EhRequest request = new EhRequest();
@@ -202,6 +204,7 @@ public final class CommonOperations {
request.setArgs(galleryInfo.gid, galleryInfo.token, slot, "");
request.setCallback(listener);
client.execute(request);
Analytics.addGalleryToFavourite(galleryInfo.gid, galleryInfo.token);
} else {
listener.onFailure(new Exception()); // TODO Add text
}