Some GA for Floating Calculator

This commit is contained in:
serso
2015-02-13 09:12:12 +01:00
parent c0a7076c6b
commit d82cbcb7fc
4 changed files with 21 additions and 5 deletions

View File

@@ -90,4 +90,19 @@ public final class Ga implements SharedPreferences.OnSharedPreferenceChangeListe
reportLayout(Preferences.Gui.layout.getPreferenceNoError(preferences));
reportTheme(Preferences.Gui.theme.getPreferenceNoError(preferences));
}
public void onBootStart() {
final HitBuilders.EventBuilder b = new HitBuilders.EventBuilder();
b.setCategory("lifecycle");
b.setAction("boot");
tracker.send(b.build());
}
public void onFloatingCalculatorOpened() {
final HitBuilders.EventBuilder b = new HitBuilders.EventBuilder();
b.setCategory("lifecycle");
b.setAction("floating_calculator");
b.setLabel("start");
tracker.send(b.build());
}
}

View File

@@ -30,6 +30,7 @@ import android.preference.PreferenceManager;
import javax.annotation.Nonnull;
import org.solovyev.android.calculator.App;
import org.solovyev.android.calculator.Preferences;
/**
@@ -50,6 +51,7 @@ public final class CalculatorOnscreenBroadcastReceiver extends BroadcastReceiver
if (Preferences.OnscreenCalculator.startOnBoot.getPreferenceNoError(preferences)) {
CalculatorOnscreenService.showNotification(context);
}
App.getGa().onBootStart();
} else {
final Intent newIntent = new Intent(intent);
newIntent.setClass(context, CalculatorOnscreenService.class);

View File

@@ -154,6 +154,7 @@ public class CalculatorOnscreenService extends Service implements OnscreenViewLi
if (isShowWindowIntent(intent)) {
hideNotification();
createView();
App.getGa().onFloatingCalculatorOpened();
} else if (isShowNotificationIntent(intent)) {
showNotification();
}