// 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);
// }


import android.app.Activity;
import android.content.Context;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import static com.antest1.kcanotify.KcaUtils.adjustAlpha;
package com.antest1.kcanotify;

/**
 * Created by Gyeong Bok Lee on 2017-02-18.
 */




public class KcaCustomToast extends Toast {
    Context mContext;

    public KcaCustomToast(Context context) {
        super(context);
        mContext = context;
    }

    public void showToast(String body, int duration, int color) {
        LayoutInflater inflater;
        View v;

        inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        v = inflater.inflate(R.layout.toast_layout, null);
        TextView text = (TextView) v.findViewById(R.id.toast_text);
        text.setText(body);
// 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/KcaCustomToast.java
import android.app.Activity;
import android.content.Context;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import static com.antest1.kcanotify.KcaUtils.adjustAlpha;

package com.antest1.kcanotify;

/**
 * Created by Gyeong Bok Lee on 2017-02-18.
 */




public class KcaCustomToast extends Toast {
    Context mContext;

    public KcaCustomToast(Context context) {
        super(context);
        mContext = context;
    }

    public void showToast(String body, int duration, int color) {
        LayoutInflater inflater;
        View v;

        inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        v = inflater.inflate(R.layout.toast_layout, null);
        TextView text = (TextView) v.findViewById(R.id.toast_text);
        text.setText(body);
        text.setBackgroundColor(adjustAlpha(color, 0.8f));