// Path: app/src/main/java/com/github/bettehem/messenger/tools/listeners/ProfileListener.java
// public interface ProfileListener {
//     void onProfileSaved(UserProfile userProfile);
//     void onProfileDeleted(String profileName);
// }
// 
// Path: app/src/main/java/com/github/bettehem/messenger/tools/users/UserProfile.java
// public class UserProfile {
//     public String emoji;
//     public String name;
//     public String status;
//     private boolean hasData;
// 
//     public UserProfile(String emoji, String name, String status){
//         this.emoji = emoji;
//         this.name = name;
//         this.status = status;
//         hasData = true;
//     }
// 
//     public boolean hasData(){
//         return (hasData && !emoji.contentEquals("") && !name.contentEquals("") && !status.contentEquals(""));
//     }
// }


import android.content.Context;
import com.github.bettehem.androidtools.Preferences;
import com.github.bettehem.messenger.tools.listeners.ProfileListener;
import com.github.bettehem.messenger.tools.users.UserProfile;
package com.github.bettehem.messenger.tools.managers;


public abstract class ProfileManager {

    public static final String FILENAME = "UserProfile";
    private static ProfileListener profileListener;

    public static void saveProfile(final Context context, final UserProfile userProfile){
        Preferences.saveString(context, "emoji", userProfile.emoji, FILENAME);
        Preferences.saveString(context, "name", userProfile.name, FILENAME);
        Preferences.saveString(context, "status", userProfile.status, FILENAME);
        if (profileListener != null){
            profileListener.onProfileSaved(userProfile);
        }
    }

    public static UserProfile getProfile(Context context){
        String emoji = Preferences.loadString(context, "emoji", FILENAME);
        String name = Preferences.loadString(context, "name", FILENAME);
// Path: app/src/main/java/com/github/bettehem/messenger/tools/listeners/ProfileListener.java
// public interface ProfileListener {
//     void onProfileSaved(UserProfile userProfile);
//     void onProfileDeleted(String profileName);
// }
// 
// Path: app/src/main/java/com/github/bettehem/messenger/tools/users/UserProfile.java
// public class UserProfile {
//     public String emoji;
//     public String name;
//     public String status;
//     private boolean hasData;
// 
//     public UserProfile(String emoji, String name, String status){
//         this.emoji = emoji;
//         this.name = name;
//         this.status = status;
//         hasData = true;
//     }
// 
//     public boolean hasData(){
//         return (hasData && !emoji.contentEquals("") && !name.contentEquals("") && !status.contentEquals(""));
//     }
// }


// Path: app/src/main/java/com/github/bettehem/messenger/tools/managers/ProfileManager.java
import android.content.Context;
import com.github.bettehem.androidtools.Preferences;
import com.github.bettehem.messenger.tools.listeners.ProfileListener;
import com.github.bettehem.messenger.tools.users.UserProfile;

package com.github.bettehem.messenger.tools.managers;


public abstract class ProfileManager {

    public static final String FILENAME = "UserProfile";
    private static ProfileListener profileListener;

    public static void saveProfile(final Context context, final UserProfile userProfile){
        Preferences.saveString(context, "emoji", userProfile.emoji, FILENAME);
        Preferences.saveString(context, "name", userProfile.name, FILENAME);
        Preferences.saveString(context, "status", userProfile.status, FILENAME);
        if (profileListener != null){
            profileListener.onProfileSaved(userProfile);
        }
    }

    public static UserProfile getProfile(Context context){
        String emoji = Preferences.loadString(context, "emoji", FILENAME);
        String name = Preferences.loadString(context, "name", FILENAME);
        String status = Preferences.loadString(context, "status", FILENAME);