package com.gh.gamecenter.login.view;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.NonNull;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.gh.gamecenter.common.base.activity.ToolBarActivity;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.constant.RouteConsts;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.core.utils.DisplayUtils;
import com.gh.gamecenter.login.R;

/**
 * Created by khy on 14/08/17.
 */
@Route(path = RouteConsts.activity.loginActivity)
public class LoginActivity extends ToolBarActivity {

    @Override
    protected Intent provideNormalIntent() {
        return getTargetIntent(this, LoginActivity.class, LoginFragment.class);
    }

    @NonNull
    public static Intent getIntent(Context context, String entrance) {
        return getIntent(context, entrance, false);
    }

    @NonNull
    public static Intent getIntent(Context context, String entrance, boolean isFromQuickLogin) {
        Bundle bundle = new Bundle();
        bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
        bundle.putBoolean(EntranceConsts.KEY_FROM_QUICK_LOGIN, isFromQuickLogin);
        return getTargetIntent(context, LoginActivity.class, LoginFragment.class, bundle);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        hideToolbar(true);
        DisplayUtils.setStatusBarColor(this, R.color.transparent, !mIsDarkModeOn);
    }

    @Override
    protected boolean isAutoResetViewBackgroundEnabled() {
        return true;
    }

    @Override
    protected void onDarkModeChanged() {
        super.onDarkModeChanged();
        DisplayUtils.setStatusBarColor(this, R.color.transparent, !mIsDarkModeOn);
    }
}
