package com.datarecovery.master.module.browser;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;


import com.atmob.app.lib.livedata.SingleLiveEvent;

import javax.inject.Inject;

import dagger.hilt.android.lifecycle.HiltViewModel;

@HiltViewModel
public class BrowserViewModel extends ViewModel {

    private final SingleLiveEvent<?> onFinishEvent = new SingleLiveEvent<>();

    private final MutableLiveData<String> webTitle = new MutableLiveData<>();

    @Inject
    public BrowserViewModel() {
    }

    public LiveData<?> getOnFinishEvent() {
        return onFinishEvent;
    }

    public LiveData<String> getWebTitle() {
        return webTitle;
    }

    public void onBackClick() {
        onFinishEvent.call();
    }

    public void setWebTitle(String webTitle) {
        this.webTitle.setValue(webTitle);
    }
}
