public class InSquareProfile
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
InSquareProfile.InSquareProfileListener |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
email |
private static java.lang.String |
EMAIL_KEY |
private static java.lang.String |
FACEBOOK_EMAIL_KEY |
private static java.lang.String |
FACEBOOK_ID_KEY |
private static java.lang.String |
FACEBOOK_NAME_KEY |
private static java.lang.String |
FACEBOOK_TOKEN_KEY |
static java.lang.String |
facebookEmail |
static java.lang.String |
facebookId |
static java.lang.String |
facebookName |
static java.lang.String |
facebookToken |
private static java.lang.String |
FAVOURITE_SQUARES_KEY |
private static java.util.ArrayList<Square> |
favouriteSquaresList
The list of the squares favoured by the user
|
private static java.lang.String |
GOOGLE_EMAIL_KEY |
private static java.lang.String |
GOOGLE_ID_KEY |
private static java.lang.String |
GOOGLE_NAME_KEY |
private static java.lang.String |
GOOGLE_TOKEN_KEY |
static java.lang.String |
googleEmail |
static java.lang.String |
googleId |
static java.lang.String |
googleName |
static java.lang.String |
googleToken |
private static java.util.ArrayList<InSquareProfile.InSquareProfileListener> |
listeners |
private static java.lang.String |
OUTGOING_MESSAGES |
private static java.util.HashMap<java.lang.String,java.util.ArrayList<Message>> |
outgoingMessages
The map of the messages I'm currently trying to send
|
private static java.lang.String |
OWNED_SQUARES_KEY |
private static java.util.ArrayList<Square> |
ownedSquaresList
The list of the squares owned by the user
|
private static java.lang.String |
PICTURE_URL_KEY |
static java.lang.String |
pictureUrl |
private static InSquareProfile |
profile |
private static java.lang.String |
RECENT_SQUARES_KEY |
private static java.util.ArrayList<Square> |
recentSquaresList
The list of the squares recently used by the user
|
private static java.lang.String |
SHOW_TUTORIAL |
static boolean |
showTutorial |
private static java.lang.String |
TAG |
private static java.lang.String |
USER_ID_KEY |
static java.lang.String |
userId |
static java.lang.String |
username |
private static java.lang.String |
USERNAME_KEY |
Modifier | Constructor and Description |
---|---|
private |
InSquareProfile() |
Modifier and Type | Method and Description |
---|---|
static void |
addFav(Square square)
Adds the square passed as parameter to the list of the favourite squares
|
static void |
addListener(InSquareProfile.InSquareProfileListener listener) |
static void |
addOutgoing(java.lang.String mSquareId,
Message message,
Context c)
Adds a message to the list of outgoing messages
|
static void |
addOwned(Square square)
Adds the square passed as parameter to the list of the owned squares
|
static void |
addRecent(Square square)
Adds the square passed as parameter to the list of the recent squares
|
static void |
clearFacebookCredentials(Context c)
Removes Facebook's saved credentials
|
static void |
clearGoogleCredentials(Context c)
Removes Google's saved credentials
|
static void |
clearProfileCredentials(Context c)
Clears all the credentials saved on the disk
|
static void |
downloadAllSquares()
Starts the download of owned, favourites and recent squares
|
static void |
downloadFavoriteSquares()
Makes a GET request to the server to download the favourite squares
|
static void |
downloadOwnedSquares()
Makes a GET request to the server to download the owned squares
|
static void |
downloadRecentSquares()
Makes a GET request to the server to download the recent squares
|
static java.util.ArrayList<Square> |
getFavouriteSquaresList() |
static InSquareProfile |
getInstance(Context c)
Loads the data from the disk and creates user's InSquareProfile
|
static java.util.HashMap<java.lang.String,java.util.ArrayList<Message>> |
getOutgoingMessages() |
static java.util.ArrayList<Square> |
getOwnedSquaresList() |
static java.lang.String |
getPictureUrl() |
static java.util.ArrayList<Square> |
getRecentSquaresList() |
static java.lang.String |
getUserId() |
static java.lang.String |
getUsername()
Return an available username.
|
static boolean |
hasLoginData()
Checks if there are userID, username and email available
|
static boolean |
isFacebookConnected()
Checks if the Facebook Access Token is available
|
static boolean |
isFav(java.lang.String squareId)
Checks if there is a square with the id equals to the one passed as parameter inside the favourite squares list
|
static boolean |
isGoogleConnected()
Checks if the Google Access Token is available
|
static boolean |
isOwned(java.lang.String squareId)
Checks if there is a square with the id equals to the one passed as parameter inside the owned squares list
|
static boolean |
isRecent(java.lang.String squareId)
Checks if there is a square with the id equals to the one passed as parameter inside the recent squares list
|
static Bitmap |
loadProfileImageFromStorage(Context context)
Loads an image from the local storage
|
static void |
removeFav(java.lang.String square)
Removes the square passed as parameter from the list of the favourite squares
|
static void |
removeListener(InSquareProfile.InSquareProfileListener listener) |
static void |
removeOutgoing(java.lang.String mSquareId,
Message m,
Context c)
Removes a message from the list of outgoing messages
|
static void |
removeOwned(java.lang.String square)
Removes the square passed as parameter from the list of the owned squares
|
static void |
removeRecent(java.lang.String square)
Removes the square passed as parameter from the list of the recent squares
|
static void |
save(Context c)
Saves locally user's data
|
static java.lang.String |
saveToInternalStorage(Context currentContext,
Bitmap bitmap)
Saves an image in the local storage
|
static void |
setFavouriteSquaresList(java.util.ArrayList<Square> favouriteSquaresList)
Sets the favourite squares list, notifying the listeners
|
static void |
setOwnedSquaresList(java.util.ArrayList<Square> ownedSquaresList)
Sets the owned squares list, notifying the listeners
|
static void |
setRecentSquaresList(java.util.ArrayList<Square> recentSquaresList)
Sets the recent squares list, notifying the listeners
|
static void |
setShowTutorial(boolean showTutorial,
Context context) |
static boolean |
showTutorial() |
java.lang.String |
toString() |
private static final java.lang.String TAG
private static final java.lang.String USER_ID_KEY
private static final java.lang.String USERNAME_KEY
private static final java.lang.String EMAIL_KEY
private static final java.lang.String PICTURE_URL_KEY
private static final java.lang.String OWNED_SQUARES_KEY
private static final java.lang.String FAVOURITE_SQUARES_KEY
private static final java.lang.String RECENT_SQUARES_KEY
private static final java.lang.String OUTGOING_MESSAGES
private static final java.lang.String FACEBOOK_ID_KEY
private static final java.lang.String FACEBOOK_TOKEN_KEY
private static final java.lang.String FACEBOOK_EMAIL_KEY
private static final java.lang.String FACEBOOK_NAME_KEY
private static final java.lang.String GOOGLE_ID_KEY
private static final java.lang.String GOOGLE_TOKEN_KEY
private static final java.lang.String GOOGLE_EMAIL_KEY
private static final java.lang.String GOOGLE_NAME_KEY
private static final java.lang.String SHOW_TUTORIAL
private static java.util.ArrayList<InSquareProfile.InSquareProfileListener> listeners
private static java.util.ArrayList<Square> ownedSquaresList
private static java.util.ArrayList<Square> favouriteSquaresList
private static java.util.ArrayList<Square> recentSquaresList
private static java.util.HashMap<java.lang.String,java.util.ArrayList<Message>> outgoingMessages
public static java.lang.String userId
public static java.lang.String username
public static java.lang.String email
public static java.lang.String pictureUrl
public static java.lang.String facebookId
public static java.lang.String facebookToken
public static java.lang.String facebookEmail
public static java.lang.String facebookName
public static java.lang.String googleId
public static java.lang.String googleToken
public static java.lang.String googleEmail
public static java.lang.String googleName
public static boolean showTutorial
private static InSquareProfile profile
public static InSquareProfile getInstance(Context c)
c
- The context of the applicationpublic static void save(Context c)
c
- The context of the applicationpublic static java.lang.String getUsername()
public static java.lang.String getUserId()
public static java.lang.String getPictureUrl()
public static boolean hasLoginData()
public static boolean isFacebookConnected()
public static void clearFacebookCredentials(Context c)
public static boolean isGoogleConnected()
public static void clearGoogleCredentials(Context c)
public static void clearProfileCredentials(Context c)
public java.lang.String toString()
toString
in class java.lang.Object
public static void addListener(InSquareProfile.InSquareProfileListener listener)
public static void removeListener(InSquareProfile.InSquareProfileListener listener)
public static void addOutgoing(java.lang.String mSquareId, Message message, Context c)
mSquareId
- the square of the messagemessage
- the Message itselfpublic static void removeOutgoing(java.lang.String mSquareId, Message m, Context c)
mSquareId
- the square of the messagem
- the Message itselfpublic static void addOwned(Square square)
square
- The square you want to addpublic static void removeOwned(java.lang.String square)
square
- The square you want to removepublic static boolean isOwned(java.lang.String squareId)
squareId
- The id of the squarepublic static void addFav(Square square)
square
- The square you want to addpublic static void removeFav(java.lang.String square)
square
- The square you want to removepublic static boolean isFav(java.lang.String squareId)
squareId
- The id of the squarepublic static void addRecent(Square square)
square
- The square you want to addpublic static void removeRecent(java.lang.String square)
square
- The square you want to removepublic static boolean isRecent(java.lang.String squareId)
squareId
- The id of the squarepublic static java.util.ArrayList<Square> getOwnedSquaresList()
public static java.util.ArrayList<Square> getFavouriteSquaresList()
public static java.util.ArrayList<Square> getRecentSquaresList()
public static java.util.HashMap<java.lang.String,java.util.ArrayList<Message>> getOutgoingMessages()
public static void setOwnedSquaresList(java.util.ArrayList<Square> ownedSquaresList)
ownedSquaresList
- the list to setpublic static void setFavouriteSquaresList(java.util.ArrayList<Square> favouriteSquaresList)
favouriteSquaresList
- the list to setpublic static void setRecentSquaresList(java.util.ArrayList<Square> recentSquaresList)
recentSquaresList
- the list to setpublic static java.lang.String saveToInternalStorage(Context currentContext, Bitmap bitmap)
bitmap
- the image to savepublic static Bitmap loadProfileImageFromStorage(Context context)
public static void downloadAllSquares()
public static void downloadRecentSquares()
public static void downloadFavoriteSquares()
public static void downloadOwnedSquares()
public static boolean showTutorial()
public static void setShowTutorial(boolean showTutorial, Context context)