From a910beca51f9dab43c71de1f73bbdfa0a6adb333 Mon Sep 17 00:00:00 2001 From: Pierre Date: Tue, 10 Apr 2018 18:50:50 +0200 Subject: [PATCH] Restructured data folder --- .../comunic/client/api/APIRequest.java | 8 +++--- .../comunic/client/data/DatabaseContract.java | 4 +-- .../{notifications => arrays}/NotifsList.java | 6 +++-- .../data/{posts => arrays}/PostsList.java | 5 ++-- .../asynctasks}/APIRequestTask.java | 22 +++------------- .../GetUsersInfos.java | 11 +++----- .../ImageLoadTask.java | 3 ++- .../data/{likes => enums}/LikesType.java | 2 +- .../NotifElemType.java | 2 +- .../NotificationTypes.java | 2 +- .../NotificationVisibility.java | 4 +-- .../data/{posts => enums}/PageType.java | 2 +- .../data/{posts => enums}/PostTypes.java | 4 +-- .../data/{posts => enums}/PostUserAccess.java | 4 +-- .../PostVisibilityLevels.java | 2 +- .../AccountHelper.java} | 6 ++--- .../{comments => helpers}/CommentsHelper.java | 3 ++- .../ConversationMessagesDbHelper.java | 5 ++-- .../ConversationMessagesHelper.java | 10 ++++---- .../ConversationsListDbHelper.java | 5 ++-- .../ConversationsListHelper.java | 9 +++---- .../data/{ => helpers}/DatabaseHelper.java | 3 ++- .../FriendsListDbHelper.java | 4 +-- .../FriendsListHelper.java | 6 ++--- .../GetUsersHelper.java | 5 ++-- .../ImageLoadHelper.java} | 8 +++--- .../data/{likes => helpers}/LikesHelper.java | 3 ++- .../NotificationsHelper.java | 8 +++++- .../data/{posts => helpers}/PostsHelper.java | 11 +++++--- .../UsersInfosDbHelper.java | 4 +-- .../AdvancedUserInfo.java | 2 +- .../data/{comments => models}/Comment.java | 2 +- .../ConversationMessage.java | 8 +++--- .../ConversationsInfo.java | 14 +++++------ .../data/{posts => models}/CreatePost.java | 2 +- .../data/{friendsList => models}/Friend.java | 2 +- .../{friendsList => models}/FriendUser.java | 4 +-- .../data/{notifications => models}/Notif.java | 6 ++++- .../NotificationsCount.java | 2 +- .../client/data/{posts => models}/Post.java | 15 ++++++----- .../data/{UsersInfo => models}/UserInfo.java | 2 +- .../ConversationRefreshRunnable.java | 5 +++- .../FriendRefreshLoopRunnable.java | 4 +-- .../FriendsListRefreshRunnable.java | 7 ++++-- .../ImageDownloadRunnable.java | 4 +-- .../ImageLoadApplyRunnable.java | 2 +- .../ImageLoadRunnable.java | 8 +++--- .../data/services/NotificationsService.java | 8 +++--- .../data/{Account => utils}/AccountUtils.java | 5 ++-- .../{friendsList => utils}/FriendsUtils.java | 8 +++--- .../{ImageLoad => utils}/ImageLoadUtils.java | 10 ++++---- .../client/ui/activities/LoginActivity.java | 9 ++++--- .../client/ui/activities/MainActivity.java | 25 +++++++++---------- .../ui/activities/SearchUserActivity.java | 6 ++--- .../client/ui/adapters/CommentsAdapter.java | 19 ++++++-------- .../adapters/ConversationMessageAdapter.java | 17 ++++++------- .../ui/adapters/ConversationsListAdapter.java | 2 +- .../client/ui/adapters/FriendsAdapter.java | 6 ++--- .../ui/adapters/NotificationsAdapter.java | 12 ++++----- .../client/ui/adapters/PostsAdapter.java | 23 ++++++++--------- .../ui/adapters/UsersAsysncInfoAdapter.java | 10 ++++---- .../client/ui/adapters/UsersBasicAdapter.java | 11 ++++---- .../ui/fragments/ConversationFragment.java | 20 +++++++-------- .../fragments/ConversationsListFragment.java | 16 ++++++------ .../ui/fragments/FriendsListFragment.java | 16 ++++++------ .../ui/fragments/NotificationsFragment.java | 7 +++--- .../ui/fragments/PostsCreateFormFragment.java | 13 +++++----- .../ui/fragments/PostsListFragment.java | 22 ++++++++-------- .../fragments/UpdateConversationFragment.java | 12 ++++----- .../ui/fragments/UserInfosFragment.java | 10 ++++---- .../client/ui/fragments/UserPageFragment.java | 22 ++++++++-------- .../{data => ui}/utils/BitmapUtils.java | 2 +- .../client/{data => ui}/utils/UiUtils.java | 2 +- .../client/ui/views/LikeButtonView.java | 2 +- 74 files changed, 290 insertions(+), 285 deletions(-) rename app/src/main/java/org/communiquons/android/comunic/client/data/{notifications => arrays}/NotifsList.java (88%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{posts => arrays}/PostsList.java (84%) rename app/src/main/java/org/communiquons/android/comunic/client/{api => data/asynctasks}/APIRequestTask.java (67%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{UsersInfo => asynctasks}/GetUsersInfos.java (88%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{ImageLoad => asynctasks}/ImageLoadTask.java (96%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{likes => enums}/LikesType.java (78%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{notifications => enums}/NotifElemType.java (88%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{notifications => enums}/NotificationTypes.java (90%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{notifications => enums}/NotificationVisibility.java (77%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{posts => enums}/PageType.java (72%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{posts => enums}/PostTypes.java (77%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{posts => enums}/PostUserAccess.java (84%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{posts => enums}/PostVisibilityLevels.java (82%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{Account/Account.java => helpers/AccountHelper.java} (96%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{comments => helpers}/CommentsHelper.java (97%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{conversations => helpers}/ConversationMessagesDbHelper.java (97%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{conversations => helpers}/ConversationMessagesHelper.java (94%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{conversations => helpers}/ConversationsListDbHelper.java (97%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{conversations => helpers}/ConversationsListHelper.java (97%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{ => helpers}/DatabaseHelper.java (98%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{friendsList => helpers}/FriendsListDbHelper.java (98%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{friendsList => helpers}/FriendsListHelper.java (96%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{UsersInfo => helpers}/GetUsersHelper.java (98%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{ImageLoad/ImageLoadManager.java => helpers/ImageLoadHelper.java} (92%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{likes => helpers}/LikesHelper.java (93%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{notifications => helpers}/NotificationsHelper.java (93%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{posts => helpers}/PostsHelper.java (94%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{UsersInfo => helpers}/UsersInfosDbHelper.java (98%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{UsersInfo => models}/AdvancedUserInfo.java (91%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{comments => models}/Comment.java (97%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{conversations => models}/ConversationMessage.java (94%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{conversations => models}/ConversationsInfo.java (94%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{posts => models}/CreatePost.java (78%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{friendsList => models}/Friend.java (97%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{friendsList => models}/FriendUser.java (91%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{notifications => models}/Notif.java (90%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{notifications => models}/NotificationsCount.java (91%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{posts => models}/Post.java (86%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{UsersInfo => models}/UserInfo.java (97%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{conversations => runnables}/ConversationRefreshRunnable.java (96%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{friendsList => runnables}/FriendRefreshLoopRunnable.java (90%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{friendsList => runnables}/FriendsListRefreshRunnable.java (77%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{ImageLoad => runnables}/ImageDownloadRunnable.java (94%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{ImageLoad => runnables}/ImageLoadApplyRunnable.java (93%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{ImageLoad => runnables}/ImageLoadRunnable.java (94%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{Account => utils}/AccountUtils.java (94%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{friendsList => utils}/FriendsUtils.java (78%) rename app/src/main/java/org/communiquons/android/comunic/client/data/{ImageLoad => utils}/ImageLoadUtils.java (81%) rename app/src/main/java/org/communiquons/android/comunic/client/{data => ui}/utils/BitmapUtils.java (98%) rename app/src/main/java/org/communiquons/android/comunic/client/{data => ui}/utils/UiUtils.java (96%) diff --git a/app/src/main/java/org/communiquons/android/comunic/client/api/APIRequest.java b/app/src/main/java/org/communiquons/android/comunic/client/api/APIRequest.java index 14af62c..fea727e 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/api/APIRequest.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/api/APIRequest.java @@ -5,7 +5,7 @@ import android.net.ConnectivityManager; import android.net.NetworkInfo; import org.communiquons.android.comunic.client.BuildConfig; -import org.communiquons.android.comunic.client.data.Account.Account; +import org.communiquons.android.comunic.client.data.helpers.AccountHelper; import java.io.BufferedOutputStream; import java.io.BufferedReader; @@ -132,14 +132,14 @@ public class APIRequest { private void addLoginTokens(APIRequestParameters params){ //Create account object - Account account = new Account(params.getContext()); + AccountHelper accountHelper = new AccountHelper(params.getContext()); //Check if user is signed in or not - if(!account.signed_in()) + if(!accountHelper.signed_in()) return; //Do nothing //Get login tokens - ArrayList tokens = account.getLoginTokens(); + ArrayList tokens = accountHelper.getLoginTokens(); if(tokens.size() < 2) return; //Not enough tokens diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/DatabaseContract.java b/app/src/main/java/org/communiquons/android/comunic/client/data/DatabaseContract.java index 5ef197f..37deb5f 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/DatabaseContract.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/DatabaseContract.java @@ -15,8 +15,8 @@ public final class DatabaseContract { public DatabaseContract(){} /* Database basic information */ - static final int DATABASE_VERSION = 4; - static final String DATABASE_NAME = "database.db"; + public static final int DATABASE_VERSION = 4; + public static final String DATABASE_NAME = "database.db"; /* Users info table */ public static abstract class UsersInfoSchema implements BaseColumns { diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotifsList.java b/app/src/main/java/org/communiquons/android/comunic/client/data/arrays/NotifsList.java similarity index 88% rename from app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotifsList.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/arrays/NotifsList.java index 3c76839..2a78ef4 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotifsList.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/arrays/NotifsList.java @@ -1,9 +1,11 @@ -package org.communiquons.android.comunic.client.data.notifications; +package org.communiquons.android.comunic.client.data.arrays; import android.support.annotation.Nullable; import android.util.ArrayMap; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.data.enums.NotifElemType; +import org.communiquons.android.comunic.client.data.models.Notif; import java.util.ArrayList; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostsList.java b/app/src/main/java/org/communiquons/android/comunic/client/data/arrays/PostsList.java similarity index 84% rename from app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostsList.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/arrays/PostsList.java index 380e4a3..b8966b2 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostsList.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/arrays/PostsList.java @@ -1,6 +1,7 @@ -package org.communiquons.android.comunic.client.data.posts; +package org.communiquons.android.comunic.client.data.arrays; -import org.communiquons.android.comunic.client.data.comments.Comment; +import org.communiquons.android.comunic.client.data.models.Comment; +import org.communiquons.android.comunic.client.data.models.Post; import java.util.ArrayList; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/api/APIRequestTask.java b/app/src/main/java/org/communiquons/android/comunic/client/data/asynctasks/APIRequestTask.java similarity index 67% rename from app/src/main/java/org/communiquons/android/comunic/client/api/APIRequestTask.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/asynctasks/APIRequestTask.java index ff50ae9..524c569 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/api/APIRequestTask.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/asynctasks/APIRequestTask.java @@ -1,24 +1,10 @@ -package org.communiquons.android.comunic.client.api; +package org.communiquons.android.comunic.client.data.asynctasks; -import android.content.Context; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; import android.os.AsyncTask; -import org.communiquons.android.comunic.client.data.Account.Account; -import org.communiquons.android.comunic.client.BuildConfig; - -import java.io.BufferedOutputStream; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Reader; -import java.net.HttpURLConnection; -import java.net.URL; -import java.util.ArrayList; +import org.communiquons.android.comunic.client.api.APIRequest; +import org.communiquons.android.comunic.client.api.APIRequestParameters; +import org.communiquons.android.comunic.client.api.APIResponse; /** * Perform an API request on the server diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/GetUsersInfos.java b/app/src/main/java/org/communiquons/android/comunic/client/data/asynctasks/GetUsersInfos.java similarity index 88% rename from app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/GetUsersInfos.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/asynctasks/GetUsersInfos.java index d1b8986..07f9ca9 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/GetUsersInfos.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/asynctasks/GetUsersInfos.java @@ -1,15 +1,12 @@ -package org.communiquons.android.comunic.client.data.UsersInfo; +package org.communiquons.android.comunic.client.data.asynctasks; import android.content.Context; import android.os.AsyncTask; import android.util.ArrayMap; -import org.communiquons.android.comunic.client.api.APIRequestParameters; -import org.communiquons.android.comunic.client.api.APIRequestTask; -import org.communiquons.android.comunic.client.api.APIResponse; -import org.communiquons.android.comunic.client.data.DatabaseHelper; -import org.json.JSONException; -import org.json.JSONObject; +import org.communiquons.android.comunic.client.data.helpers.DatabaseHelper; +import org.communiquons.android.comunic.client.data.helpers.GetUsersHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; import java.util.ArrayList; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadTask.java b/app/src/main/java/org/communiquons/android/comunic/client/data/asynctasks/ImageLoadTask.java similarity index 96% rename from app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadTask.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/asynctasks/ImageLoadTask.java index b7b42f6..940ac42 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadTask.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/asynctasks/ImageLoadTask.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.ImageLoad; +package org.communiquons.android.comunic.client.data.asynctasks; import android.content.Context; import android.graphics.Bitmap; @@ -7,6 +7,7 @@ import android.os.AsyncTask; import android.util.Log; import android.widget.ImageView; +import org.communiquons.android.comunic.client.data.utils.ImageLoadUtils; import org.communiquons.android.comunic.client.data.utils.Utilities; import java.io.File; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/likes/LikesType.java b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/LikesType.java similarity index 78% rename from app/src/main/java/org/communiquons/android/comunic/client/data/likes/LikesType.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/enums/LikesType.java index 055eadf..9f1d17b 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/likes/LikesType.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/LikesType.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.likes; +package org.communiquons.android.comunic.client.data.enums; /** * Likes types diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotifElemType.java b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/NotifElemType.java similarity index 88% rename from app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotifElemType.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/enums/NotifElemType.java index c4c192f..b986389 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotifElemType.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/NotifElemType.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.notifications; +package org.communiquons.android.comunic.client.data.enums; /** * Notifications elements type diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotificationTypes.java b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/NotificationTypes.java similarity index 90% rename from app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotificationTypes.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/enums/NotificationTypes.java index aa4470f..b0715e8 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotificationTypes.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/NotificationTypes.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.notifications; +package org.communiquons.android.comunic.client.data.enums; /** * Enum of the notifications types diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotificationVisibility.java b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/NotificationVisibility.java similarity index 77% rename from app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotificationVisibility.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/enums/NotificationVisibility.java index d75421e..66fae2e 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotificationVisibility.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/NotificationVisibility.java @@ -1,7 +1,7 @@ -package org.communiquons.android.comunic.client.data.notifications; +package org.communiquons.android.comunic.client.data.enums; /** - * Notifications visibility enum + * Notifications visibility enums * * @author Pierre HUBERT * Created by pierre on 4/9/18. diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/PageType.java b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/PageType.java similarity index 72% rename from app/src/main/java/org/communiquons/android/comunic/client/data/posts/PageType.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/enums/PageType.java index cd5bebd..dde69a0 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/PageType.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/PageType.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.posts; +package org.communiquons.android.comunic.client.data.enums; /** * Page types diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostTypes.java b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/PostTypes.java similarity index 77% rename from app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostTypes.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/enums/PostTypes.java index 520d425..e8c5c31 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostTypes.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/PostTypes.java @@ -1,7 +1,7 @@ -package org.communiquons.android.comunic.client.data.posts; +package org.communiquons.android.comunic.client.data.enums; /** - * Posts types enum + * Posts types enums * * @author Pierre HUBERT * Created by pierre on 1/28/18. diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostUserAccess.java b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/PostUserAccess.java similarity index 84% rename from app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostUserAccess.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/enums/PostUserAccess.java index 8c2c999..9146dfd 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostUserAccess.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/PostUserAccess.java @@ -1,7 +1,7 @@ -package org.communiquons.android.comunic.client.data.posts; +package org.communiquons.android.comunic.client.data.enums; /** - * Post users access enum + * Post users access enums * * @author Pierre HUBERT * Created by pierre on 3/25/18. diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostVisibilityLevels.java b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/PostVisibilityLevels.java similarity index 82% rename from app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostVisibilityLevels.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/enums/PostVisibilityLevels.java index 9ff3411..2412955 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostVisibilityLevels.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/PostVisibilityLevels.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.posts; +package org.communiquons.android.comunic.client.data.enums; /** * Post visibility levels diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/Account/Account.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/AccountHelper.java similarity index 96% rename from app/src/main/java/org/communiquons/android/comunic/client/data/Account/Account.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/AccountHelper.java index 59f9156..4b2167b 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/Account/Account.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/AccountHelper.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.Account; +package org.communiquons.android.comunic.client.data.helpers; import android.content.Context; import android.util.Log; @@ -19,7 +19,7 @@ import java.util.Objects; * Created by pierre on 10/29/17. */ -public class Account { +public class AccountHelper { /** * Utilities object @@ -46,7 +46,7 @@ public class Account { * * @param context Context of the application */ - public Account(Context context){ + public AccountHelper(Context context){ mContext = context; utils = new Utilities(context); diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/comments/CommentsHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/CommentsHelper.java similarity index 97% rename from app/src/main/java/org/communiquons/android/comunic/client/data/comments/CommentsHelper.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/CommentsHelper.java index 6254b37..36c0486 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/comments/CommentsHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/CommentsHelper.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.comments; +package org.communiquons.android.comunic.client.data.helpers; import android.content.Context; import android.support.annotation.NonNull; @@ -7,6 +7,7 @@ import android.support.annotation.Nullable; import org.communiquons.android.comunic.client.api.APIRequest; import org.communiquons.android.comunic.client.api.APIRequestParameters; import org.communiquons.android.comunic.client.api.APIResponse; +import org.communiquons.android.comunic.client.data.models.Comment; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationMessagesDbHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ConversationMessagesDbHelper.java similarity index 97% rename from app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationMessagesDbHelper.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ConversationMessagesDbHelper.java index a8be7cc..88f3be0 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationMessagesDbHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ConversationMessagesDbHelper.java @@ -1,14 +1,13 @@ -package org.communiquons.android.comunic.client.data.conversations; +package org.communiquons.android.comunic.client.data.helpers; import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.util.Log; -import org.communiquons.android.comunic.client.data.DatabaseHelper; import org.communiquons.android.comunic.client.data.DatabaseContract.ConversationsMessagesSchema; +import org.communiquons.android.comunic.client.data.models.ConversationMessage; import java.util.ArrayList; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationMessagesHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ConversationMessagesHelper.java similarity index 94% rename from app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationMessagesHelper.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ConversationMessagesHelper.java index eae7116..26d8e11 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationMessagesHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ConversationMessagesHelper.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.conversations; +package org.communiquons.android.comunic.client.data.helpers; import android.content.Context; import android.support.annotation.Nullable; @@ -7,7 +7,7 @@ import android.util.Log; import org.communiquons.android.comunic.client.api.APIRequest; import org.communiquons.android.comunic.client.api.APIRequestParameters; import org.communiquons.android.comunic.client.api.APIResponse; -import org.communiquons.android.comunic.client.data.DatabaseHelper; +import org.communiquons.android.comunic.client.data.models.ConversationMessage; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -55,7 +55,7 @@ public class ConversationMessagesHelper { * @param conversation_id The ID of the conversation to refresh * @return TRUE in case of success / FALSE else */ - boolean refresh_conversation(int conversation_id){ + public boolean refresh_conversation(int conversation_id){ //Get the ID of the last message available in the database int last_message_id = getLastIDFromDb(conversation_id); @@ -116,7 +116,7 @@ public class ConversationMessagesHelper { * @return The message of the interval, or null in case of failure */ @Nullable - ArrayList getInDb(int conv, int start, int end){ + public ArrayList getInDb(int conv, int start, int end){ return mDbHelper.getInterval(conv, start, end); @@ -128,7 +128,7 @@ public class ConversationMessagesHelper { * @param conversation_id Target conversation * @return The ID of the last message available in the database or 0 in case of failure */ - int getLastIDFromDb(int conversation_id){ + public int getLastIDFromDb(int conversation_id){ //Get the id of the last message available in the database ConversationMessage last_message = mDbHelper.getLast(conversation_id); diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationsListDbHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ConversationsListDbHelper.java similarity index 97% rename from app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationsListDbHelper.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ConversationsListDbHelper.java index 22bb0ed..87a5566 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationsListDbHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ConversationsListDbHelper.java @@ -1,14 +1,13 @@ -package org.communiquons.android.comunic.client.data.conversations; +package org.communiquons.android.comunic.client.data.helpers; import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.util.Log; import org.communiquons.android.comunic.client.data.DatabaseContract.ConversationsListSchema; -import org.communiquons.android.comunic.client.data.DatabaseHelper; +import org.communiquons.android.comunic.client.data.models.ConversationsInfo; import java.util.ArrayList; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationsListHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ConversationsListHelper.java similarity index 97% rename from app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationsListHelper.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ConversationsListHelper.java index 1725be6..0244854 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationsListHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ConversationsListHelper.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.conversations; +package org.communiquons.android.comunic.client.data.helpers; import android.content.Context; import android.support.annotation.NonNull; @@ -9,10 +9,9 @@ import android.util.Log; import org.communiquons.android.comunic.client.api.APIRequest; import org.communiquons.android.comunic.client.api.APIRequestParameters; import org.communiquons.android.comunic.client.api.APIResponse; -import org.communiquons.android.comunic.client.data.Account.AccountUtils; -import org.communiquons.android.comunic.client.data.DatabaseHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.GetUsersHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; +import org.communiquons.android.comunic.client.data.utils.AccountUtils; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.data.models.ConversationsInfo; import org.communiquons.android.comunic.client.data.utils.ArrayUtils; import org.json.JSONArray; import org.json.JSONException; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/DatabaseHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/DatabaseHelper.java similarity index 98% rename from app/src/main/java/org/communiquons/android/comunic/client/data/DatabaseHelper.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/DatabaseHelper.java index e608219..c29988a 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/DatabaseHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/DatabaseHelper.java @@ -1,9 +1,10 @@ -package org.communiquons.android.comunic.client.data; +package org.communiquons.android.comunic.client.data.helpers; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; +import org.communiquons.android.comunic.client.data.DatabaseContract; import org.communiquons.android.comunic.client.data.DatabaseContract.FriendsListSchema; import org.communiquons.android.comunic.client.data.DatabaseContract.UsersInfoSchema; import org.communiquons.android.comunic.client.data.DatabaseContract.ConversationsListSchema; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendsListDbHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/FriendsListDbHelper.java similarity index 98% rename from app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendsListDbHelper.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/FriendsListDbHelper.java index 09337e6..0fc5066 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendsListDbHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/FriendsListDbHelper.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.friendsList; +package org.communiquons.android.comunic.client.data.helpers; import android.content.ContentValues; import android.database.Cursor; @@ -6,8 +6,8 @@ import android.database.sqlite.SQLiteDatabase; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import org.communiquons.android.comunic.client.data.DatabaseHelper; import org.communiquons.android.comunic.client.data.DatabaseContract.FriendsListSchema; +import org.communiquons.android.comunic.client.data.models.Friend; import java.util.ArrayList; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendsListHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/FriendsListHelper.java similarity index 96% rename from app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendsListHelper.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/FriendsListHelper.java index 7a9c28e..1759af2 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendsListHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/FriendsListHelper.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.friendsList; +package org.communiquons.android.comunic.client.data.helpers; import android.content.Context; import android.support.annotation.Nullable; @@ -7,7 +7,7 @@ import android.util.Log; import org.communiquons.android.comunic.client.api.APIRequest; import org.communiquons.android.comunic.client.api.APIRequestParameters; import org.communiquons.android.comunic.client.api.APIResponse; -import org.communiquons.android.comunic.client.data.DatabaseHelper; +import org.communiquons.android.comunic.client.data.models.Friend; import org.json.JSONArray; import org.json.JSONObject; @@ -66,7 +66,7 @@ public class FriendsListHelper { * @return The list of friend of the user */ @Nullable - ArrayList download(){ + public ArrayList download(){ //Prepare the API request APIRequestParameters params = new APIRequestParameters(mContext, "friends/getList"); diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/GetUsersHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/GetUsersHelper.java similarity index 98% rename from app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/GetUsersHelper.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/GetUsersHelper.java index a320a2b..2b85e28 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/GetUsersHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/GetUsersHelper.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.UsersInfo; +package org.communiquons.android.comunic.client.data.helpers; import android.content.Context; import android.support.annotation.NonNull; @@ -9,7 +9,8 @@ import android.util.Log; import org.communiquons.android.comunic.client.api.APIRequest; import org.communiquons.android.comunic.client.api.APIRequestParameters; import org.communiquons.android.comunic.client.api.APIResponse; -import org.communiquons.android.comunic.client.data.DatabaseHelper; +import org.communiquons.android.comunic.client.data.models.AdvancedUserInfo; +import org.communiquons.android.comunic.client.data.models.UserInfo; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadManager.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ImageLoadHelper.java similarity index 92% rename from app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadManager.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ImageLoadHelper.java index e1e0602..daf96b7 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadManager.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ImageLoadHelper.java @@ -1,18 +1,20 @@ -package org.communiquons.android.comunic.client.data.ImageLoad; +package org.communiquons.android.comunic.client.data.helpers; import android.content.Context; import android.util.ArrayMap; import android.view.View; import android.widget.ImageView; +import org.communiquons.android.comunic.client.data.runnables.ImageLoadRunnable; + /** - * Image load manager + * Image load manager / helper * * @author Pierre HUBERT * Created by pierre on 11/18/17. */ -public class ImageLoadManager { +public class ImageLoadHelper { /** * The list of running operations diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/likes/LikesHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/LikesHelper.java similarity index 93% rename from app/src/main/java/org/communiquons/android/comunic/client/data/likes/LikesHelper.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/LikesHelper.java index fcb9e5d..692c6c8 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/likes/LikesHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/LikesHelper.java @@ -1,10 +1,11 @@ -package org.communiquons.android.comunic.client.data.likes; +package org.communiquons.android.comunic.client.data.helpers; import android.content.Context; import org.communiquons.android.comunic.client.api.APIRequest; import org.communiquons.android.comunic.client.api.APIRequestParameters; import org.communiquons.android.comunic.client.api.APIResponse; +import org.communiquons.android.comunic.client.data.enums.LikesType; /** * Likes Helper diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotificationsHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/NotificationsHelper.java similarity index 93% rename from app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotificationsHelper.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/NotificationsHelper.java index 2daeee7..94b9fe6 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotificationsHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/NotificationsHelper.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.notifications; +package org.communiquons.android.comunic.client.data.helpers; import android.content.Context; import android.support.annotation.Nullable; @@ -6,6 +6,12 @@ import android.support.annotation.Nullable; import org.communiquons.android.comunic.client.api.APIRequest; import org.communiquons.android.comunic.client.api.APIRequestParameters; import org.communiquons.android.comunic.client.api.APIResponse; +import org.communiquons.android.comunic.client.data.models.Notif; +import org.communiquons.android.comunic.client.data.enums.NotifElemType; +import org.communiquons.android.comunic.client.data.enums.NotificationTypes; +import org.communiquons.android.comunic.client.data.enums.NotificationVisibility; +import org.communiquons.android.comunic.client.data.models.NotificationsCount; +import org.communiquons.android.comunic.client.data.arrays.NotifsList; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostsHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/PostsHelper.java similarity index 94% rename from app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostsHelper.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/PostsHelper.java index cb4fd31..0f48580 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/PostsHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/PostsHelper.java @@ -1,13 +1,18 @@ -package org.communiquons.android.comunic.client.data.posts; +package org.communiquons.android.comunic.client.data.helpers; import android.content.Context; import android.support.annotation.Nullable; -import android.util.Log; import org.communiquons.android.comunic.client.api.APIRequest; import org.communiquons.android.comunic.client.api.APIRequestParameters; import org.communiquons.android.comunic.client.api.APIResponse; -import org.communiquons.android.comunic.client.data.comments.CommentsHelper; +import org.communiquons.android.comunic.client.data.models.CreatePost; +import org.communiquons.android.comunic.client.data.enums.PageType; +import org.communiquons.android.comunic.client.data.models.Post; +import org.communiquons.android.comunic.client.data.enums.PostTypes; +import org.communiquons.android.comunic.client.data.enums.PostUserAccess; +import org.communiquons.android.comunic.client.data.enums.PostVisibilityLevels; +import org.communiquons.android.comunic.client.data.arrays.PostsList; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/UsersInfosDbHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/UsersInfosDbHelper.java similarity index 98% rename from app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/UsersInfosDbHelper.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/helpers/UsersInfosDbHelper.java index eba8ac3..cb3a2ea 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/UsersInfosDbHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/UsersInfosDbHelper.java @@ -1,11 +1,11 @@ -package org.communiquons.android.comunic.client.data.UsersInfo; +package org.communiquons.android.comunic.client.data.helpers; import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import org.communiquons.android.comunic.client.data.DatabaseContract.UsersInfoSchema; -import org.communiquons.android.comunic.client.data.DatabaseHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; /** * Users information helpers diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/AdvancedUserInfo.java b/app/src/main/java/org/communiquons/android/comunic/client/data/models/AdvancedUserInfo.java similarity index 91% rename from app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/AdvancedUserInfo.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/models/AdvancedUserInfo.java index 62c2cb9..1a9de91 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/AdvancedUserInfo.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/models/AdvancedUserInfo.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.UsersInfo; +package org.communiquons.android.comunic.client.data.models; /** * Advanced informations about a single user diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/comments/Comment.java b/app/src/main/java/org/communiquons/android/comunic/client/data/models/Comment.java similarity index 97% rename from app/src/main/java/org/communiquons/android/comunic/client/data/comments/Comment.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/models/Comment.java index 969aced..cf79e26 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/comments/Comment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/models/Comment.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.comments; +package org.communiquons.android.comunic.client.data.models; import android.support.annotation.Nullable; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationMessage.java b/app/src/main/java/org/communiquons/android/comunic/client/data/models/ConversationMessage.java similarity index 94% rename from app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationMessage.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/models/ConversationMessage.java index c4a4253..225b2ca 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationMessage.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/models/ConversationMessage.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.conversations; +package org.communiquons.android.comunic.client.data.models; import android.support.annotation.NonNull; import android.support.annotation.Nullable; @@ -47,7 +47,7 @@ public class ConversationMessage { * * @param conversation_id The ID of the conversation */ - void setConversation_id(int conversation_id) { + public void setConversation_id(int conversation_id) { this.conversation_id = conversation_id; } @@ -65,7 +65,7 @@ public class ConversationMessage { * * @param user_id The ID of the user */ - void setUser_id(int user_id) { + public void setUser_id(int user_id) { this.user_id = user_id; } @@ -145,7 +145,7 @@ public class ConversationMessage { * * @param time_insert The time of insertion of the message */ - void setTime_insert(int time_insert) { + public void setTime_insert(int time_insert) { this.time_insert = time_insert; } diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationsInfo.java b/app/src/main/java/org/communiquons/android/comunic/client/data/models/ConversationsInfo.java similarity index 94% rename from app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationsInfo.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/models/ConversationsInfo.java index d32bc00..c299733 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationsInfo.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/models/ConversationsInfo.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.conversations; +package org.communiquons.android.comunic.client.data.models; import android.support.annotation.Nullable; import android.util.Log; @@ -38,7 +38,7 @@ public class ConversationsInfo { * * @param ID The ID of the conversation */ - void setID(int ID) { + public void setID(int ID) { this.ID = ID; } @@ -56,7 +56,7 @@ public class ConversationsInfo { * * @param ID_owner The ID of the owner of the conversation */ - void setID_owner(int ID_owner) { + public void setID_owner(int ID_owner) { this.ID_owner = ID_owner; } @@ -74,7 +74,7 @@ public class ConversationsInfo { * * @param last_active The timestamp of the last activity of the conversation */ - void setLast_active(int last_active) { + public void setLast_active(int last_active) { this.last_active = last_active; } @@ -126,7 +126,7 @@ public class ConversationsInfo { * * @param following True if the user is following the conversation */ - void setFollowing(boolean following) { + public void setFollowing(boolean following) { this.following = following; } @@ -144,7 +144,7 @@ public class ConversationsInfo { * * @param saw_last_message True if the user has seen the last message of the conversation */ - void setSaw_last_message(boolean saw_last_message) { + public void setSaw_last_message(boolean saw_last_message) { this.saw_last_message = saw_last_message; } @@ -171,7 +171,7 @@ public class ConversationsInfo { * * @param id The ID of the member to add */ - void addMember(Integer id){ + public void addMember(Integer id){ if(members == null) members = new ArrayList<>(); diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/CreatePost.java b/app/src/main/java/org/communiquons/android/comunic/client/data/models/CreatePost.java similarity index 78% rename from app/src/main/java/org/communiquons/android/comunic/client/data/posts/CreatePost.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/models/CreatePost.java index 929b37b..305ab1e 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/CreatePost.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/models/CreatePost.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.posts; +package org.communiquons.android.comunic.client.data.models; /** * This object extends the Post object in order to include all the required informations to diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/Friend.java b/app/src/main/java/org/communiquons/android/comunic/client/data/models/Friend.java similarity index 97% rename from app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/Friend.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/models/Friend.java index 24c7f47..f38b1dd 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/Friend.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/models/Friend.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.friendsList; +package org.communiquons.android.comunic.client.data.models; import org.communiquons.android.comunic.client.data.utils.Utilities; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendUser.java b/app/src/main/java/org/communiquons/android/comunic/client/data/models/FriendUser.java similarity index 91% rename from app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendUser.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/models/FriendUser.java index 1813961..ce9a24c 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendUser.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/models/FriendUser.java @@ -1,6 +1,4 @@ -package org.communiquons.android.comunic.client.data.friendsList; - -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; +package org.communiquons.android.comunic.client.data.models; /** * This class contains information about a friend but also about user himself diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/Notif.java b/app/src/main/java/org/communiquons/android/comunic/client/data/models/Notif.java similarity index 90% rename from app/src/main/java/org/communiquons/android/comunic/client/data/notifications/Notif.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/models/Notif.java index 09951fc..c93265f 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/Notif.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/models/Notif.java @@ -1,4 +1,8 @@ -package org.communiquons.android.comunic.client.data.notifications; +package org.communiquons.android.comunic.client.data.models; + +import org.communiquons.android.comunic.client.data.enums.NotifElemType; +import org.communiquons.android.comunic.client.data.enums.NotificationTypes; +import org.communiquons.android.comunic.client.data.enums.NotificationVisibility; /** * Notification object diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotificationsCount.java b/app/src/main/java/org/communiquons/android/comunic/client/data/models/NotificationsCount.java similarity index 91% rename from app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotificationsCount.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/models/NotificationsCount.java index 8a45bec..39509b4 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/notifications/NotificationsCount.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/models/NotificationsCount.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.notifications; +package org.communiquons.android.comunic.client.data.models; /** * Notifications count service diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/Post.java b/app/src/main/java/org/communiquons/android/comunic/client/data/models/Post.java similarity index 86% rename from app/src/main/java/org/communiquons/android/comunic/client/data/posts/Post.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/models/Post.java index 02673af..1c93153 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/posts/Post.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/models/Post.java @@ -1,8 +1,11 @@ -package org.communiquons.android.comunic.client.data.posts; +package org.communiquons.android.comunic.client.data.models; import android.support.annotation.Nullable; -import org.communiquons.android.comunic.client.data.comments.Comment; +import org.communiquons.android.comunic.client.data.enums.PageType; +import org.communiquons.android.comunic.client.data.enums.PostTypes; +import org.communiquons.android.comunic.client.data.enums.PostUserAccess; +import org.communiquons.android.comunic.client.data.enums.PostVisibilityLevels; import java.util.ArrayList; @@ -62,7 +65,7 @@ public class Post { //Set and get the post creation time - void setPost_time(int post_time) { + public void setPost_time(int post_time) { this.post_time = post_time; } @@ -119,7 +122,7 @@ public class Post { } //Set and get comments list - void setComments_list(ArrayList comments_list) { + public void setComments_list(ArrayList comments_list) { this.comments_list = comments_list; } @@ -129,7 +132,7 @@ public class Post { } //Set and post user access level - void setUser_access_level(PostUserAccess user_access_level) { + public void setUser_access_level(PostUserAccess user_access_level) { this.user_access_level = user_access_level; } @@ -177,7 +180,7 @@ public class Post { } //Set and get file path url - void setFile_path_url(String file_path_url) { + public void setFile_path_url(String file_path_url) { this.file_path_url = file_path_url; } diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/UserInfo.java b/app/src/main/java/org/communiquons/android/comunic/client/data/models/UserInfo.java similarity index 97% rename from app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/UserInfo.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/models/UserInfo.java index 04cb4e0..8cc32d2 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/UsersInfo/UserInfo.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/models/UserInfo.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.UsersInfo; +package org.communiquons.android.comunic.client.data.models; import org.communiquons.android.comunic.client.data.utils.Utilities; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationRefreshRunnable.java b/app/src/main/java/org/communiquons/android/comunic/client/data/runnables/ConversationRefreshRunnable.java similarity index 96% rename from app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationRefreshRunnable.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/runnables/ConversationRefreshRunnable.java index 40c5a28..1acae36 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationRefreshRunnable.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/runnables/ConversationRefreshRunnable.java @@ -1,9 +1,12 @@ -package org.communiquons.android.comunic.client.data.conversations; +package org.communiquons.android.comunic.client.data.runnables; import android.app.Activity; import android.support.annotation.NonNull; import android.util.Log; +import org.communiquons.android.comunic.client.data.helpers.ConversationMessagesHelper; +import org.communiquons.android.comunic.client.data.models.ConversationMessage; + import java.util.ArrayList; /** diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendRefreshLoopRunnable.java b/app/src/main/java/org/communiquons/android/comunic/client/data/runnables/FriendRefreshLoopRunnable.java similarity index 90% rename from app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendRefreshLoopRunnable.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/runnables/FriendRefreshLoopRunnable.java index 1d58f48..ccfe122 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendRefreshLoopRunnable.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/runnables/FriendRefreshLoopRunnable.java @@ -1,9 +1,9 @@ -package org.communiquons.android.comunic.client.data.friendsList; +package org.communiquons.android.comunic.client.data.runnables; import android.content.Context; -import org.communiquons.android.comunic.client.data.DatabaseHelper; +import org.communiquons.android.comunic.client.data.helpers.DatabaseHelper; /** * Automatically refresh friends list thread diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendsListRefreshRunnable.java b/app/src/main/java/org/communiquons/android/comunic/client/data/runnables/FriendsListRefreshRunnable.java similarity index 77% rename from app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendsListRefreshRunnable.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/runnables/FriendsListRefreshRunnable.java index a78ff54..a5ad9aa 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendsListRefreshRunnable.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/runnables/FriendsListRefreshRunnable.java @@ -1,8 +1,11 @@ -package org.communiquons.android.comunic.client.data.friendsList; +package org.communiquons.android.comunic.client.data.runnables; import android.content.Context; -import org.communiquons.android.comunic.client.data.DatabaseHelper; +import org.communiquons.android.comunic.client.data.helpers.DatabaseHelper; +import org.communiquons.android.comunic.client.data.helpers.FriendsListDbHelper; +import org.communiquons.android.comunic.client.data.helpers.FriendsListHelper; +import org.communiquons.android.comunic.client.data.models.Friend; import java.util.ArrayList; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageDownloadRunnable.java b/app/src/main/java/org/communiquons/android/comunic/client/data/runnables/ImageDownloadRunnable.java similarity index 94% rename from app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageDownloadRunnable.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/runnables/ImageDownloadRunnable.java index 8a7ca2a..37b8075 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageDownloadRunnable.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/runnables/ImageDownloadRunnable.java @@ -1,9 +1,9 @@ -package org.communiquons.android.comunic.client.data.ImageLoad; +package org.communiquons.android.comunic.client.data.runnables; import android.graphics.Bitmap; import android.util.Log; -import org.communiquons.android.comunic.client.data.utils.BitmapUtils; +import org.communiquons.android.comunic.client.ui.utils.BitmapUtils; import org.communiquons.android.comunic.client.data.utils.Utilities; import java.io.File; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadApplyRunnable.java b/app/src/main/java/org/communiquons/android/comunic/client/data/runnables/ImageLoadApplyRunnable.java similarity index 93% rename from app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadApplyRunnable.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/runnables/ImageLoadApplyRunnable.java index 3c8714b..109d87e 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadApplyRunnable.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/runnables/ImageLoadApplyRunnable.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.ImageLoad; +package org.communiquons.android.comunic.client.data.runnables; import android.graphics.Bitmap; import android.support.annotation.UiThread; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadRunnable.java b/app/src/main/java/org/communiquons/android/comunic/client/data/runnables/ImageLoadRunnable.java similarity index 94% rename from app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadRunnable.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/runnables/ImageLoadRunnable.java index 023a2eb..9540bfd 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadRunnable.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/runnables/ImageLoadRunnable.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.ImageLoad; +package org.communiquons.android.comunic.client.data.runnables; import android.content.Context; import android.graphics.Bitmap; @@ -7,6 +7,8 @@ import android.util.ArrayMap; import android.util.Log; import android.widget.ImageView; +import org.communiquons.android.comunic.client.data.utils.ImageLoadUtils; + import java.io.File; import java.io.FileInputStream; @@ -20,7 +22,7 @@ import java.io.FileInputStream; * Created by pierre on 11/18/17. */ -class ImageLoadRunnable implements Runnable { +public class ImageLoadRunnable implements Runnable { /** * Debug tag @@ -59,7 +61,7 @@ class ImageLoadRunnable implements Runnable { * @param imageView The imageView of the image * @param url The URL of the image */ - ImageLoadRunnable(Context context, ImageView imageView, String url){ + public ImageLoadRunnable(Context context, ImageView imageView, String url){ //Check if the list of pending operations has to be initialized or not if(pendingOperation == null) diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/services/NotificationsService.java b/app/src/main/java/org/communiquons/android/comunic/client/data/services/NotificationsService.java index 8375cc4..42de071 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/services/NotificationsService.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/services/NotificationsService.java @@ -10,9 +10,9 @@ import android.support.annotation.Nullable; import android.util.Log; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.Account.Account; -import org.communiquons.android.comunic.client.data.notifications.NotificationsCount; -import org.communiquons.android.comunic.client.data.notifications.NotificationsHelper; +import org.communiquons.android.comunic.client.data.helpers.AccountHelper; +import org.communiquons.android.comunic.client.data.models.NotificationsCount; +import org.communiquons.android.comunic.client.data.helpers.NotificationsHelper; import org.communiquons.android.comunic.client.data.utils.PreferencesUtils; import org.communiquons.android.comunic.client.ui.activities.MainActivity; @@ -80,7 +80,7 @@ public class NotificationsService extends IntentService { } //Check if the user is signed in or not - if(!new Account(this).signed_in()){ + if(!new AccountHelper(this).signed_in()){ Log.v(TAG, "Skip notifications refresh because the user is not signed in."); removeNotification(); continue; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/Account/AccountUtils.java b/app/src/main/java/org/communiquons/android/comunic/client/data/utils/AccountUtils.java similarity index 94% rename from app/src/main/java/org/communiquons/android/comunic/client/data/Account/AccountUtils.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/utils/AccountUtils.java index 2607b75..8300fe7 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/Account/AccountUtils.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/utils/AccountUtils.java @@ -1,11 +1,10 @@ -package org.communiquons.android.comunic.client.data.Account; +package org.communiquons.android.comunic.client.data.utils; import android.content.Context; import org.communiquons.android.comunic.client.api.APIRequestParameters; -import org.communiquons.android.comunic.client.api.APIRequestTask; +import org.communiquons.android.comunic.client.data.asynctasks.APIRequestTask; import org.communiquons.android.comunic.client.api.APIResponse; -import org.communiquons.android.comunic.client.data.utils.Utilities; import org.json.JSONObject; /** diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendsUtils.java b/app/src/main/java/org/communiquons/android/comunic/client/data/utils/FriendsUtils.java similarity index 78% rename from app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendsUtils.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/utils/FriendsUtils.java index 09b74ff..6a825b0 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/friendsList/FriendsUtils.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/utils/FriendsUtils.java @@ -1,8 +1,10 @@ -package org.communiquons.android.comunic.client.data.friendsList; +package org.communiquons.android.comunic.client.data.utils; import android.util.ArrayMap; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.data.models.Friend; +import org.communiquons.android.comunic.client.data.models.FriendUser; import java.util.ArrayList; @@ -38,7 +40,7 @@ public class FriendsUtils { * @return The result of the operation */ public static ArrayList merge_friends_user_infos_list(ArrayList friendsList, - ArrayMap userInfos){ + ArrayMap userInfos){ ArrayList list = new ArrayList<>(); diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadUtils.java b/app/src/main/java/org/communiquons/android/comunic/client/data/utils/ImageLoadUtils.java similarity index 81% rename from app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadUtils.java rename to app/src/main/java/org/communiquons/android/comunic/client/data/utils/ImageLoadUtils.java index 40227a3..ef185f0 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/ImageLoad/ImageLoadUtils.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/utils/ImageLoadUtils.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.ImageLoad; +package org.communiquons.android.comunic.client.data.utils; import android.content.Context; import android.util.Log; @@ -14,7 +14,7 @@ import java.io.File; * Created by pierre on 11/18/17. */ -class ImageLoadUtils { +public class ImageLoadUtils { /** * Debug tag @@ -24,7 +24,7 @@ class ImageLoadUtils { /** * The main folder in the cache directory that stores the file */ - static final String IMAGE_CACHE_DIRECTORY = "img_cache/"; + public static final String IMAGE_CACHE_DIRECTORY = "img_cache/"; /** * Get the file name, based on the URL name @@ -32,7 +32,7 @@ class ImageLoadUtils { * @param url The URL of the file * @return The name of the file, composed of characters that can be used in filename */ - static String get_file_name(String url){ + public static String get_file_name(String url){ return Utilities.sha1(url); } @@ -42,7 +42,7 @@ class ImageLoadUtils { * @param context Context of execution * @return True in case of success */ - static boolean create_parent_directory(Context context){ + public static boolean create_parent_directory(Context context){ File parent = new File(context.getCacheDir(), IMAGE_CACHE_DIRECTORY); //Check if parent directory already exists diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/LoginActivity.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/LoginActivity.java index c8bd3d7..1d3d728 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/LoginActivity.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/LoginActivity.java @@ -11,8 +11,9 @@ import android.widget.TextView; import android.widget.Toast; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.Account.Account; -import org.communiquons.android.comunic.client.data.Account.AccountUtils; +import org.communiquons.android.comunic.client.data.asynctasks.APIRequestTask; +import org.communiquons.android.comunic.client.data.helpers.AccountHelper; +import org.communiquons.android.comunic.client.data.utils.AccountUtils; import org.communiquons.android.comunic.client.data.utils.Utilities; import org.json.JSONException; import org.json.JSONObject; @@ -161,8 +162,8 @@ public class LoginActivity extends AppCompatActivity { tokens.add(tokensObj.getString("token2")); //Save tokens - Account account = new Account(this); - if(!account.save_new_tokens(tokens)) { + AccountHelper accountHelper = new AccountHelper(this); + if(!accountHelper.save_new_tokens(tokens)) { show_err_server_response(); return; } diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/MainActivity.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/MainActivity.java index 3b1e7bc..9f0383f 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/MainActivity.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/MainActivity.java @@ -6,7 +6,6 @@ import android.content.DialogInterface; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; -import android.preference.PreferenceFragment; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.design.widget.BottomNavigationView; @@ -18,14 +17,14 @@ import android.widget.Toast; import org.communiquons.android.comunic.client.R; import org.communiquons.android.comunic.client.api.APIRequest; -import org.communiquons.android.comunic.client.data.Account.Account; -import org.communiquons.android.comunic.client.data.Account.AccountUtils; -import org.communiquons.android.comunic.client.data.DatabaseHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.GetUsersHelper; -import org.communiquons.android.comunic.client.data.conversations.ConversationsListHelper; -import org.communiquons.android.comunic.client.data.friendsList.FriendRefreshLoopRunnable; +import org.communiquons.android.comunic.client.data.helpers.AccountHelper; +import org.communiquons.android.comunic.client.data.utils.AccountUtils; +import org.communiquons.android.comunic.client.data.helpers.DatabaseHelper; +import org.communiquons.android.comunic.client.data.helpers.GetUsersHelper; +import org.communiquons.android.comunic.client.data.helpers.ConversationsListHelper; +import org.communiquons.android.comunic.client.data.runnables.FriendRefreshLoopRunnable; import org.communiquons.android.comunic.client.data.services.NotificationsService; -import org.communiquons.android.comunic.client.data.utils.UiUtils; +import org.communiquons.android.comunic.client.ui.utils.UiUtils; import org.communiquons.android.comunic.client.ui.fragments.ConversationFragment; import org.communiquons.android.comunic.client.ui.fragments.ConversationsListFragment; import org.communiquons.android.comunic.client.ui.fragments.FriendsListFragment; @@ -54,7 +53,7 @@ public class MainActivity extends AppCompatActivity /** * Account object */ - private Account account; + private AccountHelper accountHelper; /** * Account utils object @@ -86,10 +85,10 @@ public class MainActivity extends AppCompatActivity super.onCreate(savedInstanceState); //Initialize account objects - account = new Account(this); + accountHelper = new AccountHelper(this); //Check if user is signed in or not - if(!account.signed_in()){ + if(!accountHelper.signed_in()){ //Open the login activity startActivity(new Intent(this, LoginActivity.class)); return; @@ -123,7 +122,7 @@ public class MainActivity extends AppCompatActivity super.onStart(); //Check if user is signed in or not - if(!account.signed_in()){ + if(!accountHelper.signed_in()){ //Open the login activity startActivity(new Intent(this, LoginActivity.class)); return; @@ -253,7 +252,7 @@ public class MainActivity extends AppCompatActivity public void onClick(DialogInterface dialog, int which) { //Sign out user - account.sign_out(); + accountHelper.sign_out(); //Redirect to login activity startActivity(new Intent(MainActivity.this, LoginActivity.class)); diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/SearchUserActivity.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/SearchUserActivity.java index 90fe68b..f37cce4 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/SearchUserActivity.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/SearchUserActivity.java @@ -16,10 +16,10 @@ import android.widget.ListView; import android.widget.Toast; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.DatabaseHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.GetUsersHelper; +import org.communiquons.android.comunic.client.data.helpers.DatabaseHelper; +import org.communiquons.android.comunic.client.data.helpers.GetUsersHelper; import org.communiquons.android.comunic.client.ui.adapters.UsersBasicAdapter; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; +import org.communiquons.android.comunic.client.data.models.UserInfo; import java.util.ArrayList; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/CommentsAdapter.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/CommentsAdapter.java index d7bb2be..536bd8d 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/CommentsAdapter.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/CommentsAdapter.java @@ -2,23 +2,18 @@ package org.communiquons.android.comunic.client.ui.adapters; import android.content.Context; import android.support.annotation.Nullable; -import android.view.ContextMenu; import android.view.LayoutInflater; -import android.view.MenuInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; -import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.Account.AccountUtils; -import org.communiquons.android.comunic.client.data.ImageLoad.ImageLoadManager; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; -import org.communiquons.android.comunic.client.data.comments.Comment; -import org.communiquons.android.comunic.client.data.comments.CommentsHelper; -import org.communiquons.android.comunic.client.data.utils.UiUtils; +import org.communiquons.android.comunic.client.data.helpers.ImageLoadHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.data.models.Comment; +import org.communiquons.android.comunic.client.ui.utils.UiUtils; import org.communiquons.android.comunic.client.ui.views.LikeButtonView; import java.util.ArrayList; @@ -86,7 +81,7 @@ class CommentsAdapter extends ArrayAdapter { R.drawable.default_account_image)); accountName.setText(""); } else { - ImageLoadManager.load(context, user.getAcountImageURL(), accountImage); + ImageLoadHelper.load(context, user.getAcountImageURL(), accountImage); accountName.setText(user.getDisplayFullName()); } @@ -99,8 +94,8 @@ class CommentsAdapter extends ArrayAdapter { commentImage.setVisibility(View.GONE); else { commentImage.setVisibility(View.VISIBLE); - ImageLoadManager.remove(commentImage); - ImageLoadManager.load(context, comment.getImage_url(), commentImage); + ImageLoadHelper.remove(commentImage); + ImageLoadHelper.load(context, comment.getImage_url(), commentImage); } diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/ConversationMessageAdapter.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/ConversationMessageAdapter.java index 55c1361..582b2b5 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/ConversationMessageAdapter.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/ConversationMessageAdapter.java @@ -4,7 +4,6 @@ import android.content.Context; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.ArrayMap; -import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; @@ -15,10 +14,10 @@ import android.widget.LinearLayout; import android.widget.TextView; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.ImageLoad.ImageLoadManager; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; -import org.communiquons.android.comunic.client.data.conversations.ConversationMessage; -import org.communiquons.android.comunic.client.data.utils.UiUtils; +import org.communiquons.android.comunic.client.data.helpers.ImageLoadHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.data.models.ConversationMessage; +import org.communiquons.android.comunic.client.ui.utils.UiUtils; import java.util.ArrayList; @@ -181,8 +180,8 @@ public class ConversationMessageAdapter extends ArrayAdapter { //Update user account image ImageView user_image = listItemView.findViewById(R.id.fragment_friendslist_item_accountimage); user_image.setImageDrawable(getContext().getDrawable(R.drawable.default_account_image)); - ImageLoadManager.load(getContext(), friendUser.getUserInfo().getAcountImageURL(), user_image); + ImageLoadHelper.load(getContext(), friendUser.getUserInfo().getAcountImageURL(), user_image); //Update user name TextView user_name = listItemView.findViewById(R.id.fragment_friendslist_item_fullname); diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/NotificationsAdapter.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/NotificationsAdapter.java index 56bd16b..0b57544 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/NotificationsAdapter.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/NotificationsAdapter.java @@ -12,10 +12,10 @@ import android.widget.ImageView; import android.widget.TextView; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.ImageLoad.ImageLoadManager; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; -import org.communiquons.android.comunic.client.data.notifications.Notif; -import org.communiquons.android.comunic.client.data.notifications.NotifsList; +import org.communiquons.android.comunic.client.data.helpers.ImageLoadHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.data.models.Notif; +import org.communiquons.android.comunic.client.data.arrays.NotifsList; import org.communiquons.android.comunic.client.data.utils.Utilities; /** @@ -68,8 +68,8 @@ public class NotificationsAdapter extends ArrayAdapter{ //Update the user account image ImageView image = convertView.findViewById(R.id.user_account_image); - ImageLoadManager.remove(image); - ImageLoadManager.load(getContext(), + ImageLoadHelper.remove(image); + ImageLoadHelper.load(getContext(), mUsersInfo.get(notif.getFrom_user_id()).getAcountImageURL(), image); diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/PostsAdapter.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/PostsAdapter.java index 2c1770d..5180714 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/PostsAdapter.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/PostsAdapter.java @@ -8,19 +8,18 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; -import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.ImageLoad.ImageLoadManager; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; -import org.communiquons.android.comunic.client.data.comments.Comment; -import org.communiquons.android.comunic.client.data.posts.Post; -import org.communiquons.android.comunic.client.data.posts.PostTypes; -import org.communiquons.android.comunic.client.data.posts.PostsList; -import org.communiquons.android.comunic.client.data.utils.UiUtils; +import org.communiquons.android.comunic.client.data.helpers.ImageLoadHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.data.models.Comment; +import org.communiquons.android.comunic.client.data.models.Post; +import org.communiquons.android.comunic.client.data.enums.PostTypes; +import org.communiquons.android.comunic.client.data.arrays.PostsList; +import org.communiquons.android.comunic.client.ui.utils.UiUtils; import org.communiquons.android.comunic.client.data.utils.Utilities; import org.communiquons.android.comunic.client.ui.views.EditCommentContentView; import org.communiquons.android.comunic.client.ui.views.LikeButtonView; @@ -101,14 +100,14 @@ public class PostsAdapter extends ArrayAdapter{ //Reset user information userAccountName.setText(""); - ImageLoadManager.remove(userAccountImage); + ImageLoadHelper.remove(userAccountImage); userAccountImage.setImageDrawable(UiUtils.getDrawable(getContext(), R.drawable.default_account_image)); //Set user information if available if(userInfo != null){ userAccountName.setText(userInfo.getDisplayFullName()); - ImageLoadManager.load(getContext(), userInfo.getAcountImageURL(), userAccountImage); + ImageLoadHelper.load(getContext(), userInfo.getAcountImageURL(), userAccountImage); } @@ -152,14 +151,14 @@ public class PostsAdapter extends ArrayAdapter{ ImageView postImage = convertView.findViewById(R.id.post_image); postImage.setVisibility(View.GONE); postImage.setImageDrawable(null); - ImageLoadManager.remove(postImage); + ImageLoadHelper.remove(postImage); if(post.getType() == PostTypes.IMAGE){ //Make image visible postImage.setVisibility(View.VISIBLE); //Load image - ImageLoadManager.load(getContext(), post.getFile_path_url(), postImage); + ImageLoadHelper.load(getContext(), post.getFile_path_url(), postImage); } //Set posts likes diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/UsersAsysncInfoAdapter.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/UsersAsysncInfoAdapter.java index 25dfd5c..d580dbc 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/UsersAsysncInfoAdapter.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/UsersAsysncInfoAdapter.java @@ -13,9 +13,9 @@ import android.widget.TextView; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.ImageLoad.ImageLoadManager; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; -import org.communiquons.android.comunic.client.data.utils.UiUtils; +import org.communiquons.android.comunic.client.data.helpers.ImageLoadHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.ui.utils.UiUtils; import java.util.ArrayList; @@ -64,7 +64,7 @@ public class UsersAsysncInfoAdapter extends ArrayAdapter { TextView account_name = convertView.findViewById(R.id.user_name); //Empty the entry - ImageLoadManager.remove(account_image); + ImageLoadHelper.remove(account_image); account_image.setImageDrawable(UiUtils.getDrawable(getContext(), R.drawable.default_account_image)); account_name.setText(""); @@ -78,7 +78,7 @@ public class UsersAsysncInfoAdapter extends ArrayAdapter { UserInfo user = usersInfos.get(userID); account_name.setText(user.getDisplayFullName()); - ImageLoadManager.load(getContext(), user.getAcountImageURL(), account_image); + ImageLoadHelper.load(getContext(), user.getAcountImageURL(), account_image); } return convertView; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/UsersBasicAdapter.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/UsersBasicAdapter.java index 7f1bc0c..c930ae6 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/UsersBasicAdapter.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/UsersBasicAdapter.java @@ -11,12 +11,11 @@ import android.widget.ImageView; import android.widget.TextView; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.ImageLoad.ImageLoadManager; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; -import org.communiquons.android.comunic.client.data.utils.UiUtils; +import org.communiquons.android.comunic.client.data.helpers.ImageLoadHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.ui.utils.UiUtils; import java.util.ArrayList; -import java.util.zip.Inflater; /** * User basic adapter @@ -59,10 +58,10 @@ public class UsersBasicAdapter extends ArrayAdapter { //Set account image ImageView account_image = convertView.findViewById(R.id.user_account_image); - ImageLoadManager.remove(account_image); + ImageLoadHelper.remove(account_image); account_image.setImageDrawable(UiUtils.getDrawable(getContext(), R.drawable.default_account_image)); - ImageLoadManager.load(getContext(), userInfos.getAcountImageURL(), account_image); + ImageLoadHelper.load(getContext(), userInfos.getAcountImageURL(), account_image); } return convertView; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/ConversationFragment.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/ConversationFragment.java index 82e66c4..97f68b9 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/ConversationFragment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/ConversationFragment.java @@ -24,17 +24,17 @@ import android.widget.Toast; import org.communiquons.android.comunic.client.ui.activities.MainActivity; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.Account.AccountUtils; -import org.communiquons.android.comunic.client.data.DatabaseHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.GetUsersHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; -import org.communiquons.android.comunic.client.data.conversations.ConversationMessage; +import org.communiquons.android.comunic.client.data.utils.AccountUtils; +import org.communiquons.android.comunic.client.data.helpers.DatabaseHelper; +import org.communiquons.android.comunic.client.data.helpers.GetUsersHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.data.models.ConversationMessage; import org.communiquons.android.comunic.client.ui.adapters.ConversationMessageAdapter; -import org.communiquons.android.comunic.client.data.conversations.ConversationMessagesHelper; -import org.communiquons.android.comunic.client.data.conversations.ConversationRefreshRunnable; -import org.communiquons.android.comunic.client.data.conversations.ConversationsInfo; -import org.communiquons.android.comunic.client.data.conversations.ConversationsListHelper; -import org.communiquons.android.comunic.client.data.utils.BitmapUtils; +import org.communiquons.android.comunic.client.data.helpers.ConversationMessagesHelper; +import org.communiquons.android.comunic.client.data.runnables.ConversationRefreshRunnable; +import org.communiquons.android.comunic.client.data.models.ConversationsInfo; +import org.communiquons.android.comunic.client.data.helpers.ConversationsListHelper; +import org.communiquons.android.comunic.client.ui.utils.BitmapUtils; import java.io.FileNotFoundException; import java.io.InputStream; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/ConversationsListFragment.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/ConversationsListFragment.java index eccb971..9cac10e 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/ConversationsListFragment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/ConversationsListFragment.java @@ -21,15 +21,15 @@ import android.widget.Toast; import org.communiquons.android.comunic.client.ui.activities.MainActivity; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.Account.AccountUtils; -import org.communiquons.android.comunic.client.data.DatabaseHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.GetUsersHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; -import org.communiquons.android.comunic.client.data.conversations.ConversationsInfo; +import org.communiquons.android.comunic.client.data.utils.AccountUtils; +import org.communiquons.android.comunic.client.data.helpers.DatabaseHelper; +import org.communiquons.android.comunic.client.data.helpers.GetUsersHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.data.models.ConversationsInfo; import org.communiquons.android.comunic.client.ui.adapters.ConversationsListAdapter; -import org.communiquons.android.comunic.client.data.conversations.ConversationsListHelper; -import org.communiquons.android.comunic.client.data.conversations.ConversationsListHelper.openConversationListener; -import org.communiquons.android.comunic.client.data.conversations.ConversationsListHelper.updateConversationListener; +import org.communiquons.android.comunic.client.data.helpers.ConversationsListHelper; +import org.communiquons.android.comunic.client.data.helpers.ConversationsListHelper.openConversationListener; +import org.communiquons.android.comunic.client.data.helpers.ConversationsListHelper.updateConversationListener; import java.util.ArrayList; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/FriendsListFragment.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/FriendsListFragment.java index aaec60d..690d76b 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/FriendsListFragment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/FriendsListFragment.java @@ -20,15 +20,15 @@ import android.widget.Toast; import org.communiquons.android.comunic.client.ui.activities.MainActivity; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.DatabaseHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.GetUsersHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; -import org.communiquons.android.comunic.client.data.conversations.ConversationsListHelper; -import org.communiquons.android.comunic.client.data.friendsList.Friend; -import org.communiquons.android.comunic.client.data.friendsList.FriendUser; +import org.communiquons.android.comunic.client.data.helpers.DatabaseHelper; +import org.communiquons.android.comunic.client.data.helpers.GetUsersHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.data.helpers.ConversationsListHelper; +import org.communiquons.android.comunic.client.data.models.Friend; +import org.communiquons.android.comunic.client.data.models.FriendUser; import org.communiquons.android.comunic.client.ui.adapters.FriendsAdapter; -import org.communiquons.android.comunic.client.data.friendsList.FriendsListHelper; -import org.communiquons.android.comunic.client.data.friendsList.FriendsUtils; +import org.communiquons.android.comunic.client.data.helpers.FriendsListHelper; +import org.communiquons.android.comunic.client.data.utils.FriendsUtils; import java.util.ArrayList; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/NotificationsFragment.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/NotificationsFragment.java index 59a4a93..5c8708a 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/NotificationsFragment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/NotificationsFragment.java @@ -15,10 +15,9 @@ import android.widget.ProgressBar; import android.widget.Toast; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.DatabaseHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.GetUsersHelper; -import org.communiquons.android.comunic.client.data.notifications.NotificationsHelper; -import org.communiquons.android.comunic.client.data.notifications.NotifsList; +import org.communiquons.android.comunic.client.data.helpers.GetUsersHelper; +import org.communiquons.android.comunic.client.data.helpers.NotificationsHelper; +import org.communiquons.android.comunic.client.data.arrays.NotifsList; import org.communiquons.android.comunic.client.ui.activities.MainActivity; import org.communiquons.android.comunic.client.ui.adapters.NotificationsAdapter; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/PostsCreateFormFragment.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/PostsCreateFormFragment.java index d1f01b0..ed01b31 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/PostsCreateFormFragment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/PostsCreateFormFragment.java @@ -9,16 +9,15 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; -import android.widget.TextView; import android.widget.Toast; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.posts.CreatePost; -import org.communiquons.android.comunic.client.data.posts.PageType; -import org.communiquons.android.comunic.client.data.posts.Post; -import org.communiquons.android.comunic.client.data.posts.PostTypes; -import org.communiquons.android.comunic.client.data.posts.PostVisibilityLevels; -import org.communiquons.android.comunic.client.data.posts.PostsHelper; +import org.communiquons.android.comunic.client.data.models.CreatePost; +import org.communiquons.android.comunic.client.data.enums.PageType; +import org.communiquons.android.comunic.client.data.models.Post; +import org.communiquons.android.comunic.client.data.enums.PostTypes; +import org.communiquons.android.comunic.client.data.enums.PostVisibilityLevels; +import org.communiquons.android.comunic.client.data.helpers.PostsHelper; /** * Posts creation form diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/PostsListFragment.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/PostsListFragment.java index bfd2183..e229187 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/PostsListFragment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/PostsListFragment.java @@ -19,17 +19,17 @@ import android.widget.ListView; import android.widget.Toast; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.Account.AccountUtils; -import org.communiquons.android.comunic.client.data.DatabaseHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.GetUsersHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; -import org.communiquons.android.comunic.client.data.comments.Comment; -import org.communiquons.android.comunic.client.data.comments.CommentsHelper; -import org.communiquons.android.comunic.client.data.likes.LikesHelper; -import org.communiquons.android.comunic.client.data.likes.LikesType; -import org.communiquons.android.comunic.client.data.posts.Post; -import org.communiquons.android.comunic.client.data.posts.PostsHelper; -import org.communiquons.android.comunic.client.data.posts.PostsList; +import org.communiquons.android.comunic.client.data.utils.AccountUtils; +import org.communiquons.android.comunic.client.data.helpers.DatabaseHelper; +import org.communiquons.android.comunic.client.data.helpers.GetUsersHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.data.models.Comment; +import org.communiquons.android.comunic.client.data.helpers.CommentsHelper; +import org.communiquons.android.comunic.client.data.helpers.LikesHelper; +import org.communiquons.android.comunic.client.data.enums.LikesType; +import org.communiquons.android.comunic.client.data.models.Post; +import org.communiquons.android.comunic.client.data.helpers.PostsHelper; +import org.communiquons.android.comunic.client.data.arrays.PostsList; import org.communiquons.android.comunic.client.data.utils.StringsUtils; import org.communiquons.android.comunic.client.ui.adapters.PostsAdapter; import org.communiquons.android.comunic.client.ui.views.EditCommentContentView; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/UpdateConversationFragment.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/UpdateConversationFragment.java index 98415e2..f47c208 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/UpdateConversationFragment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/UpdateConversationFragment.java @@ -24,13 +24,13 @@ import android.widget.Toast; import org.communiquons.android.comunic.client.ui.activities.MainActivity; import org.communiquons.android.comunic.client.R; import org.communiquons.android.comunic.client.ui.activities.SearchUserActivity; -import org.communiquons.android.comunic.client.data.Account.AccountUtils; -import org.communiquons.android.comunic.client.data.DatabaseHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.GetUsersHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; +import org.communiquons.android.comunic.client.data.utils.AccountUtils; +import org.communiquons.android.comunic.client.data.helpers.DatabaseHelper; +import org.communiquons.android.comunic.client.data.helpers.GetUsersHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; import org.communiquons.android.comunic.client.ui.adapters.UsersAsysncInfoAdapter; -import org.communiquons.android.comunic.client.data.conversations.ConversationsInfo; -import org.communiquons.android.comunic.client.data.conversations.ConversationsListHelper; +import org.communiquons.android.comunic.client.data.models.ConversationsInfo; +import org.communiquons.android.comunic.client.data.helpers.ConversationsListHelper; import java.util.ArrayList; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/UserInfosFragment.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/UserInfosFragment.java index b49f5a2..8fc9ae1 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/UserInfosFragment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/UserInfosFragment.java @@ -14,11 +14,11 @@ import android.widget.Toast; import org.communiquons.android.comunic.client.ui.activities.MainActivity; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.Account.AccountUtils; -import org.communiquons.android.comunic.client.data.DatabaseHelper; -import org.communiquons.android.comunic.client.data.ImageLoad.ImageLoadTask; -import org.communiquons.android.comunic.client.data.UsersInfo.GetUsersInfos; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; +import org.communiquons.android.comunic.client.data.utils.AccountUtils; +import org.communiquons.android.comunic.client.data.helpers.DatabaseHelper; +import org.communiquons.android.comunic.client.data.asynctasks.ImageLoadTask; +import org.communiquons.android.comunic.client.data.asynctasks.GetUsersInfos; +import org.communiquons.android.comunic.client.data.models.UserInfo; /** * User informations fragment diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/UserPageFragment.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/UserPageFragment.java index c390313..4f886b5 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/UserPageFragment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/UserPageFragment.java @@ -15,15 +15,15 @@ import android.widget.TextView; import android.widget.Toast; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.DatabaseHelper; -import org.communiquons.android.comunic.client.data.ImageLoad.ImageLoadManager; -import org.communiquons.android.comunic.client.data.UsersInfo.AdvancedUserInfo; -import org.communiquons.android.comunic.client.data.UsersInfo.GetUsersHelper; -import org.communiquons.android.comunic.client.data.UsersInfo.UserInfo; -import org.communiquons.android.comunic.client.data.posts.Post; -import org.communiquons.android.comunic.client.data.posts.PostsHelper; -import org.communiquons.android.comunic.client.data.posts.PostsList; -import org.communiquons.android.comunic.client.data.utils.UiUtils; +import org.communiquons.android.comunic.client.data.helpers.DatabaseHelper; +import org.communiquons.android.comunic.client.data.helpers.ImageLoadHelper; +import org.communiquons.android.comunic.client.data.models.AdvancedUserInfo; +import org.communiquons.android.comunic.client.data.helpers.GetUsersHelper; +import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.data.models.Post; +import org.communiquons.android.comunic.client.data.helpers.PostsHelper; +import org.communiquons.android.comunic.client.data.arrays.PostsList; +import org.communiquons.android.comunic.client.ui.utils.UiUtils; import org.communiquons.android.comunic.client.ui.activities.MainActivity; /** @@ -231,8 +231,8 @@ public class UserPageFragment extends Fragment implements PostsCreateFormFragmen //Update user name and account image user_name.setText(userInfo.getDisplayFullName()); - ImageLoadManager.remove(user_image); - ImageLoadManager.load(getActivity(), userInfo.getAcountImageURL(), user_image); + ImageLoadHelper.remove(user_image); + ImageLoadHelper.load(getActivity(), userInfo.getAcountImageURL(), user_image); //Load the list of posts of the user load_posts(); diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/utils/BitmapUtils.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/utils/BitmapUtils.java similarity index 98% rename from app/src/main/java/org/communiquons/android/comunic/client/data/utils/BitmapUtils.java rename to app/src/main/java/org/communiquons/android/comunic/client/ui/utils/BitmapUtils.java index a02d3aa..3ca5745 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/utils/BitmapUtils.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/utils/BitmapUtils.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.utils; +package org.communiquons.android.comunic.client.ui.utils; import android.graphics.Bitmap; import android.graphics.BitmapFactory; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/utils/UiUtils.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/utils/UiUtils.java similarity index 96% rename from app/src/main/java/org/communiquons/android/comunic/client/data/utils/UiUtils.java rename to app/src/main/java/org/communiquons/android/comunic/client/ui/utils/UiUtils.java index 16e93e2..1731c25 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/utils/UiUtils.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/utils/UiUtils.java @@ -1,4 +1,4 @@ -package org.communiquons.android.comunic.client.data.utils; +package org.communiquons.android.comunic.client.ui.utils; import android.app.AlertDialog; import android.content.Context; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/views/LikeButtonView.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/views/LikeButtonView.java index c4e61d5..d872e33 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/views/LikeButtonView.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/views/LikeButtonView.java @@ -12,7 +12,7 @@ import android.widget.LinearLayout; import android.widget.TextView; import org.communiquons.android.comunic.client.R; -import org.communiquons.android.comunic.client.data.utils.UiUtils; +import org.communiquons.android.comunic.client.ui.utils.UiUtils; /** * Like button view