Skip to content

Annotations

Michael edited this page Apr 4, 2017 · 11 revisions

Welcome to a wiki page. Ganalytics is a library to simplify your work with analytics in app. Here you can find list of all currently supported annotations with their descriptions:

@HasPrefix

Annotation used when you want to add prefixes for your action in an interface. Scope: method, interface. When this annotation used on method then prefix applies only to it. When @HasPrefix used on interface, then settings of this annotation applies to all methods of interface (expect methods that already have such annotation).

It has two parameters:

  1. name - exactly title of prefix for using. For example:

    interface SomeCategory {
       @HasPrefix("cat") fun someAction()
    }

    will produce category = "somecategory" and action = "catsomeaction"

  2. splitter - you can specify delimiter between prefix and action. For example:

    interface SomeCategory {
       @HasPrefix("cat", splitter = "-") fun someAction()
    }

    will produce category = "somecategory" and action = "cat-someaction"

**Note: ** @HasPrefix without name will use name of interface (in lower case) as prefix.

@NoPrefix

In case when @HasPrefix used on interface for some methods you don't want to use prefix. In this case @NoPrefix can help. For example:

@HasPrefix
interface SomeCategory {
   fun action1()
   @NoPrefix fun action2()
}

will produce two events:

  1. category = "somecategory" and action = "somecategoryaction1"
  2. category = "somecategory" and action = "action2"

л

Clone this wiki locally