package net.micode.notes;

import android.app.Application;
import android.graphics.Bitmap;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.SimpleTarget;
import com.bumptech.glide.request.transition.Transition;
import com.sendtion.xrichtext.IImageLoader;
import com.sendtion.xrichtext.XRichText;

import net.micode.notes.utils.ContextUtils;
import net.micode.notes.utils.TransformationScale;

public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ContextUtils.setContext(this);

        XRichText.getInstance().setImageLoader(new IImageLoader() {
            @Override
            public void loadImage(final String imagePath, final ImageView imageView, final int imageHeight) {
                Glide.with(getApplicationContext()).asBitmap().load(imagePath).into(new TransformationScale(imageView));
            }
        });
    }
}
