|
|
@@ -316,62 +316,264 @@ final class GM {
|
|
|
/**
|
|
|
* Queries to empty tables.
|
|
|
*/
|
|
|
+ @SuppressWarnings("unused")
|
|
|
final class EMPTY {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "activity".
|
|
|
+ */
|
|
|
static final String ACTIVITY = "DELETE FROM activity;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "activity_comment".
|
|
|
+ */
|
|
|
static final String ACTIVITY_COMMENT = "DELETE FROM activity_comment;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "activity_image".
|
|
|
+ */
|
|
|
static final String ACTIVITY_IMAGE = "DELETE FROM activity_image;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "activity_itinerary".
|
|
|
+ */
|
|
|
static final String ACTIVITY_ITINERARY = "DELETE FROM activity_itinerary;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "activity_tag".
|
|
|
+ */
|
|
|
static final String ACTIVITY_TAG = "DELETE FROM activity_tag;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "album".
|
|
|
+ */
|
|
|
static final String ALBUM = "DELETE FROM album;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "festival".
|
|
|
+ */
|
|
|
static final String FESTIVAL = "DELETE FROM festival;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "festival_day".
|
|
|
+ */
|
|
|
static final String FESTIVAL_DAY = "DELETE FROM festival_day;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "festival_event".
|
|
|
+ */
|
|
|
static final String FESTIVAL_EVENT = "DELETE FROM festival_event;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "festival_event".
|
|
|
+ */
|
|
|
static final String FESTIVAL_EVENT_IMAGE = "DELETE FROM festival_event_image;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "festival_offer".
|
|
|
+ */
|
|
|
static final String FESTIVAL_OFFER = "DELETE FROM festival_offer;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "location".
|
|
|
+ */
|
|
|
static final String LOCATION = "DELETE FROM location;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "notification".
|
|
|
+ */
|
|
|
static final String NOTIFICATION = "DELETE FROM notification;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "people".
|
|
|
+ */
|
|
|
static final String PEOPLE = "DELETE FROM people;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "photo".
|
|
|
+ */
|
|
|
static final String PHOTO = "DELETE FROM photo;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "photo_album".
|
|
|
+ */
|
|
|
static final String PHOTO_ALBUM = "DELETE FROM photo_album;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "photo_comment".
|
|
|
+ */
|
|
|
static final String PHOTO_COMMENT = "DELETE FROM photo_comment;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "place".
|
|
|
+ */
|
|
|
static final String PLACE = "DELETE FROM place;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "post".
|
|
|
+ */
|
|
|
static final String POST = "DELETE FROM post;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "post_comment".
|
|
|
+ */
|
|
|
static final String POST_COMMENT = "DELETE FROM post_comment;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "post_image".
|
|
|
+ */
|
|
|
static final String POST_IMAGE = "DELETE FROM post_image;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "post_tag".
|
|
|
+ */
|
|
|
static final String POST_TAG = "DELETE FROM post_tag;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "settings".
|
|
|
+ */
|
|
|
static final String SETTINGS = "DELETE FROM settings;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "sponsor".
|
|
|
+ */
|
|
|
static final String SPONSOR = "DELETE FROM sponsor;";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Empties the table "version".
|
|
|
+ */
|
|
|
static final String VERSION = "DELETE FROM version;";
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Queries to remove and the recreate tables.
|
|
|
*/
|
|
|
+ @SuppressWarnings("unused")
|
|
|
final class RECREATE {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "activity".
|
|
|
+ */
|
|
|
static final String ACTIVITY = GM.DB.QUERY.DROP.ACTIVITY + GM.DB.QUERY.CREATE.ACTIVITY;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "activity_comment".
|
|
|
+ */
|
|
|
static final String ACTIVITY_COMMENT = GM.DB.QUERY.DROP.ACTIVITY_COMMENT + GM.DB.QUERY.CREATE.ACTIVITY_COMMENT;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "activity_image".
|
|
|
+ */
|
|
|
static final String ACTIVITY_IMAGE = GM.DB.QUERY.DROP.ACTIVITY_IMAGE + GM.DB.QUERY.CREATE.ACTIVITY_IMAGE;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "itinerary".
|
|
|
+ */
|
|
|
static final String ACTIVITY_ITINERARY = GM.DB.QUERY.DROP.ACTIVITY_ITINERARY + GM.DB.QUERY.CREATE.ACTIVITY_ITINERARY;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "activity_tag".
|
|
|
+ */
|
|
|
static final String ACTIVITY_TAG = GM.DB.QUERY.DROP.ACTIVITY_TAG + GM.DB.QUERY.CREATE.ACTIVITY_TAG;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "album".
|
|
|
+ */
|
|
|
static final String ALBUM = GM.DB.QUERY.DROP.ALBUM + GM.DB.QUERY.CREATE.ALBUM;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "festival".
|
|
|
+ */
|
|
|
static final String FESTIVAL = GM.DB.QUERY.DROP.FESTIVAL + GM.DB.QUERY.CREATE.FESTIVAL;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "festival_day".
|
|
|
+ */
|
|
|
static final String FESTIVAL_DAY = GM.DB.QUERY.DROP.FESTIVAL_DAY + GM.DB.QUERY.CREATE.FESTIVAL_DAY;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "festival_event".
|
|
|
+ */
|
|
|
static final String FESTIVAL_EVENT = GM.DB.QUERY.DROP.FESTIVAL_EVENT + GM.DB.QUERY.CREATE.FESTIVAL_EVENT;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "festival_event_image".
|
|
|
+ */
|
|
|
static final String FESTIVAL_EVENT_IMAGE = GM.DB.QUERY.DROP.FESTIVAL_EVENT_IMAGE + GM.DB.QUERY.CREATE.FESTIVAL_EVENT_IMAGE;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "festival_offer".
|
|
|
+ */
|
|
|
static final String FESTIVAL_OFFER = GM.DB.QUERY.DROP.FESTIVAL_OFFER + GM.DB.QUERY.CREATE.FESTIVAL_OFFER;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "location".
|
|
|
+ */
|
|
|
static final String LOCATION = GM.DB.QUERY.DROP.LOCATION + GM.DB.QUERY.CREATE.LOCATION;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "notification".
|
|
|
+ */
|
|
|
static final String NOTIFICATION = GM.DB.QUERY.DROP.NOTIFICATION + GM.DB.QUERY.CREATE.NOTIFICATION;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "people".
|
|
|
+ */
|
|
|
static final String PEOPLE = GM.DB.QUERY.DROP.PEOPLE + GM.DB.QUERY.CREATE.PEOPLE;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "photo".
|
|
|
+ */
|
|
|
static final String PHOTO = GM.DB.QUERY.DROP.PHOTO + GM.DB.QUERY.CREATE.PHOTO;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "photo_album".
|
|
|
+ */
|
|
|
static final String PHOTO_ALBUM = GM.DB.QUERY.DROP.PHOTO_ALBUM + GM.DB.QUERY.CREATE.PHOTO_ALBUM;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "photo_comment".
|
|
|
+ */
|
|
|
static final String PHOTO_COMMENT = GM.DB.QUERY.DROP.PHOTO_COMMENT + GM.DB.QUERY.CREATE.PHOTO_COMMENT;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "place".
|
|
|
+ */
|
|
|
static final String PLACE = GM.DB.QUERY.DROP.PLACE + GM.DB.QUERY.CREATE.PLACE;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "post".
|
|
|
+ */
|
|
|
static final String POST = GM.DB.QUERY.DROP.POST + GM.DB.QUERY.CREATE.POST;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "post_comment".
|
|
|
+ */
|
|
|
static final String POST_COMMENT = GM.DB.QUERY.DROP.POST_COMMENT + GM.DB.QUERY.CREATE.POST_COMMENT;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "post_image".
|
|
|
+ */
|
|
|
static final String POST_IMAGE = GM.DB.QUERY.DROP.POST_IMAGE + GM.DB.QUERY.CREATE.POST_IMAGE;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "post_tag".
|
|
|
+ */
|
|
|
static final String POST_TAG = GM.DB.QUERY.DROP.POST_TAG + GM.DB.QUERY.CREATE.POST_TAG;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "settings".
|
|
|
+ */
|
|
|
static final String SETTINGS = GM.DB.QUERY.DROP.SETTINGS + GM.DB.QUERY.CREATE.SETTINGS;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "sponsor".
|
|
|
+ */
|
|
|
static final String SPONSOR = GM.DB.QUERY.DROP.SPONSOR + GM.DB.QUERY.CREATE.SPONSOR;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes and then recreates the table "version".
|
|
|
+ */
|
|
|
static final String VERSION = GM.DB.QUERY.DROP.VERSION + GM.DB.QUERY.CREATE.VERSION;
|
|
|
}
|
|
|
}
|
|
|
@@ -392,8 +594,19 @@ final class GM {
|
|
|
*/
|
|
|
static final class KEY {
|
|
|
|
|
|
+ /**
|
|
|
+ * Key of the data string to store the user id with.
|
|
|
+ */
|
|
|
static final String USER = "user_id";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Key of the data to store the previous app version with.
|
|
|
+ */
|
|
|
static final String PREVIOUS_APP_VERSION = "previous_app_version";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Key of the data to store if ther is a festival season..
|
|
|
+ */
|
|
|
static final String LABLANCA = "lablanca";
|
|
|
}
|
|
|
|
|
|
@@ -402,8 +615,20 @@ final class GM {
|
|
|
*/
|
|
|
static final class DEFAULT {
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Default string for the user.
|
|
|
+ */
|
|
|
static final String USER = "";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Default value for the previous app version data.
|
|
|
+ */
|
|
|
static final int PREVIOUS_APP_VERSION = 0;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Default value for the data that indicates if it's festival season.
|
|
|
+ */
|
|
|
static final boolean LABLANCA = false;
|
|
|
}
|
|
|
}
|
|
|
@@ -413,6 +638,9 @@ final class GM {
|
|
|
*/
|
|
|
static final class PREFERENCES {
|
|
|
|
|
|
+ /**
|
|
|
+ * Name of the file where preferences will be stored.
|
|
|
+ */
|
|
|
static final String PREFERNCES = "preferences";
|
|
|
|
|
|
/**
|
|
|
@@ -420,7 +648,14 @@ final class GM {
|
|
|
*/
|
|
|
static final class KEY {
|
|
|
|
|
|
+ /**
|
|
|
+ * Key to store the sync status.
|
|
|
+ */
|
|
|
static final String SYNC = "performBackgroundSyncs";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Key to store the notification preference status.
|
|
|
+ */
|
|
|
static final String NOTIFICATIONS = "recieveNotificacions";
|
|
|
}
|
|
|
|
|
|
@@ -429,7 +664,14 @@ final class GM {
|
|
|
*/
|
|
|
static final class DEFAULT {
|
|
|
|
|
|
+ /**
|
|
|
+ * Default value for the sync preference.
|
|
|
+ */
|
|
|
static final boolean SYNC = true;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Default value for the notification preference.
|
|
|
+ */
|
|
|
static final boolean NOTIFICATIONS = true;
|
|
|
}
|
|
|
}
|
|
|
@@ -438,42 +680,196 @@ final class GM {
|
|
|
* Used URLs.
|
|
|
*/
|
|
|
static class URL {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * URL of the project on GitHub.
|
|
|
+ */
|
|
|
static final String GITHUB = "https://github.com/GasteizkoMargolariak/GasteizkoMargolariakApp";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * URL of the server.
|
|
|
+ */
|
|
|
+ static final String SERVER = "http://margolariak.com";
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Info about the API.
|
|
|
*/
|
|
|
- public static final class API {
|
|
|
-
|
|
|
+ static final class API {
|
|
|
|
|
|
+ /**
|
|
|
+ * Name of the client.
|
|
|
+ */
|
|
|
static final String CLIENT = "com.ivalentin.margolariak";
|
|
|
|
|
|
- static final String SERVER = "http://margolariak.com";
|
|
|
+ /**
|
|
|
+ * URL of the server.
|
|
|
+ */
|
|
|
+ static final String SERVER = URL.SERVER;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Utilities for the Sync V1 API.
|
|
|
+ */
|
|
|
+ static final class SYNC {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Path to the API.
|
|
|
+ */
|
|
|
+ static final String PATH = "/API/v1/sync.php";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Keys fotr the API parameters.
|
|
|
+ */
|
|
|
+ static final class KEY {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Key for the client identifier.
|
|
|
+ */
|
|
|
+ static final String CLIENT = "client";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Key for the user identifier.
|
|
|
+ */
|
|
|
+ static final String USER = "user";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Key for the action to perform with the API ("sync" or "version").
|
|
|
+ */
|
|
|
+ static final String ACTION = "action";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Key for the section to sync.
|
|
|
+ */
|
|
|
+ static final String SECTION = "section";
|
|
|
|
|
|
- static final String SYNC = "/API/v1/sync.php";
|
|
|
+ /**
|
|
|
+ * Key for the current version of the database to send to the API.
|
|
|
+ */
|
|
|
+ static final String VERSION = "version";
|
|
|
|
|
|
- static final String ACTION = "sync";
|
|
|
- static final String SECTION = "all";
|
|
|
- static final String FORMAT = "json";
|
|
|
+ /**
|
|
|
+ * Key to indicate to the API if the sync is being performed on the foreground.
|
|
|
+ */
|
|
|
+ static final String FOREGROUND = "foreground";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Key to indicate the format of the data for the API to send.
|
|
|
+ */
|
|
|
+ static final String FORMAT = "format";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Key to indicate the language to the API.
|
|
|
+ */
|
|
|
+ static final String LANG = "lang";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Values for the parameters.
|
|
|
+ */
|
|
|
+ static final class VALUE {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Value for the ACTION key.
|
|
|
+ */
|
|
|
+ static final String ACTION = "sync";
|
|
|
|
|
|
- static final class KEY{
|
|
|
+ /**
|
|
|
+ * Value for the SECTION key,
|
|
|
+ */
|
|
|
+ static final String SECTION = "all";
|
|
|
|
|
|
- static final String CLIENT = "client";
|
|
|
- static final String USER = "user";
|
|
|
- static final String ACTION = "action";
|
|
|
- static final String SECTION = "section";
|
|
|
- static final String VERSION = "version";
|
|
|
- static final String FOREGROUND = "foreground";
|
|
|
- static final String FORMAT = "format";
|
|
|
- static final String LANG = "lang";
|
|
|
+ /**
|
|
|
+ * Value for the FORMAT key.
|
|
|
+ */
|
|
|
+ static final String FORMAT = "json";
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Utilities for the Location V1 API.
|
|
|
+ */
|
|
|
+ static final class LOCATION {
|
|
|
|
|
|
+ /**
|
|
|
+ * Path to the API.
|
|
|
+ */
|
|
|
+ static final String PATH = "/API/v1/location.php";
|
|
|
|
|
|
+ /**
|
|
|
+ * Keys fotr the API parameters.
|
|
|
+ */
|
|
|
+ static final class KEY {
|
|
|
|
|
|
+ /**
|
|
|
+ * Key to indicate the format of the data for the API to send.
|
|
|
+ */
|
|
|
+ static final String FORMAT = "format";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Values for the parameters.
|
|
|
+ */
|
|
|
+ static final class VALUE {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Value for the FORMAT key.
|
|
|
+ */
|
|
|
+ static final String FORMAT = "json";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Utilities for the Notifications V1 API.
|
|
|
+ */
|
|
|
+ static final class NOTIFICATION {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Path to the API.
|
|
|
+ */
|
|
|
+ static final String PATH = "/API/v1/sync.php";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Keys fotr the API parameters.
|
|
|
+ */
|
|
|
+ static final class KEY {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Key for the client identifier.
|
|
|
+ */
|
|
|
+ static final String CLIENT = "client";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Key for the user identifier.
|
|
|
+ */
|
|
|
+ static final String USER = "user";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Key for the action to perform with the API ("sync" or "version").
|
|
|
+ */
|
|
|
+ static final String TARGET = "target";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Key to indicate the format of the data for the API to send.
|
|
|
+ */
|
|
|
+ static final String FORMAT = "format";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Values for the parameters.
|
|
|
+ */
|
|
|
+ static final class VALUE {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Value for the FORMAT key.
|
|
|
+ */
|
|
|
+ static final String FORMAT = "json";
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * App permissions.
|
|
|
+ */
|
|
|
static final class PERMISSION {
|
|
|
|
|
|
/**
|
|
|
@@ -483,6 +879,9 @@ final class GM {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * Periods to perform syncs.
|
|
|
+ */
|
|
|
static final class PERIOD_SYNC {
|
|
|
|
|
|
/**
|
|
|
@@ -496,82 +895,93 @@ final class GM {
|
|
|
static final int NORMAL = 60 * 60 * 1000;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Identifiers to differenciate schedules.
|
|
|
+ */
|
|
|
static final class SCHEDULE {
|
|
|
|
|
|
+ /**
|
|
|
+ * Key to pass as bundle.
|
|
|
+ */
|
|
|
static final String KEY = "schedule";
|
|
|
|
|
|
/**
|
|
|
- * Constant to diferentiate schedules".
|
|
|
+ * City schedule.
|
|
|
*/
|
|
|
static final int CITY = 0;
|
|
|
-
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Margolari schedule.
|
|
|
+ */
|
|
|
static final int MARGOLARIAK = 1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Extras to pass to the main activity to open notifications.
|
|
|
+ */
|
|
|
static final class EXTRA {
|
|
|
|
|
|
/**
|
|
|
- * Constant to set extras on the main intent.
|
|
|
+ * Title of the notification.
|
|
|
*/
|
|
|
static final String TITLE = "title";
|
|
|
|
|
|
/**
|
|
|
- * Constant to set extras on the main intent.
|
|
|
+ * Text of the notification.
|
|
|
*/
|
|
|
static final String TEXT = "text";
|
|
|
|
|
|
/**
|
|
|
- * Constant to set extras on the main intent.
|
|
|
+ * Action for the button in the notification.
|
|
|
*/
|
|
|
static final String ACTION = "action";
|
|
|
|
|
|
+ /**
|
|
|
+ * Sections to open with the notification.
|
|
|
+ */
|
|
|
static final class SECTION {
|
|
|
|
|
|
/**
|
|
|
- * Value for {@see GM.EXTRA_ACTION} that opens the lablanca section.
|
|
|
+ * Value for {@see GM.EXTRA.ACTION} that opens the lablanca section.
|
|
|
*/
|
|
|
static final String LABLANCA = "lablanca";
|
|
|
|
|
|
/**
|
|
|
- * Value for {@see GM.EXTRA_ACTION} that opens the official schedule.
|
|
|
+ * Value for {@see GM.EXTRA.ACTION} that opens the official schedule.
|
|
|
*/
|
|
|
static final String SCHEDULE = "cityschedule";
|
|
|
|
|
|
/**
|
|
|
- * Value for {@see GM.EXTRA_ACTION} that opens the GM schedule.
|
|
|
+ * Value for {@see GM.EXTRA.ACTION} that opens the GM schedule.
|
|
|
*/
|
|
|
static final String GMSCHEDULE = "gmschedule";
|
|
|
|
|
|
/**
|
|
|
- * Value for {@see GM.EXTRA_ACTION} that opens the location secton.
|
|
|
+ * Value for {@see GM.EXTRA.ACTION} that opens the location secton.
|
|
|
*/
|
|
|
static final String LOCATION = "location";
|
|
|
|
|
|
/**
|
|
|
- * Value for {@see GM.EXTRA_ACTION} that opens the blog.
|
|
|
+ * Value for {@see GM.EXTRA.ACTION} that opens the blog.
|
|
|
*/
|
|
|
static final String BLOG = "blog";
|
|
|
|
|
|
/**
|
|
|
- * Value for {@see GM.EXTRA_ACTION} that opens the activities section.
|
|
|
+ * Value for {@see GM.EXTRA.ACTION} that opens the activities section.
|
|
|
*/
|
|
|
static final String ACTIVITIES = "activities";
|
|
|
|
|
|
/**
|
|
|
- * Value for {@see GM.EXTRA_ACTION} that opens the gallery section.
|
|
|
+ * Value for {@see GM.EXTRA.ACTION} that opens the gallery section.
|
|
|
*/
|
|
|
static final String GALLERY = "gallery";
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- public static final class SECTION {
|
|
|
-
|
|
|
- /**
|
|
|
- *Bundle identifier to pass between fragments.
|
|
|
- */
|
|
|
- static final String BUNDLE = "section";
|
|
|
+ /**
|
|
|
+ * Identifiers for app sections.
|
|
|
+ */
|
|
|
+ static final class SECTION {
|
|
|
|
|
|
/**
|
|
|
* Constant for section "Home".
|
|
|
@@ -614,11 +1024,16 @@ final class GM {
|
|
|
static final byte GALLERY = 5;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ /**
|
|
|
+ * Keys for the location manager.
|
|
|
+ */
|
|
|
static class LOCATION {
|
|
|
|
|
|
+ /**
|
|
|
+ * Required accuracy for the location manager.
|
|
|
+ */
|
|
|
static class ACCURACY {
|
|
|
+
|
|
|
/**
|
|
|
* The desired accuracy of the GPS coordinates, used to provide location updates, in meters.
|
|
|
*/
|
|
|
@@ -630,25 +1045,56 @@ final class GM {
|
|
|
static final int TIME = 10000;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Time interval to retrieve notifications.
|
|
|
+ */
|
|
|
static final int INTERVAL = 10000;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Data for the images.
|
|
|
+ */
|
|
|
static final class IMG {
|
|
|
|
|
|
/**
|
|
|
* Dimensions of the images in the database.
|
|
|
*/
|
|
|
- static final int MINIATURE = 340;
|
|
|
- static final int PREVIEW = 600;
|
|
|
- static final int THUMB = 180;
|
|
|
- static final int VIEW = 800;
|
|
|
+ static final class SIZE {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Max width and height for miniature images.
|
|
|
+ */
|
|
|
+ static final int MINIATURE = 340;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Max width and height for preview images.
|
|
|
+ */
|
|
|
+ static final int PREVIEW = 600;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Max width and height for thumbnail images.
|
|
|
+ */
|
|
|
+ @SuppressWarnings("unused")
|
|
|
+ static final int THUMB = 180;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Max width and height for view images.
|
|
|
+ */
|
|
|
+ static final int VIEW = 800;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- *Programaticall loaded rows needs their margin to also be set programatically
|
|
|
+ * Programmatically loaded rows needs their margin to also be set programmatically.
|
|
|
*/
|
|
|
- static final int ENTRY_MARGIN = 8;
|
|
|
+ static final class UI {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Margin for entries.
|
|
|
+ */
|
|
|
+ static final int ENTRY_MARGIN = 8;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* Gets the language code for sql queries.
|
|
|
@@ -683,7 +1129,7 @@ final class GM {
|
|
|
*
|
|
|
* @see android.support.v4.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
|
|
|
*/
|
|
|
- public static String formatDate(String dateString, String lang, boolean includeTime){
|
|
|
+ static String formatDate(String dateString, String lang, boolean includeTime){
|
|
|
|
|
|
String output = "";
|
|
|
|
|
|
@@ -748,7 +1194,14 @@ final class GM {
|
|
|
return output;
|
|
|
}
|
|
|
|
|
|
- public static Bitmap decodeSampledBitmapFromFile(String path, int size) { // BEST QUALITY MATCH
|
|
|
+ /**
|
|
|
+ * Creates a bitmap from a image.
|
|
|
+ *
|
|
|
+ * @param path Path of the image.
|
|
|
+ * @param size Max width and height.
|
|
|
+ * @return A bitmap with the image.
|
|
|
+ */
|
|
|
+ static Bitmap decodeSampledBitmapFromFile(String path, int size) { // BEST QUALITY MATCH
|
|
|
|
|
|
// First decode with inJustDecodeBounds=true to check dimensions
|
|
|
final BitmapFactory.Options options = new BitmapFactory.Options();
|