package com.hh.arome.ui;

import android.app.Dialog;
import android.os.Handler;
import android.widget.RelativeLayout;

import com.common.lib_base.common.local.AppLocalConfigHandler;
import com.common.lib_base.utils.GlideUtils;
import com.common.lib_base.utils.LogUtils;
import com.common.lib_base.utils.StringUtils;
import com.common.lib_base.utils.ui.ToastUtils;
import com.hh.arome.R;
import com.hh.arome.common.IAppLocalConfig;
import com.hh.arome.ui.base.BaseHHActivity;
import com.hjq.permissions.OnPermissionCallback;
import com.hjq.permissions.Permission;
import com.hjq.permissions.XXPermissions;

import java.util.List;

/**
 * Date: 2022/6/27 0027 9:53
 * Description:开屏页面
 */
public class SplashActivity extends BaseHHActivity {

    IAppLocalConfig localConfig;

    @Override
    public int setLayout() {
        return R.layout.activity_splash;
    }


    RelativeLayout item_root;

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

        item_root = findViewById(R.id.item_root);

    }

    @Override
    protected void initData() {

        localConfig = AppLocalConfigHandler.create(mContext.getApplicationContext(), IAppLocalConfig.class);

        String splashImageUrl = localConfig.getSplashImageUrl("");

        if (StringUtils.isNotNull(splashImageUrl)) {
            GlideUtils.loadRelativeLayout(SplashActivity.this, splashImageUrl, item_root);
        }

        new Handler().postDelayed(new Runnable() {
            public void run() {
                startActivityAndFinish(MainActivity.class);
            }
        }, 1 * 1000);

    }

    @Override
    protected void initListener() {

    }


}
