Added new events

This commit is contained in:
Alexey Kulish 2016-11-21 19:44:50 +03:00
parent 53434d7527
commit 865ad4ca2a
3 changed files with 18 additions and 0 deletions

View file

@ -579,6 +579,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ContextMenuAdapter.ItemClickListener() { .setListener(new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_dashboard_open");
MapActivity.clearPrevActivityIntent(); MapActivity.clearPrevActivityIntent();
mapActivity.closeDrawer(); mapActivity.closeDrawer();
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.DASHBOARD); mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.DASHBOARD);
@ -591,6 +592,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ContextMenuAdapter.ItemClickListener() { .setListener(new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_markers_open");
MapActivity.clearPrevActivityIntent(); MapActivity.clearPrevActivityIntent();
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.MAP_MARKERS); mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.MAP_MARKERS);
return false; return false;
@ -602,6 +604,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ContextMenuAdapter.ItemClickListener() { .setListener(new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_waypoints_open");
MapActivity.clearPrevActivityIntent(); MapActivity.clearPrevActivityIntent();
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS); mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS);
return false; return false;
@ -614,6 +617,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ContextMenuAdapter.ItemClickListener() { .setListener(new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_myplaces_open");
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization() Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
.getFavoritesActivity()); .getFavoritesActivity());
newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
@ -627,6 +631,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ContextMenuAdapter.ItemClickListener() { .setListener(new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_search_open");
mapActivity.showQuickSearch(MapActivity.ShowQuickSearchMode.NEW_IF_EXPIRED, false); mapActivity.showQuickSearch(MapActivity.ShowQuickSearchMode.NEW_IF_EXPIRED, false);
return true; return true;
} }
@ -638,6 +643,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ContextMenuAdapter.ItemClickListener() { .setListener(new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_legacy_search_open");
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization() Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
.getSearchActivity()); .getSearchActivity());
LatLon loc = mapActivity.getMapLocation(); LatLon loc = mapActivity.getMapLocation();
@ -658,6 +664,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ContextMenuAdapter.ItemClickListener() { .setListener(new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_config_map_open");
MapActivity.clearPrevActivityIntent(); MapActivity.clearPrevActivityIntent();
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_MAP); mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_MAP);
return false; return false;
@ -669,6 +676,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ContextMenuAdapter.ItemClickListener() { .setListener(new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_directions_open");
MapControlsLayer mapControlsLayer = mapActivity.getMapLayers().getMapControlsLayer(); MapControlsLayer mapControlsLayer = mapActivity.getMapLayers().getMapControlsLayer();
if (mapControlsLayer != null) { if (mapControlsLayer != null) {
mapControlsLayer.doRoute(false); mapControlsLayer.doRoute(false);
@ -689,6 +697,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ContextMenuAdapter.ItemClickListener() { .setListener(new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_download_maps_open");
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization() Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
.getDownloadActivity()); .getDownloadActivity());
newIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); newIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
@ -703,6 +712,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ContextMenuAdapter.ItemClickListener() { .setListener(new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_osm_live_open");
Intent intent = new Intent(mapActivity, OsmLiveActivity.class); Intent intent = new Intent(mapActivity, OsmLiveActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
mapActivity.startActivity(intent); mapActivity.startActivity(intent);
@ -729,6 +739,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ItemClickListener() { .setListener(new ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_plugins_open");
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization() Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
.getPluginsActivity()); .getPluginsActivity());
newIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); newIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
@ -742,6 +753,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ContextMenuAdapter.ItemClickListener() { .setListener(new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_config_screen_open");
MapActivity.clearPrevActivityIntent(); MapActivity.clearPrevActivityIntent();
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_SCREEN); mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_SCREEN);
return false; return false;
@ -753,6 +765,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ContextMenuAdapter.ItemClickListener() { .setListener(new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_settings_open");
final Intent settings = new Intent(mapActivity, getMyApplication().getAppCustomization() final Intent settings = new Intent(mapActivity, getMyApplication().getAppCustomization()
.getSettingsActivity()); .getSettingsActivity());
settings.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); settings.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
@ -779,6 +792,7 @@ public class MapActivityActions implements DialogProvider {
.setListener(new ContextMenuAdapter.ItemClickListener() { .setListener(new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
app.logEvent(mapActivity, "drawer_help_open");
Intent intent = new Intent(mapActivity, HelpActivity.class); Intent intent = new Intent(mapActivity, HelpActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
mapActivity.startActivity(intent); mapActivity.startActivity(intent);

View file

@ -379,6 +379,7 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo
&& isDownlodingPermitted(ctx.getMyApplication().getSettings())) { && isDownlodingPermitted(ctx.getMyApplication().getSettings())) {
collapseBanner(); collapseBanner();
} else { } else {
ctx.getMyApplication().logEvent(ctx, "click_free_dialog");
new FreeVersionDialogFragment().show(ctx.getSupportFragmentManager(), "dialog"); new FreeVersionDialogFragment().show(ctx.getSupportFragmentManager(), "dialog");
// expandBanner(); // expandBanner();
} }
@ -436,6 +437,7 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo
fullVersionButton.setOnClickListener(new OnClickListener() { fullVersionButton.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
ctx.getMyApplication().logEvent(ctx, "click_buy_plus");
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(Version.marketPrefix( Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(Version.marketPrefix(
ctx.getMyApplication()) + "net.osmand.plus")); ctx.getMyApplication()) + "net.osmand.plus"));
try { try {
@ -448,6 +450,7 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo
osmLiveButton.setOnClickListener(new OnClickListener() { osmLiveButton.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
ctx.getMyApplication().logEvent(ctx, "click_subscribe_live_osm");
Intent intent = new Intent(ctx, OsmLiveActivity.class); Intent intent = new Intent(ctx, OsmLiveActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
intent.putExtra(OsmLiveActivity.OPEN_SUBSCRIPTION_INTENT_PARAM, true); intent.putExtra(OsmLiveActivity.OPEN_SUBSCRIPTION_INTENT_PARAM, true);

View file

@ -359,6 +359,7 @@ public class SubscriptionFragment extends BaseOsmAndDialogFragment implements In
@Override @Override
public void onItemPurchased(String sku) { public void onItemPurchased(String sku) {
getMyApplication().logEvent(getActivity(), "live_osm_subscription_purchased");
dismiss(); dismiss();
} }