// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static int adjustAlpha(int color, float factor) {
//     int alpha = Math.round(Color.alpha(color) * factor);
//     int red = Color.red(color);
//     int green = Color.green(color);
//     int blue = Color.blue(color);
//     return Color.argb(alpha, red, green, blue);
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static int getWindowLayoutType() {
//     int windowLayoutType = -1;
//     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
//         windowLayoutType = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
//     } else {
//         windowLayoutType = WindowManager.LayoutParams.TYPE_PHONE;
//     }
//     return windowLayoutType;
// }


import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.provider.Settings;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationManagerCompat;
import android.util.Log;
import android.view.Display;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import static com.antest1.kcanotify.KcaUtils.adjustAlpha;
import static com.antest1.kcanotify.KcaUtils.getWindowLayoutType;
    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        active = true;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
                && !Settings.canDrawOverlays(getApplicationContext())) {
            // Can not draw overlays: pass
            stopSelf();
        } else {
            mHandler = new Handler();
            LayoutInflater mInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            mView = mInflater.inflate(R.layout.toast_layout, null);
            mView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);

            toast_view = mView.findViewById(R.id.toast_text);
            mView.setVisibility(View.GONE);
            //mView.setOnClickListener(mViewClickListener);
            mView.setOnTouchListener(mViewTouchListener);
            // Button (Fairy) Settings
            mParams = new WindowManager.LayoutParams(
                    WindowManager.LayoutParams.WRAP_CONTENT,
                    WindowManager.LayoutParams.WRAP_CONTENT,
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static int adjustAlpha(int color, float factor) {
//     int alpha = Math.round(Color.alpha(color) * factor);
//     int red = Color.red(color);
//     int green = Color.green(color);
//     int blue = Color.blue(color);
//     return Color.argb(alpha, red, green, blue);
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static int getWindowLayoutType() {
//     int windowLayoutType = -1;
//     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
//         windowLayoutType = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
//     } else {
//         windowLayoutType = WindowManager.LayoutParams.TYPE_PHONE;
//     }
//     return windowLayoutType;
// }


// Path: app/src/main/java/com/antest1/kcanotify/KcaCustomToastService.java
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.provider.Settings;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationManagerCompat;
import android.util.Log;
import android.view.Display;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import static com.antest1.kcanotify.KcaUtils.adjustAlpha;
import static com.antest1.kcanotify.KcaUtils.getWindowLayoutType;

    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        active = true;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
                && !Settings.canDrawOverlays(getApplicationContext())) {
            // Can not draw overlays: pass
            stopSelf();
        } else {
            mHandler = new Handler();
            LayoutInflater mInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            mView = mInflater.inflate(R.layout.toast_layout, null);
            mView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);

            toast_view = mView.findViewById(R.id.toast_text);
            mView.setVisibility(View.GONE);
            //mView.setOnClickListener(mViewClickListener);
            mView.setOnTouchListener(mViewTouchListener);
            // Button (Fairy) Settings
            mParams = new WindowManager.LayoutParams(
                    WindowManager.LayoutParams.WRAP_CONTENT,
                    WindowManager.LayoutParams.WRAP_CONTENT,
                    getWindowLayoutType(),