From f5ac97b332b4b6d4bd5ca5e3f9c91967bef9840e Mon Sep 17 00:00:00 2001 From: Mattia Date: Wed, 2 May 2018 22:23:05 +0200 Subject: [PATCH] fix enum --- .../it/icarusandroid/MainActivity.java | 4 ++-- .../it/icarus/EventTrackResource.java | 10 ++++++++++ .../everywaretechnologies/it/icarus/Icarus.java | 6 ------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/IcarusAndroid/app/src/main/java/framework/everywaretechnologies/it/icarusandroid/MainActivity.java b/IcarusAndroid/app/src/main/java/framework/everywaretechnologies/it/icarusandroid/MainActivity.java index 9bf1795..168aeba 100644 --- a/IcarusAndroid/app/src/main/java/framework/everywaretechnologies/it/icarusandroid/MainActivity.java +++ b/IcarusAndroid/app/src/main/java/framework/everywaretechnologies/it/icarusandroid/MainActivity.java @@ -108,10 +108,10 @@ public class MainActivity extends AppCompatActivity { if(eventNameEditText.getText().length() == 0) eventName="eventoProva"; else eventName=eventNameEditText.getText().toString(); - if(eventCategoryEditText.getText().length()==0) eventCategory=Icarus.EventCategories.APPLICATION.toString(); + if(eventCategoryEditText.getText().length()==0) eventCategory=EventTrackResource.EventCategories.APPLICATION.name().toLowerCase(); else eventCategory=eventCategoryEditText.getText().toString(); - if(eventLabelEditText.getText().length()==0) eventLabel = "labelProva"; + if(eventLabelEditText.getText().length()==0) eventLabel = EventTrackResource.EventLabel.FOREGROUND.name().toLowerCase(); else eventLabel=eventLabelEditText.getText().toString(); if(mostProbableActivityEditText.getText().length()==0) mostProbableActivity="activityProva"; diff --git a/IcarusAndroid/icarus/src/main/java/framework/everywaretechnologies/it/icarus/EventTrackResource.java b/IcarusAndroid/icarus/src/main/java/framework/everywaretechnologies/it/icarus/EventTrackResource.java index 0e50dc9..8b18022 100644 --- a/IcarusAndroid/icarus/src/main/java/framework/everywaretechnologies/it/icarus/EventTrackResource.java +++ b/IcarusAndroid/icarus/src/main/java/framework/everywaretechnologies/it/icarus/EventTrackResource.java @@ -5,6 +5,16 @@ import org.json.JSONObject; public class EventTrackResource extends IcarusResource { + public enum EventCategories{ //categorie di evento + + APPLICATION,ACTION,NOTIFICATION; + } + + public enum EventLabel{ + + FOREGROUND,BACKGROUND; + } + private String eventName; private String eventCategory; private String eventLabel; diff --git a/IcarusAndroid/icarus/src/main/java/framework/everywaretechnologies/it/icarus/Icarus.java b/IcarusAndroid/icarus/src/main/java/framework/everywaretechnologies/it/icarus/Icarus.java index 10ad48e..c6b8c39 100644 --- a/IcarusAndroid/icarus/src/main/java/framework/everywaretechnologies/it/icarus/Icarus.java +++ b/IcarusAndroid/icarus/src/main/java/framework/everywaretechnologies/it/icarus/Icarus.java @@ -37,12 +37,6 @@ import java.util.function.Consumer; public class Icarus { - public enum EventCategories{ //categorie di evento - - APPLICATION,ACTION,NOTIFICATION; - } - - private final static String ICARUS_URL="https://webdev.ewlab.di.unimi.it/icarus/str"; -- 2.18.1