package com.atmob.voiceai.module.setting;

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

import androidx.annotation.Nullable;

import com.atmob.app.lib.base.BaseActivity;
import com.atmob.voiceai.databinding.SettingActivityBinding;

import dagger.hilt.android.AndroidEntryPoint;

@AndroidEntryPoint
public class SettingActivity extends BaseActivity<SettingActivityBinding> {

    private SettingViewModel settingViewModel;


    public static void start(Context context) {
        Intent intent = new Intent(context, SettingActivity.class);
        if (!(context instanceof Activity)) {
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        }
        context.startActivity(intent);
    }


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
        initObserver();
    }

    private void initObserver() {

    }

    private void initView() {
        addTopStatusBarHeight(binding.toolbar);
        binding.toolbar.setNavigationOnClickListener(v -> finish());
    }

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

    @Override
    protected void initViewModel() {
        super.initViewModel();
        settingViewModel = getViewModelProvider().get(SettingViewModel.class);
        binding.setSettingViewModel(settingViewModel);
    }
}
