package com.keyborad.theme.trendyborad.environment.jb;

import android.app.Application;
import android.content.Context;

import com.applock.filemanager.magiclock.control.MagicLock;
import com.keyborad.theme.trendyborad.environment.MainActivity2;

public class MagicLockManager {
   public static final String TAG = "--ocean--";
   private Context ctx;
   private volatile static MagicLockManager mInstance;

   public static MagicLockManager init(final Context context) {
      //第一次判空
      if (mInstance == null) {
         //进入同步区域
         synchronized (MagicLockManager.class) {
            //第二次判空
            if (mInstance == null) {
               mInstance = new MagicLockManager(context);
            }
         }
      }
      return mInstance;
   }

   public static MagicLockManager getInstance() {
      return mInstance;
   }

   private MagicLockManager(Context ctx) {
      this.ctx = ctx;
      init();
   }

   private void init() {
      MagicLock.getInstance((Application) ctx).addShowCoverActivity(MainActivity2.class.getSimpleName());
      MagicLock.getInstance((Application) ctx).startShowAdLayout();
   }

}
