package net.wholesome.wholesomestart.helpers;

import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;

import java.util.Random;

public class GeneralHelpers {
    private static String SHARED_PREFS_NAME = "wholesome_start";
    private static String TIME_HOUR_SHARED_PREF = "timeHour";
    private static String TIME_MINUTE_SHARED_PREF = "timeMinute";

    private static int DEFAULT_TIME_HOUR = 8;
    private static int DEFAULT_TIME_MINUTE = 0;

    private static String[] GREETINGS = {
            "Have a great day!",
            "I love you!",
            "You're amazing!",
            "You're the best!",
            "Be the best you!",
            "You go, girl!",
            "Be kind!",
            "Love today!",
            "Appreciate the day!",
            "Forgive!",
            "Be calm!"
    };

    private static String LOG_TAG = "WholesomeStart";

    public static String getRandomGreeting() {
        Random random = new Random();
        return GREETINGS[random.nextInt(GREETINGS.length)];
    }

    public static void saveTime(Context context, int hour, int minute) {
        SharedPreferences sp = context.getSharedPreferences(SHARED_PREFS_NAME,
                Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = sp.edit();

        editor.putInt(TIME_HOUR_SHARED_PREF, hour);
        editor.putInt(TIME_MINUTE_SHARED_PREF, minute);
        editor.apply();
    }

    public static int getTimeHour(Context context) {
        SharedPreferences sp = context.getSharedPreferences(SHARED_PREFS_NAME,
                Context.MODE_PRIVATE);
        return sp.getInt(TIME_HOUR_SHARED_PREF, DEFAULT_TIME_HOUR);
    }

    public static int getTimeMinute(Context context) {
        SharedPreferences sp = context.getSharedPreferences(SHARED_PREFS_NAME,
                Context.MODE_PRIVATE);
        return sp.getInt(TIME_MINUTE_SHARED_PREF, DEFAULT_TIME_MINUTE);
    }

    public static void Log(String message) {
        Log.i(LOG_TAG, message);
    }
}

@@ -577,35 +577,14 @@
    %22
-I love you!%22,%0A            %22
+%CA%95%CA%98%E2%80%BF%CA%98%CA%94 
 You'
@@ -625,16 +625,23 @@
 the best
+ friend
 !%22,%0A    
@@ -690,17 +690,17 @@
 ou go, g
-i
+u
 rl!%22,%0A  
@@ -714,15 +714,18 @@
    %22
-Be kind
+Love today
 !%22,%0A
@@ -741,77 +741,289 @@
    %22
-Love today!%22,%0A            %22Appreciate the day!%22,%0A            %22For
+(%EF%BE%9F%E3%83%AE%EF%BE%9F) Appreciate the day!%22,%0A            %22Be a great person!%22,%0A            %22%5Cu2764 I love you! %5Cu2764%22, // %3C3 %3C3 %3C3%0A            %22Your friends love you!%22,%0A            %22Go love yourself!%22,%0A            %22I believe in you!%22,%0A            %22%E2%97%95 %E2%97%A1 %E2%97%95 You can do it!%22,%0A            %22Never 
 give
+ up
 !%22,%0A
@@ -1039,15 +1039,274 @@
    %22
-Be calm
+(%E3%81%A5%EF%BD%A1%E2%97%95%E2%80%BF%E2%80%BF%E2%97%95%EF%BD%A1)%E3%81%A5 *virtual hug*%22,%0A            %22Believe in yourself!%22,%0A            %22%E0%B2%A0_%E0%B2%B0%E0%B3%83 You can do anything!%22,%0A            %22%E2%99%A5%E2%95%AD%E2%95%AE%E2%99%A5 You sexy beast!%22,%0A            %22Be strong!%22,%0A            %22Slash - Promise%22,%0A            %22(%EF%BD%A1%EF%BD%A5_%EF%BD%A5%EF%BD%A1) You look cute today.%22,%0A            %22Do your best
 !%22%0A 

Change greetings