/**
 * Android photos application project.
 *
 * Copyright 2016 Arno Zhang <zyfgood12@163.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.jungle.apps.photos.base.app;

import com.jungle.apps.photos.base.manager.PhotosEntityManager;
import com.jungle.apps.photos.module.favorite.data.pic.FavoriteManager;
import com.jungle.apps.photos.module.favorite.data.tag.FavoriteTagManager;
import com.jungle.base.app.AppCore;
import com.jungle.base.app.BaseApplication;
import com.jungle.base.utils.FileUtils;
import com.jungle.base.utils.NetworkUtils;
import com.jungle.imageloader.ImageLoaderUtils;

public class PhotoAppCore extends AppCore {

    public PhotoAppCore(BaseApplication app) {
        super(app);
    }

    @Override
    public void onCreate() {
        super.onCreate();
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
    }

    @Override
    protected void startInternal() {
        super.startInternal();

        NetworkUtils.getNetworkType();
        PhotosEntityManager.getInstance();
        FavoriteManager.getInstance();
        FavoriteTagManager.getInstance();
        ImageLoaderUtils.initImageLoader(getApplication(), getImageCacheDirectory());
    }

    protected String getImageCacheDirectory() {
        return FileUtils.getExternalCachePath();
    }
}

@@ -694,16 +694,72 @@
 e.app;%0A%0A
+import android.graphics.Bitmap;%0Aimport android.net.Uri;%0A
 import c
@@ -806,32 +806,32 @@
 sEntityManager;%0A
-
 import com.jungl
@@ -1171,16 +1171,53 @@
 erUtils;
+%0Aimport com.jungle.share.ShareHelper;
 %0A%0Apublic
@@ -1725,32 +1725,32 @@
 .getInstance();%0A
-
         ImageLoa
@@ -1819,16 +1819,672 @@
 ory());%0A
+        ShareHelper.getInstance().setShareImageLoader(new ShareHelper.ShareImageLoader() %7B%0A            @Override%0A            public void loadImage(String url, final Callback callback) %7B%0A                ImageLoaderUtils.loadImage(url, new ImageLoaderUtils.ImageLoadListener() %7B%0A                    @Override%0A                    public void onSuccess(Uri uri, Bitmap bitmap) %7B%0A                        callback.onSuccess(bitmap);%0A                    %7D%0A%0A                    @Override%0A                    public void onFailed(int retCode) %7B%0A                        callback.onFailed(retCode);%0A                    %7D%0A                %7D);%0A            %7D%0A        %7D);%0A
     %7D%0A%0A 

add share bitmap request handler.